@wix/auto_sdk_duplexer_publisher 1.0.12 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/auto_sdk_duplexer_publisher",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",
@@ -21,23 +21,16 @@
21
21
  "import": "./build/es/meta.mjs",
22
22
  "require": "./build/cjs/meta.js",
23
23
  "types": "./build/es/meta.d.mts"
24
- },
25
- "./schemas": {
26
- "import": "./build/es/schemas.mjs",
27
- "require": "./build/cjs/schemas.js",
28
- "types": "./build/es/schemas.d.mts"
29
24
  }
30
25
  },
31
26
  "files": [
32
27
  "build",
33
28
  "meta",
34
- "service-plugins",
35
- "schemas"
29
+ "service-plugins"
36
30
  ],
37
31
  "dependencies": {
38
- "@wix/sdk-runtime": "^1.0.12",
39
- "@wix/sdk-types": "^1.17.7",
40
- "zod": "^4.3.6"
32
+ "@wix/sdk-runtime": "^1.0.24",
33
+ "@wix/sdk-types": "^1.17.11"
41
34
  },
42
35
  "devDependencies": {
43
36
  "tsup": "^8.4.0",
@@ -57,5 +50,5 @@
57
50
  "fqdn": "wix.realtime.v4.message"
58
51
  }
59
52
  },
60
- "falconPackageHash": "9d606eba873604cf73358dcb02a9dd68c3c645f50d05a23f1fc6d71f"
53
+ "falconPackageHash": "de4e98a9d0f533ab4bf2e4679e685eb86899a82d2e9fc3b1d8cde152"
61
54
  }
