@wix/realtime 1.0.47 → 1.0.50

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.
@@ -1,5 +1,6 @@
1
1
  import { publish as publicPublish } from './publisher.public.js';
2
2
  import type { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';
3
+ export type { PublishChannel } from '@wix/realtime-common/types';
3
4
  /**
4
5
  * Publishes a message to a channel or resource.
5
6
  *
@@ -1,5 +1,7 @@
1
1
  import { subscribe as publicSubscribe, unsubscribe as publicUnsubscribe } from './subscriber.public.js';
2
2
  import type { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';
3
+ export type { SubscribeChannel, Message, MessageHandler, Publisher, SubscriptionHandler, SubscriptionErrorHandler, SubscriptionOptions, UnsubscribeOptions, } from '@wix/realtime-common/types';
4
+ export { RealtimeError, RealtimeErrorCode } from '@wix/realtime-common/types';
3
5
  /**
4
6
  * Subscribes to a channel or resource.
5
7
  *
@@ -7,7 +9,7 @@ import type { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';
7
9
  *
8
10
  * Use the `options` parameter to register handlers that run whenever the subscription succeeds or generates an error. For some errors, the subscription is re-attempted automatically. The `onSubscribed()` handler runs on every successful re-subscription.
9
11
  *
10
- * Learn more about the [subscription lifecycle](https://dev.wix.com/docs/sdk/business-solutions/realtime/realtime/subscriber/introduction#business-solutions_realtime_realtime_subscriber_subscription-lifecycle).
12
+ * Learn more about the [subscription lifecycle](https://dev.wix.com/docs/sdk/core-modules/realtime/realtime/subscriber/introduction#core-modules_realtime_realtime_subscriber_subscription-lifecycle).
11
13
  *
12
14
  * @example Subscribe to a channel
13
15
  * ```ts
@@ -50,7 +52,7 @@ import type { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';
50
52
  * @requiredField channel
51
53
  * @param messageHandler - Handler that runs whenever a message is published to the channel or resource.
52
54
  * @requiredField messageHandler
53
- * @param options - [Lifecycle handlers](https://dev.wix.com/docs/sdk/business-solutions/realtime/realtime/subscriber/introduction#business-solutions_realtime_realtime_subscriber_subscription-lifecycle) for subscription events.
55
+ * @param options - [Lifecycle handlers](https://dev.wix.com/docs/sdk/core-modules/realtime/realtime/subscriber/introduction#core-modules_realtime_realtime_subscriber_subscription-lifecycle) for subscription events.
54
56
  */
55
57
  export declare const subscribe: MaybeContext<BuildRESTFunction<typeof publicSubscribe> & typeof publicSubscribe>;
56
58
  /**
@@ -1,8 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.unsubscribe = exports.subscribe = void 0;
3
+ exports.unsubscribe = exports.subscribe = exports.RealtimeErrorCode = exports.RealtimeError = void 0;
4
4
  const subscriber_public_js_1 = require("./subscriber.public.js");
5
5
  const rest_modules_1 = require("@wix/sdk-runtime/rest-modules");
6
+ var types_1 = require("@wix/realtime-common/types");
7
+ Object.defineProperty(exports, "RealtimeError", { enumerable: true, get: function () { return types_1.RealtimeError; } });
8
+ Object.defineProperty(exports, "RealtimeErrorCode", { enumerable: true, get: function () { return types_1.RealtimeErrorCode; } });
6
9
  /**
7
10
  * Subscribes to a channel or resource.
8
11
  *
@@ -10,7 +13,7 @@ const rest_modules_1 = require("@wix/sdk-runtime/rest-modules");
10
13
  *
11
14
  * Use the `options` parameter to register handlers that run whenever the subscription succeeds or generates an error. For some errors, the subscription is re-attempted automatically. The `onSubscribed()` handler runs on every successful re-subscription.
12
15
  *
13
- * Learn more about the [subscription lifecycle](https://dev.wix.com/docs/sdk/business-solutions/realtime/realtime/subscriber/introduction#business-solutions_realtime_realtime_subscriber_subscription-lifecycle).
16
+ * Learn more about the [subscription lifecycle](https://dev.wix.com/docs/sdk/core-modules/realtime/realtime/subscriber/introduction#core-modules_realtime_realtime_subscriber_subscription-lifecycle).
14
17
  *
15
18
  * @example Subscribe to a channel
16
19
  * ```ts
@@ -53,7 +56,7 @@ const rest_modules_1 = require("@wix/sdk-runtime/rest-modules");
53
56
  * @requiredField channel
54
57
  * @param messageHandler - Handler that runs whenever a message is published to the channel or resource.
55
58
  * @requiredField messageHandler
56
- * @param options - [Lifecycle handlers](https://dev.wix.com/docs/sdk/business-solutions/realtime/realtime/subscriber/introduction#business-solutions_realtime_realtime_subscriber_subscription-lifecycle) for subscription events.
59
+ * @param options - [Lifecycle handlers](https://dev.wix.com/docs/sdk/core-modules/realtime/realtime/subscriber/introduction#core-modules_realtime_realtime_subscriber_subscription-lifecycle) for subscription events.
57
60
  */
58
61
  exports.subscribe = (0, rest_modules_1.createRESTModule)(subscriber_public_js_1.subscribe);
59
62
  /**