payload-socket-plugin 1.1.1 → 1.1.2
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/dist/browser.d.ts +3 -8
- package/dist/browser.js +2 -31
- package/dist/index.d.ts +2 -1
- package/package.json +1 -1
package/dist/browser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Config } from "payload
|
|
1
|
+
import type { Config } from "payload";
|
|
2
2
|
/**
|
|
3
3
|
* Browser-safe mock for the Socket.IO plugin
|
|
4
4
|
* This file is used when bundling for the browser (e.g., Payload admin panel)
|
|
@@ -9,16 +9,11 @@ export declare const socketPlugin: () => (config: Config) => Config;
|
|
|
9
9
|
* Browser-safe mock for initSocketIO
|
|
10
10
|
* Does nothing in browser environment
|
|
11
11
|
*/
|
|
12
|
-
export declare const initSocketIO: () => Promise<void>;
|
|
12
|
+
export declare const initSocketIO: (httpServer?: any) => Promise<void>;
|
|
13
13
|
/**
|
|
14
14
|
* Browser-safe mock for SocketIOManager
|
|
15
|
-
* Returns a mock class
|
|
15
|
+
* Returns a minimal mock class in browser environment
|
|
16
16
|
*/
|
|
17
17
|
export declare class SocketIOManager {
|
|
18
18
|
constructor();
|
|
19
|
-
init(): Promise<null>;
|
|
20
|
-
emitEvent(): Promise<void>;
|
|
21
|
-
getIO(): null;
|
|
22
|
-
close(): Promise<void>;
|
|
23
19
|
}
|
|
24
|
-
export * from "./types";
|
package/dist/browser.js
CHANGED
|
@@ -1,18 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
3
|
exports.SocketIOManager = exports.initSocketIO = exports.socketPlugin = void 0;
|
|
18
4
|
/**
|
|
@@ -29,33 +15,18 @@ exports.socketPlugin = socketPlugin;
|
|
|
29
15
|
* Browser-safe mock for initSocketIO
|
|
30
16
|
* Does nothing in browser environment
|
|
31
17
|
*/
|
|
32
|
-
const initSocketIO = async () => {
|
|
18
|
+
const initSocketIO = async (httpServer) => {
|
|
33
19
|
// No-op in browser
|
|
34
20
|
console.warn("initSocketIO called in browser environment - this is a no-op");
|
|
35
21
|
};
|
|
36
22
|
exports.initSocketIO = initSocketIO;
|
|
37
23
|
/**
|
|
38
24
|
* Browser-safe mock for SocketIOManager
|
|
39
|
-
* Returns a mock class
|
|
25
|
+
* Returns a minimal mock class in browser environment
|
|
40
26
|
*/
|
|
41
27
|
class SocketIOManager {
|
|
42
28
|
constructor() {
|
|
43
29
|
// No-op in browser
|
|
44
30
|
}
|
|
45
|
-
async init() {
|
|
46
|
-
console.warn("SocketIOManager.init called in browser environment - this is a no-op");
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
async emitEvent() {
|
|
50
|
-
// No-op in browser
|
|
51
|
-
}
|
|
52
|
-
getIO() {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
async close() {
|
|
56
|
-
// No-op in browser
|
|
57
|
-
}
|
|
58
31
|
}
|
|
59
32
|
exports.SocketIOManager = SocketIOManager;
|
|
60
|
-
// Export types (these are safe for browser)
|
|
61
|
-
__exportStar(require("./types"), exports);
|
package/dist/index.d.ts
CHANGED