@@ -1,19 +0,0 @@
1
- import * as z from 'zod';
2
-
3
- declare const PublishRequest: z.ZodObject<{
4
- message: z.ZodObject<{
5
- _id: z.ZodOptional<z.ZodString>;
6
- eventName: z.ZodString;
7
- payload: z.ZodRecord<z.ZodString, z.ZodAny>;
8
- publisherInfo: z.ZodOptional<z.ZodObject<{
9
- uid: z.ZodOptional<z.ZodString>;
10
- }, z.core.$strip>>;
11
- }, z.core.$strip>;
12
- options: z.ZodObject<{
13
- channels: z.ZodArray<z.ZodString>;
14
- resourceId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
15
- }, z.core.$strip>;
16
- }, z.core.$strip>;
17
- declare const PublishResponse: z.ZodObject<{}, z.core.$strip>;
18
-
19
- export { PublishRequest, PublishResponse };
@@ -1,69 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // schemas.ts
31
- var schemas_exports = {};
32
- __export(schemas_exports, {
33
- PublishRequest: () => PublishRequest,
34
- PublishResponse: () => PublishResponse
35
- });
36
- module.exports = __toCommonJS(schemas_exports);
37
-
38
- // src/realtime-v4-message-publisher.schemas.ts
39
- var z = __toESM(require("zod"));
40
- var PublishRequest = z.object({
41
- message: z.object({
42
- _id: z.string().describe("Unique message identifier").regex(
43
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
44
- "Must be a valid GUID"
45
- ).optional(),
46
- eventName: z.string().describe('Event name, e.g "product_added"').max(1e3),
47
- payload: z.record(z.string(), z.any()).describe(
48
- 'Event payload, e.g { "product_id": "123", "product_name": "Product 1" }'
49
- ),
50
- publisherInfo: z.object({
51
- uid: z.string().describe(
52
- "Arbitrary string identifier for the publisher, can be used by subscribers to identify the publisher."
53
- ).max(1e3).optional()
54
- }).describe("Info regarding the publisher of the message").optional()
55
- }),
56
- options: z.object({
57
- channels: z.array(z.string()).max(10),
58
- resourceId: z.string().describe(
59
- 'Optional sub resource identifier, e.g "important_notification", only subscribers to this specific resource will receive the message.'
60
- ).max(1e3).optional().nullable()
61
- })
62
- });
63
- var PublishResponse = z.object({});
64
- // Annotate the CommonJS export names for ESM import in node:
65
- 0 && (module.exports = {
66
- PublishRequest,
67
- PublishResponse
68
- });
69
- //# sourceMappingURL=schemas.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../schemas.ts","../../src/realtime-v4-message-publisher.schemas.ts"],"sourcesContent":["export * from './src/realtime-v4-message-publisher.schemas.js';\n","import * as z from 'zod';\n\nexport const PublishRequest = z.object({\n message: z.object({\n _id: z\n .string()\n .describe('Unique message identifier')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n )\n .optional(),\n eventName: z.string().describe('Event name, e.g \"product_added\"').max(1000),\n payload: z\n .record(z.string(), z.any())\n .describe(\n 'Event payload, e.g { \"product_id\": \"123\", \"product_name\": \"Product 1\" }'\n ),\n publisherInfo: z\n .object({\n uid: z\n .string()\n .describe(\n 'Arbitrary string identifier for the publisher, can be used by subscribers to identify the publisher.'\n )\n .max(1000)\n .optional(),\n })\n .describe('Info regarding the publisher of the message')\n .optional(),\n }),\n options: z.object({\n channels: z.array(z.string()).max(10),\n resourceId: z\n .string()\n .describe(\n 'Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message.'\n )\n .max(1000)\n .optional()\n .nullable(),\n }),\n});\nexport const PublishResponse = z.object({});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,QAAmB;AAEZ,IAAM,iBAAmB,SAAO;AAAA,EACrC,SAAW,SAAO;AAAA,IAChB,KACG,SAAO,EACP,SAAS,2BAA2B,EACpC;AAAA,MACC;AAAA,MACA;AAAA,IACF,EACC,SAAS;AAAA,IACZ,WAAa,SAAO,EAAE,SAAS,iCAAiC,EAAE,IAAI,GAAI;AAAA,IAC1E,SACG,SAAS,SAAO,GAAK,MAAI,CAAC,EAC1B;AAAA,MACC;AAAA,IACF;AAAA,IACF,eACG,SAAO;AAAA,MACN,KACG,SAAO,EACP;AAAA,QACC;AAAA,MACF,EACC,IAAI,GAAI,EACR,SAAS;AAAA,IACd,CAAC,EACA,SAAS,6CAA6C,EACtD,SAAS;AAAA,EACd,CAAC;AAAA,EACD,SAAW,SAAO;AAAA,IAChB,UAAY,QAAQ,SAAO,CAAC,EAAE,IAAI,EAAE;AAAA,IACpC,YACG,SAAO,EACP;AAAA,MACC;AAAA,IACF,EACC,IAAI,GAAI,EACR,SAAS,EACT,SAAS;AAAA,EACd,CAAC;AACH,CAAC;AACM,IAAM,kBAAoB,SAAO,CAAC,CAAC;","names":[]}
@@ -1,19 +0,0 @@
1
- import * as z from 'zod';
2
-
3
- declare const PublishRequest: z.ZodObject<{
4
- message: z.ZodObject<{
5
- _id: z.ZodOptional<z.ZodString>;
6
- eventName: z.ZodString;
7
- payload: z.ZodRecord<z.ZodString, z.ZodAny>;
8
- publisherInfo: z.ZodOptional<z.ZodObject<{
9
- uid: z.ZodOptional<z.ZodString>;
10
- }, z.core.$strip>>;
11
- }, z.core.$strip>;
12
- options: z.ZodObject<{
13
- channels: z.ZodArray<z.ZodString>;
14
- resourceId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
15
- }, z.core.$strip>;
16
- }, z.core.$strip>;
17
- declare const PublishResponse: z.ZodObject<{}, z.core.$strip>;
18
-
19
- export { PublishRequest, PublishResponse };
@@ -1,31 +0,0 @@
1
- // src/realtime-v4-message-publisher.schemas.ts
2
- import * as z from "zod";
3
- var PublishRequest = z.object({
4
- message: z.object({
5
- _id: z.string().describe("Unique message identifier").regex(
6
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
7
- "Must be a valid GUID"
8
- ).optional(),
9
- eventName: z.string().describe('Event name, e.g "product_added"').max(1e3),
10
- payload: z.record(z.string(), z.any()).describe(
11
- 'Event payload, e.g { "product_id": "123", "product_name": "Product 1" }'
12
- ),
13
- publisherInfo: z.object({
14
- uid: z.string().describe(
15
- "Arbitrary string identifier for the publisher, can be used by subscribers to identify the publisher."
16
- ).max(1e3).optional()
17
- }).describe("Info regarding the publisher of the message").optional()
18
- }),
19
- options: z.object({
20
- channels: z.array(z.string()).max(10),
21
- resourceId: z.string().describe(
22
- 'Optional sub resource identifier, e.g "important_notification", only subscribers to this specific resource will receive the message.'
23
- ).max(1e3).optional().nullable()
24
- })
25
- });
26
- var PublishResponse = z.object({});
27
- export {
28
- PublishRequest,
29
- PublishResponse
30
- };
31
- //# sourceMappingURL=schemas.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/realtime-v4-message-publisher.schemas.ts"],"sourcesContent":["import * as z from 'zod';\n\nexport const PublishRequest = z.object({\n message: z.object({\n _id: z\n .string()\n .describe('Unique message identifier')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n )\n .optional(),\n eventName: z.string().describe('Event name, e.g \"product_added\"').max(1000),\n payload: z\n .record(z.string(), z.any())\n .describe(\n 'Event payload, e.g { \"product_id\": \"123\", \"product_name\": \"Product 1\" }'\n ),\n publisherInfo: z\n .object({\n uid: z\n .string()\n .describe(\n 'Arbitrary string identifier for the publisher, can be used by subscribers to identify the publisher.'\n )\n .max(1000)\n .optional(),\n })\n .describe('Info regarding the publisher of the message')\n .optional(),\n }),\n options: z.object({\n channels: z.array(z.string()).max(10),\n resourceId: z\n .string()\n .describe(\n 'Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message.'\n )\n .max(1000)\n .optional()\n .nullable(),\n }),\n});\nexport const PublishResponse = z.object({});\n"],"mappings":";AAAA,YAAY,OAAO;AAEZ,IAAM,iBAAmB,SAAO;AAAA,EACrC,SAAW,SAAO;AAAA,IAChB,KACG,SAAO,EACP,SAAS,2BAA2B,EACpC;AAAA,MACC;AAAA,MACA;AAAA,IACF,EACC,SAAS;AAAA,IACZ,WAAa,SAAO,EAAE,SAAS,iCAAiC,EAAE,IAAI,GAAI;AAAA,IAC1E,SACG,SAAS,SAAO,GAAK,MAAI,CAAC,EAC1B;AAAA,MACC;AAAA,IACF;AAAA,IACF,eACG,SAAO;AAAA,MACN,KACG,SAAO,EACP;AAAA,QACC;AAAA,MACF,EACC,IAAI,GAAI,EACR,SAAS;AAAA,IACd,CAAC,EACA,SAAS,6CAA6C,EACtD,SAAS;AAAA,EACd,CAAC;AAAA,EACD,SAAW,SAAO;AAAA,IAChB,UAAY,QAAQ,SAAO,CAAC,EAAE,IAAI,EAAE;AAAA,IACpC,YACG,SAAO,EACP;AAAA,MACC;AAAA,IACF,EACC,IAAI,GAAI,EACR,SAAS,EACT,SAAS;AAAA,EACd,CAAC;AACH,CAAC;AACM,IAAM,kBAAoB,SAAO,CAAC,CAAC;","names":[]}
@@ -1,134 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- publish: () => publish4
24
- });
25
- module.exports = __toCommonJS(index_exports);
26
-
27
- // src/realtime-v4-message-publisher.universal.ts
28
- var import_transform_error = require("@wix/sdk-runtime/transform-error");
29
- var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
30
-
31
- // src/realtime-v4-message-publisher.http.ts
32
- var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
33
- function resolveComWixRealtimeV4DuplexerApiV4Url(opts) {
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/publish",
56
- destPath: "/v4/publish"
57
- }
58
- ]
59
- };
60
- return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
61
- }
62
- var PACKAGE_NAME = "@wix/auto_sdk_duplexer_publisher";
63
- function publish(payload) {
64
- function __publish({ host }) {
65
- const metadata = {
66
- entityFqdn: "wix.realtime.v4.message",
67
- method: "POST",
68
- methodFqn: "com.wix.realtime.v4.DuplexerApiV4.Publish",
69
- packageName: PACKAGE_NAME,
70
- migrationOptions: {
71
- optInTransformResponse: true
72
- },
73
- url: resolveComWixRealtimeV4DuplexerApiV4Url({
74
- protoPath: "/v4/publish",
75
- data: payload,
76
- host
77
- }),
78
- data: payload
79
- };
80
- return metadata;
81
- }
82
- return __publish;
83
- }
84
-
85
- // src/realtime-v4-message-publisher.universal.ts
86
- async function publish2(message, options) {
87
- const { httpClient, sideEffects } = arguments[2];
88
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
89
- message,
90
- channels: options?.channels,
91
- resourceId: options?.resourceId
92
- });
93
- const reqOpts = publish(payload);
94
- sideEffects?.onSiteCall?.();
95
- try {
96
- const result = await httpClient.request(reqOpts);
97
- sideEffects?.onSuccess?.(result);
98
- } catch (err) {
99
- const transformedError = (0, import_transform_error.transformError)(
100
- err,
101
- {
102
- spreadPathsToArguments: {},
103
- explicitPathsToArguments: {
104
- message: "$[0]",
105
- channels: "$[1].channels",
106
- resourceId: "$[1].resourceId"
107
- },
108
- singleArgumentUnchanged: false
109
- },
110
- ["message", "options"]
111
- );
112
- sideEffects?.onError?.(err);
113
- throw transformedError;
114
- }
115
- }
116
-
117
- // src/realtime-v4-message-publisher.public.ts
118
- function publish3(httpClient) {
119
- return (message, options) => publish2(
120
- message,
121
- options,
122
- // @ts-ignore
123
- { httpClient }
124
- );
125
- }
126
-
127
- // src/realtime-v4-message-publisher.context.ts
128
- var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
129
- var publish4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(publish3);
130
- // Annotate the CommonJS export names for ESM import in node:
131
- 0 && (module.exports = {
132
- publish
133
- });
134
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
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 * @applicableIdentity APP\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/publish',\n destPath: '/v4/publish',\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: '/v4/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;;;AD4BA,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;;;AExHO,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,120 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // index.typings.ts
21
- var index_typings_exports = {};
22
- __export(index_typings_exports, {
23
- publish: () => publish2
24
- });
25
- module.exports = __toCommonJS(index_typings_exports);
26
-
27
- // src/realtime-v4-message-publisher.universal.ts
28
- var import_transform_error = require("@wix/sdk-runtime/transform-error");
29
- var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
30
-
31
- // src/realtime-v4-message-publisher.http.ts
32
- var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
33
- function resolveComWixRealtimeV4DuplexerApiV4Url(opts) {
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/publish",
56
- destPath: "/v4/publish"
57
- }
58
- ]
59
- };
60
- return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
61
- }
62
- var PACKAGE_NAME = "@wix/auto_sdk_duplexer_publisher";
63
- function publish(payload) {
64
- function __publish({ host }) {
65
- const metadata = {
66
- entityFqdn: "wix.realtime.v4.message",
67
- method: "POST",
68
- methodFqn: "com.wix.realtime.v4.DuplexerApiV4.Publish",
69
- packageName: PACKAGE_NAME,
70
- migrationOptions: {
71
- optInTransformResponse: true
72
- },
73
- url: resolveComWixRealtimeV4DuplexerApiV4Url({
74
- protoPath: "/v4/publish",
75
- data: payload,
76
- host
77
- }),
78
- data: payload
79
- };
80
- return metadata;
81
- }
82
- return __publish;
83
- }
84
-
85
- // src/realtime-v4-message-publisher.universal.ts
86
- async function publish2(message, options) {
87
- const { httpClient, sideEffects } = arguments[2];
88
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
89
- message,
90
- channels: options?.channels,
91
- resourceId: options?.resourceId
92
- });
93
- const reqOpts = publish(payload);
94
- sideEffects?.onSiteCall?.();
95
- try {
96
- const result = await httpClient.request(reqOpts);
97
- sideEffects?.onSuccess?.(result);
98
- } catch (err) {
99
- const transformedError = (0, import_transform_error.transformError)(
100
- err,
101
- {
102
- spreadPathsToArguments: {},
103
- explicitPathsToArguments: {
104
- message: "$[0]",
105
- channels: "$[1].channels",
106
- resourceId: "$[1].resourceId"
107
- },
108
- singleArgumentUnchanged: false
109
- },
110
- ["message", "options"]
111
- );
112
- sideEffects?.onError?.(err);
113
- throw transformedError;
114
- }
115
- }
116
- // Annotate the CommonJS export names for ESM import in node:
117
- 0 && (module.exports = {
118
- publish
119
- });
120
- //# sourceMappingURL=index.typings.js.map
@@ -1 +0,0 @@
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 * @applicableIdentity APP\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/publish',\n destPath: '/v4/publish',\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: '/v4/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;;;AD4BA,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,104 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // meta.ts
21
- var meta_exports = {};
22
- __export(meta_exports, {
23
- publish: () => publish2
24
- });
25
- module.exports = __toCommonJS(meta_exports);
26
-
27
- // src/realtime-v4-message-publisher.http.ts
28
- var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
29
- function resolveComWixRealtimeV4DuplexerApiV4Url(opts) {
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/publish",
52
- destPath: "/v4/publish"
53
- }
54
- ]
55
- };
56
- return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
57
- }
58
- var PACKAGE_NAME = "@wix/auto_sdk_duplexer_publisher";
59
- function publish(payload) {
60
- function __publish({ host }) {
61
- const metadata = {
62
- entityFqdn: "wix.realtime.v4.message",
63
- method: "POST",
64
- methodFqn: "com.wix.realtime.v4.DuplexerApiV4.Publish",
65
- packageName: PACKAGE_NAME,
66
- migrationOptions: {
67
- optInTransformResponse: true
68
- },
69
- url: resolveComWixRealtimeV4DuplexerApiV4Url({
70
- protoPath: "/v4/publish",
71
- data: payload,
72
- host
73
- }),
74
- data: payload
75
- };
76
- return metadata;
77
- }
78
- return __publish;
79
- }
80
-
81
- // src/realtime-v4-message-publisher.meta.ts
82
- function publish2() {
83
- const payload = {};
84
- const getRequestOptions = publish(payload);
85
- const getUrl = (context) => {
86
- const { url } = getRequestOptions(context);
87
- return url;
88
- };
89
- return {
90
- getUrl,
91
- httpMethod: "POST",
92
- path: "/v4/publish",
93
- pathParams: {},
94
- __requestType: null,
95
- __originalRequestType: null,
96
- __responseType: null,
97
- __originalResponseType: null
98
- };
99
- }
100
- // Annotate the CommonJS export names for ESM import in node:
101
- 0 && (module.exports = {
102
- publish
103
- });
104
- //# sourceMappingURL=meta.js.map
@@ -1 +0,0 @@
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/publish',\n destPath: '/v4/publish',\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: '/v4/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: '/v4/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"]}
@@ -1,19 +0,0 @@
1
- import * as z from 'zod';
2
-
3
- declare const PublishRequest: z.ZodObject<{
4
- message: z.ZodObject<{
5
- _id: z.ZodOptional<z.ZodString>;
6
- eventName: z.ZodString;
7
- payload: z.ZodRecord<z.ZodString, z.ZodAny>;
8
- publisherInfo: z.ZodOptional<z.ZodObject<{
9
- uid: z.ZodOptional<z.ZodString>;
10
- }, z.core.$strip>>;
11
- }, z.core.$strip>;
12
- options: z.ZodObject<{
13
- channels: z.ZodArray<z.ZodString>;
14
- resourceId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
15
- }, z.core.$strip>;
16
- }, z.core.$strip>;
17
- declare const PublishResponse: z.ZodObject<{}, z.core.$strip>;
18
-
19
- export { PublishRequest, PublishResponse };
@@ -1,69 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // schemas.ts
31
- var schemas_exports = {};
32
- __export(schemas_exports, {
33
- PublishRequest: () => PublishRequest,
34
- PublishResponse: () => PublishResponse
35
- });
36
- module.exports = __toCommonJS(schemas_exports);
37
-
38
- // src/realtime-v4-message-publisher.schemas.ts
39
- var z = __toESM(require("zod"));
40
- var PublishRequest = z.object({
41
- message: z.object({
42
- _id: z.string().describe("Unique message identifier").regex(
43
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
44
- "Must be a valid GUID"
45
- ).optional(),
46
- eventName: z.string().describe('Event name, e.g "product_added"').max(1e3),
47
- payload: z.record(z.string(), z.any()).describe(
48
- 'Event payload, e.g { "product_id": "123", "product_name": "Product 1" }'
49
- ),
50
- publisherInfo: z.object({
51
- uid: z.string().describe(
52
- "Arbitrary string identifier for the publisher, can be used by subscribers to identify the publisher."
53
- ).max(1e3).optional()
54
- }).describe("Info regarding the publisher of the message").optional()
55
- }),
56
- options: z.object({
57
- channels: z.array(z.string()).max(10),
58
- resourceId: z.string().describe(
59
- 'Optional sub resource identifier, e.g "important_notification", only subscribers to this specific resource will receive the message.'
60
- ).max(1e3).optional().nullable()
61
- })
62
- });
63
- var PublishResponse = z.object({});
64
- // Annotate the CommonJS export names for ESM import in node:
65
- 0 && (module.exports = {
66
- PublishRequest,
67
- PublishResponse
68
- });
69
- //# sourceMappingURL=schemas.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../schemas.ts","../../../src/realtime-v4-message-publisher.schemas.ts"],"sourcesContent":["export * from './src/realtime-v4-message-publisher.schemas.js';\n","import * as z from 'zod';\n\nexport const PublishRequest = z.object({\n message: z.object({\n _id: z\n .string()\n .describe('Unique message identifier')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n )\n .optional(),\n eventName: z.string().describe('Event name, e.g \"product_added\"').max(1000),\n payload: z\n .record(z.string(), z.any())\n .describe(\n 'Event payload, e.g { \"product_id\": \"123\", \"product_name\": \"Product 1\" }'\n ),\n publisherInfo: z\n .object({\n uid: z\n .string()\n .describe(\n 'Arbitrary string identifier for the publisher, can be used by subscribers to identify the publisher.'\n )\n .max(1000)\n .optional(),\n })\n .describe('Info regarding the publisher of the message')\n .optional(),\n }),\n options: z.object({\n channels: z.array(z.string()).max(10),\n resourceId: z\n .string()\n .describe(\n 'Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message.'\n )\n .max(1000)\n .optional()\n .nullable(),\n }),\n});\nexport const PublishResponse = z.object({});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,QAAmB;AAEZ,IAAM,iBAAmB,SAAO;AAAA,EACrC,SAAW,SAAO;AAAA,IAChB,KACG,SAAO,EACP,SAAS,2BAA2B,EACpC;AAAA,MACC;AAAA,MACA;AAAA,IACF,EACC,SAAS;AAAA,IACZ,WAAa,SAAO,EAAE,SAAS,iCAAiC,EAAE,IAAI,GAAI;AAAA,IAC1E,SACG,SAAS,SAAO,GAAK,MAAI,CAAC,EAC1B;AAAA,MACC;AAAA,IACF;AAAA,IACF,eACG,SAAO;AAAA,MACN,KACG,SAAO,EACP;AAAA,QACC;AAAA,MACF,EACC,IAAI,GAAI,EACR,SAAS;AAAA,IACd,CAAC,EACA,SAAS,6CAA6C,EACtD,SAAS;AAAA,EACd,CAAC;AAAA,EACD,SAAW,SAAO;AAAA,IAChB,UAAY,QAAQ,SAAO,CAAC,EAAE,IAAI,EAAE;AAAA,IACpC,YACG,SAAO,EACP;AAAA,MACC;AAAA,IACF,EACC,IAAI,GAAI,EACR,SAAS,EACT,SAAS;AAAA,EACd,CAAC;AACH,CAAC;AACM,IAAM,kBAAoB,SAAO,CAAC,CAAC;","names":[]}
@@ -1,107 +0,0 @@
1
- // src/realtime-v4-message-publisher.universal.ts
2
- import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
3
- import { renameKeysFromSDKRequestToRESTRequest } from "@wix/sdk-runtime/rename-all-nested-keys";
4
-
5
- // src/realtime-v4-message-publisher.http.ts
6
- import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
7
- function resolveComWixRealtimeV4DuplexerApiV4Url(opts) {
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/publish",
30
- destPath: "/v4/publish"
31
- }
32
- ]
33
- };
34
- return resolveUrl(Object.assign(opts, { domainToMappings }));
35
- }
36
- var PACKAGE_NAME = "@wix/auto_sdk_duplexer_publisher";
37
- function publish(payload) {
38
- function __publish({ host }) {
39
- const metadata = {
40
- entityFqdn: "wix.realtime.v4.message",
41
- method: "POST",
42
- methodFqn: "com.wix.realtime.v4.DuplexerApiV4.Publish",
43
- packageName: PACKAGE_NAME,
44
- migrationOptions: {
45
- optInTransformResponse: true
46
- },
47
- url: resolveComWixRealtimeV4DuplexerApiV4Url({
48
- protoPath: "/v4/publish",
49
- data: payload,
50
- host
51
- }),
52
- data: payload
53
- };
54
- return metadata;
55
- }
56
- return __publish;
57
- }
58
-
59
- // src/realtime-v4-message-publisher.universal.ts
60
- async function publish2(message, options) {
61
- const { httpClient, sideEffects } = arguments[2];
62
- const payload = renameKeysFromSDKRequestToRESTRequest({
63
- message,
64
- channels: options?.channels,
65
- resourceId: options?.resourceId
66
- });
67
- const reqOpts = publish(payload);
68
- sideEffects?.onSiteCall?.();
69
- try {
70
- const result = await httpClient.request(reqOpts);
71
- sideEffects?.onSuccess?.(result);
72
- } catch (err) {
73
- const transformedError = sdkTransformError(
74
- err,
75
- {
76
- spreadPathsToArguments: {},
77
- explicitPathsToArguments: {
78
- message: "$[0]",
79
- channels: "$[1].channels",
80
- resourceId: "$[1].resourceId"
81
- },
82
- singleArgumentUnchanged: false
83
- },
84
- ["message", "options"]
85
- );
86
- sideEffects?.onError?.(err);
87
- throw transformedError;
88
- }
89
- }
90
-
91
- // src/realtime-v4-message-publisher.public.ts
92
- function publish3(httpClient) {
93
- return (message, options) => publish2(
94
- message,
95
- options,
96
- // @ts-ignore
97
- { httpClient }
98
- );
99
- }
100
-
101
- // src/realtime-v4-message-publisher.context.ts
102
- import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
103
- var publish4 = /* @__PURE__ */ createRESTModule(publish3);
104
- export {
105
- publish4 as publish
106
- };
107
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
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 * @applicableIdentity APP\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/publish',\n destPath: '/v4/publish',\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: '/v4/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;;;AD4BA,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;;;AExHO,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,93 +0,0 @@
1
- // src/realtime-v4-message-publisher.universal.ts
2
- import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
3
- import { renameKeysFromSDKRequestToRESTRequest } from "@wix/sdk-runtime/rename-all-nested-keys";
4
-
5
- // src/realtime-v4-message-publisher.http.ts
6
- import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
7
- function resolveComWixRealtimeV4DuplexerApiV4Url(opts) {
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/publish",
30
- destPath: "/v4/publish"
31
- }
32
- ]
33
- };
34
- return resolveUrl(Object.assign(opts, { domainToMappings }));
35
- }
36
- var PACKAGE_NAME = "@wix/auto_sdk_duplexer_publisher";
37
- function publish(payload) {
38
- function __publish({ host }) {
39
- const metadata = {
40
- entityFqdn: "wix.realtime.v4.message",
41
- method: "POST",
42
- methodFqn: "com.wix.realtime.v4.DuplexerApiV4.Publish",
43
- packageName: PACKAGE_NAME,
44
- migrationOptions: {
45
- optInTransformResponse: true
46
- },
47
- url: resolveComWixRealtimeV4DuplexerApiV4Url({
48
- protoPath: "/v4/publish",
49
- data: payload,
50
- host
51
- }),
52
- data: payload
53
- };
54
- return metadata;
55
- }
56
- return __publish;
57
- }
58
-
59
- // src/realtime-v4-message-publisher.universal.ts
60
- async function publish2(message, options) {
61
- const { httpClient, sideEffects } = arguments[2];
62
- const payload = renameKeysFromSDKRequestToRESTRequest({
63
- message,
64
- channels: options?.channels,
65
- resourceId: options?.resourceId
66
- });
67
- const reqOpts = publish(payload);
68
- sideEffects?.onSiteCall?.();
69
- try {
70
- const result = await httpClient.request(reqOpts);
71
- sideEffects?.onSuccess?.(result);
72
- } catch (err) {
73
- const transformedError = sdkTransformError(
74
- err,
75
- {
76
- spreadPathsToArguments: {},
77
- explicitPathsToArguments: {
78
- message: "$[0]",
79
- channels: "$[1].channels",
80
- resourceId: "$[1].resourceId"
81
- },
82
- singleArgumentUnchanged: false
83
- },
84
- ["message", "options"]
85
- );
86
- sideEffects?.onError?.(err);
87
- throw transformedError;
88
- }
89
- }
90
- export {
91
- publish2 as publish
92
- };
93
- //# sourceMappingURL=index.typings.mjs.map
@@ -1 +0,0 @@
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 * @applicableIdentity APP\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/publish',\n destPath: '/v4/publish',\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: '/v4/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;;;AD4BA,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,77 +0,0 @@
1
- // src/realtime-v4-message-publisher.http.ts
2
- import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
3
- function resolveComWixRealtimeV4DuplexerApiV4Url(opts) {
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/publish",
26
- destPath: "/v4/publish"
27
- }
28
- ]
29
- };
30
- return resolveUrl(Object.assign(opts, { domainToMappings }));
31
- }
32
- var PACKAGE_NAME = "@wix/auto_sdk_duplexer_publisher";
33
- function publish(payload) {
34
- function __publish({ host }) {
35
- const metadata = {
36
- entityFqdn: "wix.realtime.v4.message",
37
- method: "POST",
38
- methodFqn: "com.wix.realtime.v4.DuplexerApiV4.Publish",
39
- packageName: PACKAGE_NAME,
40
- migrationOptions: {
41
- optInTransformResponse: true
42
- },
43
- url: resolveComWixRealtimeV4DuplexerApiV4Url({
44
- protoPath: "/v4/publish",
45
- data: payload,
46
- host
47
- }),
48
- data: payload
49
- };
50
- return metadata;
51
- }
52
- return __publish;
53
- }
54
-
55
- // src/realtime-v4-message-publisher.meta.ts
56
- function publish2() {
57
- const payload = {};
58
- const getRequestOptions = publish(payload);
59
- const getUrl = (context) => {
60
- const { url } = getRequestOptions(context);
61
- return url;
62
- };
63
- return {
64
- getUrl,
65
- httpMethod: "POST",
66
- path: "/v4/publish",
67
- pathParams: {},
68
- __requestType: null,
69
- __originalRequestType: null,
70
- __responseType: null,
71
- __originalResponseType: null
72
- };
73
- }
74
- export {
75
- publish2 as publish
76
- };
77
- //# sourceMappingURL=meta.mjs.map
@@ -1 +0,0 @@
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/publish',\n destPath: '/v4/publish',\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: '/v4/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: '/v4/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"]}
@@ -1,19 +0,0 @@
1
- import * as z from 'zod';
2
-
3
- declare const PublishRequest: z.ZodObject<{
4
- message: z.ZodObject<{
5
- _id: z.ZodOptional<z.ZodString>;
6
- eventName: z.ZodString;
7
- payload: z.ZodRecord<z.ZodString, z.ZodAny>;
8
- publisherInfo: z.ZodOptional<z.ZodObject<{
9
- uid: z.ZodOptional<z.ZodString>;
10
- }, z.core.$strip>>;
11
- }, z.core.$strip>;
12
- options: z.ZodObject<{
13
- channels: z.ZodArray<z.ZodString>;
14
- resourceId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
15
- }, z.core.$strip>;
16
- }, z.core.$strip>;
17
- declare const PublishResponse: z.ZodObject<{}, z.core.$strip>;
18
-
19
- export { PublishRequest, PublishResponse };
@@ -1,31 +0,0 @@
1
- // src/realtime-v4-message-publisher.schemas.ts
2
- import * as z from "zod";
3
- var PublishRequest = z.object({
4
- message: z.object({
5
- _id: z.string().describe("Unique message identifier").regex(
6
- /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
7
- "Must be a valid GUID"
8
- ).optional(),
9
- eventName: z.string().describe('Event name, e.g "product_added"').max(1e3),
10
- payload: z.record(z.string(), z.any()).describe(
11
- 'Event payload, e.g { "product_id": "123", "product_name": "Product 1" }'
12
- ),
13
- publisherInfo: z.object({
14
- uid: z.string().describe(
15
- "Arbitrary string identifier for the publisher, can be used by subscribers to identify the publisher."
16
- ).max(1e3).optional()
17
- }).describe("Info regarding the publisher of the message").optional()
18
- }),
19
- options: z.object({
20
- channels: z.array(z.string()).max(10),
21
- resourceId: z.string().describe(
22
- 'Optional sub resource identifier, e.g "important_notification", only subscribers to this specific resource will receive the message.'
23
- ).max(1e3).optional().nullable()
24
- })
25
- });
26
- var PublishResponse = z.object({});
27
- export {
28
- PublishRequest,
29
- PublishResponse
30
- };
31
- //# sourceMappingURL=schemas.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/realtime-v4-message-publisher.schemas.ts"],"sourcesContent":["import * as z from 'zod';\n\nexport const PublishRequest = z.object({\n message: z.object({\n _id: z\n .string()\n .describe('Unique message identifier')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n )\n .optional(),\n eventName: z.string().describe('Event name, e.g \"product_added\"').max(1000),\n payload: z\n .record(z.string(), z.any())\n .describe(\n 'Event payload, e.g { \"product_id\": \"123\", \"product_name\": \"Product 1\" }'\n ),\n publisherInfo: z\n .object({\n uid: z\n .string()\n .describe(\n 'Arbitrary string identifier for the publisher, can be used by subscribers to identify the publisher.'\n )\n .max(1000)\n .optional(),\n })\n .describe('Info regarding the publisher of the message')\n .optional(),\n }),\n options: z.object({\n channels: z.array(z.string()).max(10),\n resourceId: z\n .string()\n .describe(\n 'Optional sub resource identifier, e.g \"important_notification\", only subscribers to this specific resource will receive the message.'\n )\n .max(1000)\n .optional()\n .nullable(),\n }),\n});\nexport const PublishResponse = z.object({});\n"],"mappings":";AAAA,YAAY,OAAO;AAEZ,IAAM,iBAAmB,SAAO;AAAA,EACrC,SAAW,SAAO;AAAA,IAChB,KACG,SAAO,EACP,SAAS,2BAA2B,EACpC;AAAA,MACC;AAAA,MACA;AAAA,IACF,EACC,SAAS;AAAA,IACZ,WAAa,SAAO,EAAE,SAAS,iCAAiC,EAAE,IAAI,GAAI;AAAA,IAC1E,SACG,SAAS,SAAO,GAAK,MAAI,CAAC,EAC1B;AAAA,MACC;AAAA,IACF;AAAA,IACF,eACG,SAAO;AAAA,MACN,KACG,SAAO,EACP;AAAA,QACC;AAAA,MACF,EACC,IAAI,GAAI,EACR,SAAS;AAAA,IACd,CAAC,EACA,SAAS,6CAA6C,EACtD,SAAS;AAAA,EACd,CAAC;AAAA,EACD,SAAW,SAAO;AAAA,IAChB,UAAY,QAAQ,SAAO,CAAC,EAAE,IAAI,EAAE;AAAA,IACpC,YACG,SAAO,EACP;AAAA,MACC;AAAA,IACF,EACC,IAAI,GAAI,EACR,SAAS,EACT,SAAS;AAAA,EACd,CAAC;AACH,CAAC;AACM,IAAM,kBAAoB,SAAO,CAAC,CAAC;","names":[]}
@@ -1,3 +0,0 @@
1
- {
2
- "main": "../build/cjs/schemas.js"
3
- }