fastcomments-sdk 2.0.0 → 2.1.0
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/README.md +113 -29
- package/dist/__tests__/browser-compatibility.test.d.ts +2 -0
- package/dist/__tests__/browser-compatibility.test.d.ts.map +1 -0
- package/dist/__tests__/browser-compatibility.test.js +170 -0
- package/dist/__tests__/browser-compatibility.test.js.map +1 -0
- package/dist/__tests__/sso.integration.test.js +9 -9
- package/dist/__tests__/sso.integration.test.js.map +1 -1
- package/dist/browser.d.ts +37 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +105 -0
- package/dist/browser.js.map +1 -0
- package/dist/index.d.ts +7 -30
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -89
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +14 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +39 -0
- package/dist/server.js.map +1 -0
- package/package.json +21 -5
package/README.md
CHANGED
|
@@ -8,30 +8,92 @@ Official Node.js and TypeScript SDK for the FastComments API. Build secure and s
|
|
|
8
8
|
npm install fastcomments-sdk
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
## Browser vs Server Compatibility
|
|
12
|
+
|
|
13
|
+
This SDK uses **dual entry points** to ensure optimal compatibility and prevent runtime errors:
|
|
14
|
+
|
|
15
|
+
- **`fastcomments-sdk/browser`** - Browser-safe version with native `fetch`, excludes Node.js crypto
|
|
16
|
+
- **`fastcomments-sdk/server`** - Full Node.js version with SSO support, includes crypto features
|
|
17
|
+
- **`fastcomments-sdk`** (default) - Types only, safe to import anywhere
|
|
18
|
+
|
|
19
|
+
This prevents issues like "crypto module not found" when using the SDK in browser environments.
|
|
20
|
+
|
|
11
21
|
## Usage
|
|
12
22
|
|
|
13
|
-
|
|
23
|
+
This SDK provides separate entry points for browser and server environments to ensure optimal compatibility and security:
|
|
24
|
+
|
|
25
|
+
### Browser Usage (Client-Side)
|
|
26
|
+
|
|
27
|
+
For browser/frontend applications, use the browser-safe export that excludes Node.js dependencies:
|
|
14
28
|
|
|
15
29
|
```typescript
|
|
16
|
-
import
|
|
30
|
+
// Browser-safe import (no Node.js crypto dependencies)
|
|
31
|
+
import { createFastCommentsBrowserSDK } from 'fastcomments-sdk/browser';
|
|
32
|
+
|
|
33
|
+
// Create browser SDK instance
|
|
34
|
+
const sdk = createFastCommentsBrowserSDK({
|
|
35
|
+
basePath: 'https://fastcomments.com' // optional, defaults to https://fastcomments.com
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// Use public APIs (no API key needed - safe for browsers)
|
|
39
|
+
const comments = await sdk.publicApi.getCommentsPublic({
|
|
40
|
+
tenantId: 'your-tenant-id',
|
|
41
|
+
urlId: 'page-url-id'
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Server Usage (Node.js)
|
|
17
46
|
|
|
18
|
-
|
|
47
|
+
For server/backend applications, use the full SDK with SSO and authentication features:
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
// Server-side import (includes SSO and Node.js crypto features)
|
|
51
|
+
import { createFastCommentsSDK } from 'fastcomments-sdk/server';
|
|
52
|
+
|
|
53
|
+
// Create server SDK instance
|
|
19
54
|
const sdk = createFastCommentsSDK({
|
|
20
|
-
apiKey: 'your-api-key',
|
|
55
|
+
apiKey: 'your-api-key', // Keep this secret on the server!
|
|
21
56
|
basePath: 'https://fastcomments.com' // optional, defaults to https://fastcomments.com
|
|
22
57
|
});
|
|
23
58
|
|
|
24
|
-
// Use
|
|
59
|
+
// Use secured APIs with your API key
|
|
25
60
|
const comments = await sdk.defaultApi.getComments({
|
|
26
61
|
tenantId: 'your-tenant-id',
|
|
27
62
|
urlId: 'page-url-id'
|
|
28
63
|
});
|
|
29
64
|
```
|
|
30
65
|
|
|
66
|
+
### Types Only Import
|
|
67
|
+
|
|
68
|
+
If you only need TypeScript types (no runtime code), use the default import:
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
// Types only (no runtime dependencies - safe everywhere)
|
|
72
|
+
import type {
|
|
73
|
+
PublicComment,
|
|
74
|
+
CreateCommentParams,
|
|
75
|
+
GetCommentsPublic200Response
|
|
76
|
+
} from 'fastcomments-sdk';
|
|
77
|
+
```
|
|
78
|
+
|
|
31
79
|
### Using Individual API Classes
|
|
32
80
|
|
|
81
|
+
#### Browser Environment
|
|
82
|
+
|
|
33
83
|
```typescript
|
|
34
|
-
import {
|
|
84
|
+
import { PublicApi, Configuration } from 'fastcomments-sdk/browser';
|
|
85
|
+
|
|
86
|
+
const config = new Configuration({
|
|
87
|
+
basePath: 'https://fastcomments.com'
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
const publicApi = new PublicApi(config);
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
#### Server Environment
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
import { DefaultApi, PublicApi, Configuration } from 'fastcomments-sdk/server';
|
|
35
97
|
|
|
36
98
|
const config = new Configuration({
|
|
37
99
|
apiKey: 'your-api-key',
|
|
@@ -50,10 +112,10 @@ The SDK provides three main API classes:
|
|
|
50
112
|
- **`PublicApi`** - Public endpoints that can be accessed without an API key. These can be called directly from browsers/mobile devices/etc.
|
|
51
113
|
- **`HiddenApi`** - Internal/admin endpoints for advanced use cases.
|
|
52
114
|
|
|
53
|
-
### Example: Using Public API (
|
|
115
|
+
### Example: Using Public API (browser-safe)
|
|
54
116
|
|
|
55
117
|
```typescript
|
|
56
|
-
import { PublicApi } from '
|
|
118
|
+
import { PublicApi } from 'fastcomments-sdk/browser';
|
|
57
119
|
|
|
58
120
|
const publicApi = new PublicApi();
|
|
59
121
|
|
|
@@ -67,7 +129,7 @@ const response = await publicApi.getCommentsPublic({
|
|
|
67
129
|
### Example: Using Default API (server-side only)
|
|
68
130
|
|
|
69
131
|
```typescript
|
|
70
|
-
import { DefaultApi, Configuration } from '
|
|
132
|
+
import { DefaultApi, Configuration } from 'fastcomments-sdk/server';
|
|
71
133
|
|
|
72
134
|
const config = new Configuration({
|
|
73
135
|
apiKey: 'your-api-key' // Keep this secret!
|
|
@@ -83,16 +145,17 @@ const response = await defaultApi.getComments({
|
|
|
83
145
|
|
|
84
146
|
## SSO (Single Sign-On) Integration
|
|
85
147
|
|
|
86
|
-
FastComments supports SSO to integrate with your existing user authentication system.
|
|
148
|
+
FastComments supports SSO to integrate with your existing user authentication system. **SSO functionality is only available in the server export** since it requires Node.js crypto features.
|
|
87
149
|
|
|
88
|
-
### Simple SSO (
|
|
150
|
+
### Simple SSO (Server-Side Only)
|
|
89
151
|
|
|
90
|
-
Simple SSO
|
|
152
|
+
Simple SSO should be generated server-side and sent to the client:
|
|
91
153
|
|
|
92
154
|
```typescript
|
|
93
|
-
|
|
155
|
+
// Server-side code (Node.js/backend)
|
|
156
|
+
import { FastCommentsSSO, PublicApi } from 'fastcomments-sdk/server';
|
|
94
157
|
|
|
95
|
-
// Create simple SSO using the built-in helper
|
|
158
|
+
// Create simple SSO using the built-in helper
|
|
96
159
|
const userData = {
|
|
97
160
|
username: 'john_doe',
|
|
98
161
|
email: 'john@example.com',
|
|
@@ -107,14 +170,8 @@ const sso = FastCommentsSSO.createSimple(userData, {
|
|
|
107
170
|
|
|
108
171
|
const ssoToken = sso.createToken();
|
|
109
172
|
|
|
110
|
-
//
|
|
111
|
-
|
|
112
|
-
const response = await publicApi.getCommentsPublic({
|
|
113
|
-
tenantId: 'your-tenant-id',
|
|
114
|
-
urlId: 'page-url-id'
|
|
115
|
-
// Note: Simple SSO would typically be used with widget integration,
|
|
116
|
-
// not direct API calls
|
|
117
|
-
});
|
|
173
|
+
// Send ssoToken to your client-side code
|
|
174
|
+
// Client-side code can then use this token with the browser SDK
|
|
118
175
|
```
|
|
119
176
|
|
|
120
177
|
### Secure SSO (Server-Side, Recommended)
|
|
@@ -122,7 +179,8 @@ const response = await publicApi.getCommentsPublic({
|
|
|
122
179
|
Secure SSO should be implemented server-side and provides better security:
|
|
123
180
|
|
|
124
181
|
```typescript
|
|
125
|
-
|
|
182
|
+
// Server-side code (Node.js/backend)
|
|
183
|
+
import { FastCommentsSSO, PublicApi } from 'fastcomments-sdk/server';
|
|
126
184
|
|
|
127
185
|
// Create secure SSO using the built-in helper
|
|
128
186
|
const userData = {
|
|
@@ -142,19 +200,40 @@ const sso = FastCommentsSSO.createSecure('your-api-key', userData, {
|
|
|
142
200
|
|
|
143
201
|
const ssoConfig = sso.prepareToSend();
|
|
144
202
|
|
|
145
|
-
// Use with API calls
|
|
203
|
+
// Use with API calls on the server
|
|
146
204
|
const publicApi = new PublicApi();
|
|
147
205
|
const response = await publicApi.getCommentsPublic({
|
|
148
206
|
tenantId: 'your-tenant-id',
|
|
149
207
|
urlId: 'page-url-id',
|
|
150
208
|
sso: JSON.stringify(ssoConfig)
|
|
151
209
|
});
|
|
210
|
+
|
|
211
|
+
// Or send ssoConfig to client for browser usage
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Using SSO from Browser (with Server-Generated Token)
|
|
215
|
+
|
|
216
|
+
```typescript
|
|
217
|
+
// Client-side code (browser)
|
|
218
|
+
import { PublicApi } from 'fastcomments-sdk/browser';
|
|
219
|
+
|
|
220
|
+
// Get SSO token from your server endpoint
|
|
221
|
+
const ssoToken = await fetch('/api/sso-token').then(r => r.json());
|
|
222
|
+
|
|
223
|
+
const publicApi = new PublicApi();
|
|
224
|
+
const response = await publicApi.getCommentsPublic({
|
|
225
|
+
tenantId: 'your-tenant-id',
|
|
226
|
+
urlId: 'page-url-id',
|
|
227
|
+
sso: ssoToken // Use the server-generated SSO token
|
|
228
|
+
});
|
|
152
229
|
```
|
|
153
230
|
|
|
154
231
|
### SSO with Comment Creation
|
|
155
232
|
|
|
156
233
|
```typescript
|
|
157
|
-
// Create
|
|
234
|
+
// Server-side: Create SSO and comment
|
|
235
|
+
import { FastCommentsSSO, PublicApi } from 'fastcomments-sdk/server';
|
|
236
|
+
|
|
158
237
|
const sso = FastCommentsSSO.createSecure('your-api-key', userData);
|
|
159
238
|
const ssoConfig = sso.prepareToSend();
|
|
160
239
|
|
|
@@ -229,7 +308,7 @@ Subscribe to live events to get real-time updates for comments, votes, and other
|
|
|
229
308
|
Listen for live events on a specific page (comments, votes, etc.):
|
|
230
309
|
|
|
231
310
|
```typescript
|
|
232
|
-
import { subscribeToChanges, LiveEvent, LiveEventType } from 'fastcomments-sdk';
|
|
311
|
+
import { subscribeToChanges, LiveEvent, LiveEventType } from 'fastcomments-sdk/browser';
|
|
233
312
|
|
|
234
313
|
const config = {
|
|
235
314
|
tenantId: 'your-tenant-id',
|
|
@@ -277,7 +356,7 @@ subscription.close();
|
|
|
277
356
|
Listen for user-specific events (notifications, mentions, etc.):
|
|
278
357
|
|
|
279
358
|
```typescript
|
|
280
|
-
import { subscribeToUserFeed, LiveEvent, LiveEventType } from 'fastcomments-sdk';
|
|
359
|
+
import { subscribeToUserFeed, LiveEvent, LiveEventType } from 'fastcomments-sdk/browser';
|
|
281
360
|
|
|
282
361
|
const userConfig = {
|
|
283
362
|
userIdWS: 'user-session-id', // Get this from getComments response
|
|
@@ -370,18 +449,23 @@ try {
|
|
|
370
449
|
The SDK is written in TypeScript and provides complete type definitions for all API methods and response models:
|
|
371
450
|
|
|
372
451
|
```typescript
|
|
452
|
+
// Import types from the default export (safe everywhere)
|
|
373
453
|
import type {
|
|
374
454
|
PublicComment,
|
|
375
455
|
CreateCommentParams,
|
|
376
456
|
GetCommentsPublic200Response
|
|
377
|
-
} from '
|
|
457
|
+
} from 'fastcomments-sdk';
|
|
458
|
+
|
|
459
|
+
// Use with browser SDK
|
|
460
|
+
import { createFastCommentsBrowserSDK } from 'fastcomments-sdk/browser';
|
|
378
461
|
|
|
462
|
+
const sdk = createFastCommentsBrowserSDK();
|
|
379
463
|
const response: GetCommentsPublic200Response = await sdk.publicApi.getCommentsPublic({
|
|
380
464
|
tenantId: 'your-tenant-id',
|
|
381
465
|
urlId: 'page-id'
|
|
382
466
|
});
|
|
383
467
|
|
|
384
|
-
const comments: PublicComment[] = response.
|
|
468
|
+
const comments: PublicComment[] = response.comments || [];
|
|
385
469
|
```
|
|
386
470
|
|
|
387
471
|
## License
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-compatibility.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/browser-compatibility.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const node_test_1 = require("node:test");
|
|
7
|
+
const node_assert_1 = __importDefault(require("node:assert"));
|
|
8
|
+
const fs_1 = require("fs");
|
|
9
|
+
const path_1 = require("path");
|
|
10
|
+
const happy_dom_1 = require("happy-dom");
|
|
11
|
+
(0, node_test_1.describe)('Browser Compatibility Tests', () => {
|
|
12
|
+
(0, node_test_1.describe)('Validation: Testing environment catches Node.js imports', () => {
|
|
13
|
+
(0, node_test_1.it)('should demonstrate that our testing approach works by catching Node.js imports', () => {
|
|
14
|
+
// Store originals
|
|
15
|
+
const originalRequire = global.require;
|
|
16
|
+
// Mock require to reject Node.js built-ins
|
|
17
|
+
global.require = (module) => {
|
|
18
|
+
const nodeBuiltins = ['fs', 'crypto', 'path', 'os', 'util', 'events', 'stream'];
|
|
19
|
+
if (nodeBuiltins.some(builtin => module === builtin || module.startsWith(builtin + '/'))) {
|
|
20
|
+
throw new Error(`Cannot resolve module '${module}' in browser environment`);
|
|
21
|
+
}
|
|
22
|
+
return originalRequire(module);
|
|
23
|
+
};
|
|
24
|
+
try {
|
|
25
|
+
// Test that our mock catches Node.js built-in imports
|
|
26
|
+
node_assert_1.default.throws(() => {
|
|
27
|
+
const mockRequire = global.require;
|
|
28
|
+
mockRequire('fs'); // This should throw
|
|
29
|
+
}, /Cannot resolve module 'fs' in browser environment/, 'Mocked require should reject Node.js built-ins');
|
|
30
|
+
node_assert_1.default.throws(() => {
|
|
31
|
+
const mockRequire = global.require;
|
|
32
|
+
mockRequire('crypto'); // This should throw
|
|
33
|
+
}, /Cannot resolve module 'crypto' in browser environment/, 'Mocked require should reject Node.js crypto module');
|
|
34
|
+
}
|
|
35
|
+
finally {
|
|
36
|
+
// Restore original require
|
|
37
|
+
global.require = originalRequire;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
(0, node_test_1.describe)('Static Analysis: Check compiled browser export for Node.js imports', () => {
|
|
42
|
+
(0, node_test_1.it)('should not contain require() calls for Node.js built-ins', () => {
|
|
43
|
+
const browserJsPath = (0, path_1.join)(process.cwd(), 'dist', 'browser.js');
|
|
44
|
+
let browserJsContent;
|
|
45
|
+
try {
|
|
46
|
+
browserJsContent = (0, fs_1.readFileSync)(browserJsPath, 'utf-8');
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
throw new Error(`Cannot read dist/browser.js. Did you run 'npm run build' first? ${error}`);
|
|
50
|
+
}
|
|
51
|
+
// Node.js built-in modules that should NOT appear in browser bundle
|
|
52
|
+
const nodeBuiltins = [
|
|
53
|
+
'crypto', 'fs', 'path', 'os', 'util', 'events', 'stream', 'buffer',
|
|
54
|
+
'url', 'http', 'https', 'net', 'tls', 'zlib', 'child_process', 'cluster'
|
|
55
|
+
];
|
|
56
|
+
const foundImports = [];
|
|
57
|
+
for (const builtin of nodeBuiltins) {
|
|
58
|
+
// Check for various import patterns
|
|
59
|
+
const patterns = [
|
|
60
|
+
`require("${builtin}")`,
|
|
61
|
+
`require('${builtin}')`,
|
|
62
|
+
`require(\`${builtin}\`)`,
|
|
63
|
+
`from "${builtin}"`,
|
|
64
|
+
`from '${builtin}'`,
|
|
65
|
+
`from \`${builtin}\``
|
|
66
|
+
];
|
|
67
|
+
for (const pattern of patterns) {
|
|
68
|
+
if (browserJsContent.includes(pattern)) {
|
|
69
|
+
foundImports.push(`Found: ${pattern}`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (foundImports.length > 0) {
|
|
74
|
+
node_assert_1.default.fail(`Browser export contains Node.js built-in imports:\n${foundImports.join('\n')}`);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
(0, node_test_1.describe)('Runtime Verification: Browser export works in browser-like environment', () => {
|
|
79
|
+
let originalRequire;
|
|
80
|
+
let window;
|
|
81
|
+
(0, node_test_1.beforeEach)(() => {
|
|
82
|
+
// Create clean browser-like environment
|
|
83
|
+
window = new happy_dom_1.Window();
|
|
84
|
+
// Store original require
|
|
85
|
+
originalRequire = global.require;
|
|
86
|
+
// Remove Node.js built-ins to simulate real browser
|
|
87
|
+
global.require = (module) => {
|
|
88
|
+
const nodeBuiltins = ['fs', 'crypto', 'path', 'os', 'util', 'events', 'stream'];
|
|
89
|
+
if (nodeBuiltins.some(builtin => module === builtin || module.startsWith(builtin + '/'))) {
|
|
90
|
+
throw new Error(`Module '${module}' not available in browser`);
|
|
91
|
+
}
|
|
92
|
+
return originalRequire(module);
|
|
93
|
+
};
|
|
94
|
+
// Set up minimal browser-like globals
|
|
95
|
+
if (!global.fetch) {
|
|
96
|
+
global.fetch = (() => Promise.reject(new Error('fetch not available in test')));
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
(0, node_test_1.afterEach)(() => {
|
|
100
|
+
// Restore original require
|
|
101
|
+
global.require = originalRequire;
|
|
102
|
+
});
|
|
103
|
+
(0, node_test_1.it)('should load browser export without errors', () => {
|
|
104
|
+
try {
|
|
105
|
+
// This should not throw if the browser export is truly browser-compatible
|
|
106
|
+
const browserExport = require('../../dist/browser.js');
|
|
107
|
+
node_assert_1.default.ok(browserExport, 'Browser export should load successfully');
|
|
108
|
+
node_assert_1.default.ok(typeof browserExport === 'object', 'Browser export should be an object');
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
if (error.message.includes('not available in browser')) {
|
|
112
|
+
node_assert_1.default.fail(`Browser export tried to use Node.js built-in: ${error.message}`);
|
|
113
|
+
}
|
|
114
|
+
throw error;
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
(0, node_test_1.it)('should be able to create browser SDK instance', () => {
|
|
118
|
+
try {
|
|
119
|
+
const { createFastCommentsBrowserSDK } = require('../../dist/browser.js');
|
|
120
|
+
node_assert_1.default.ok(typeof createFastCommentsBrowserSDK === 'function', 'createFastCommentsBrowserSDK should be a function');
|
|
121
|
+
const sdk = createFastCommentsBrowserSDK();
|
|
122
|
+
node_assert_1.default.ok(sdk, 'Should be able to create SDK instance');
|
|
123
|
+
node_assert_1.default.ok(sdk.publicApi, 'SDK should have publicApi');
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
if (error.message.includes('not available in browser')) {
|
|
127
|
+
node_assert_1.default.fail(`SDK creation tried to use Node.js built-in: ${error.message}`);
|
|
128
|
+
}
|
|
129
|
+
throw error;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
(0, node_test_1.it)('should have functional getFeedPostsStats API', () => {
|
|
133
|
+
try {
|
|
134
|
+
const { createFastCommentsBrowserSDK } = require('../../dist/browser.js');
|
|
135
|
+
const sdk = createFastCommentsBrowserSDK();
|
|
136
|
+
node_assert_1.default.ok(sdk.publicApi.getFeedPostsStats, 'getFeedPostsStats should be available');
|
|
137
|
+
node_assert_1.default.ok(typeof sdk.publicApi.getFeedPostsStats === 'function', 'getFeedPostsStats should be a function');
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
if (error.message.includes('not available in browser')) {
|
|
141
|
+
node_assert_1.default.fail(`getFeedPostsStats access tried to use Node.js built-in: ${error.message}`);
|
|
142
|
+
}
|
|
143
|
+
throw error;
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
(0, node_test_1.it)('should have functional live utilities', () => {
|
|
147
|
+
try {
|
|
148
|
+
const browserExports = require('../../dist/browser.js');
|
|
149
|
+
// Check that live utilities are available
|
|
150
|
+
node_assert_1.default.ok(browserExports.makeRequest, 'makeRequest should be available');
|
|
151
|
+
node_assert_1.default.ok(typeof browserExports.makeRequest === 'function', 'makeRequest should be a function');
|
|
152
|
+
node_assert_1.default.ok(browserExports.subscribeToChanges, 'subscribeToChanges should be available');
|
|
153
|
+
node_assert_1.default.ok(typeof browserExports.subscribeToChanges === 'function', 'subscribeToChanges should be a function');
|
|
154
|
+
}
|
|
155
|
+
catch (error) {
|
|
156
|
+
if (error.message.includes('not available in browser')) {
|
|
157
|
+
node_assert_1.default.fail(`Live utilities tried to use Node.js built-in: ${error.message}`);
|
|
158
|
+
}
|
|
159
|
+
throw error;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
(0, node_test_1.it)('should NOT have SSO functionality (which requires Node.js crypto)', () => {
|
|
163
|
+
const browserExports = require('../../dist/browser.js');
|
|
164
|
+
// Browser export should not include SSO functionality
|
|
165
|
+
node_assert_1.default.ok(!browserExports.FastCommentsSSO, 'FastCommentsSSO should not be in browser export');
|
|
166
|
+
node_assert_1.default.ok(!browserExports.SecureSSOPayloadBuilder, 'SecureSSOPayloadBuilder should not be in browser export');
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
//# sourceMappingURL=browser-compatibility.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-compatibility.test.js","sourceRoot":"","sources":["../../src/__tests__/browser-compatibility.test.ts"],"names":[],"mappings":";;;;;AAAA,yCAAgE;AAChE,8DAAiC;AACjC,2BAAkC;AAClC,+BAA4B;AAC5B,yCAAmC;AAEnC,IAAA,oBAAQ,EAAC,6BAA6B,EAAE,GAAG,EAAE;IAE3C,IAAA,oBAAQ,EAAC,yDAAyD,EAAE,GAAG,EAAE;QACvE,IAAA,cAAE,EAAC,gFAAgF,EAAE,GAAG,EAAE;YACxF,kBAAkB;YAClB,MAAM,eAAe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,CAAC,CAAC;gBAChF,CAAC;gBACD,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,IAAA,cAAE,EAAC,mEAAmE,EAAE,GAAG,EAAE;YAC3E,MAAM,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;YAExD,sDAAsD;YACtD,qBAAM,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,eAAe,EAAE,iDAAiD,CAAC,CAAC;YAC9F,qBAAM,CAAC,EAAE,CAAC,CAAC,cAAc,CAAC,uBAAuB,EAAE,yDAAyD,CAAC,CAAC;QAChH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const node_test_1 = require("node:test");
|
|
7
7
|
const node_assert_1 = __importDefault(require("node:assert"));
|
|
8
|
-
const
|
|
8
|
+
const server_1 = require("../server");
|
|
9
9
|
const env_1 = require("./env");
|
|
10
10
|
// Test against the real FastComments API
|
|
11
11
|
(0, node_test_1.describe)('FastComments SSO Integration Tests', () => {
|
|
@@ -13,12 +13,12 @@ const env_1 = require("./env");
|
|
|
13
13
|
let publicApi;
|
|
14
14
|
let defaultApi;
|
|
15
15
|
(0, node_test_1.beforeEach)(() => {
|
|
16
|
-
sdk = (0,
|
|
16
|
+
sdk = (0, server_1.createFastCommentsSDK)({
|
|
17
17
|
apiKey: env_1.API_KEY,
|
|
18
18
|
basePath: env_1.BASE_URL
|
|
19
19
|
});
|
|
20
|
-
publicApi = new
|
|
21
|
-
defaultApi = new
|
|
20
|
+
publicApi = new server_1.PublicApi(new server_1.Configuration({ basePath: env_1.BASE_URL }));
|
|
21
|
+
defaultApi = new server_1.DefaultApi(new server_1.Configuration({
|
|
22
22
|
apiKey: env_1.API_KEY,
|
|
23
23
|
basePath: env_1.BASE_URL
|
|
24
24
|
}));
|
|
@@ -47,7 +47,7 @@ const env_1 = require("./env");
|
|
|
47
47
|
};
|
|
48
48
|
(0, node_test_1.describe)('Secure SSO API Integration', () => {
|
|
49
49
|
(0, node_test_1.it)('should work with PublicApi.getCommentsPublic using secure SSO', async () => {
|
|
50
|
-
const sso =
|
|
50
|
+
const sso = server_1.FastCommentsSSO.createSecure(env_1.API_KEY, mockSecureUser);
|
|
51
51
|
const ssoConfig = sso.prepareToSend();
|
|
52
52
|
try {
|
|
53
53
|
const response = await publicApi.getCommentsPublic({
|
|
@@ -94,7 +94,7 @@ const env_1 = require("./env");
|
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
96
|
(0, node_test_1.it)('should create comment with secure SSO', async () => {
|
|
97
|
-
const sso =
|
|
97
|
+
const sso = server_1.FastCommentsSSO.createSecure(env_1.API_KEY, mockSecureUser);
|
|
98
98
|
const ssoConfig = sso.prepareToSend();
|
|
99
99
|
try {
|
|
100
100
|
const response = await publicApi.createCommentPublic({
|
|
@@ -133,7 +133,7 @@ const env_1 = require("./env");
|
|
|
133
133
|
});
|
|
134
134
|
(0, node_test_1.describe)('Simple SSO API Integration', () => {
|
|
135
135
|
(0, node_test_1.it)('should work with PublicApi.getCommentsPublic using simple SSO', async () => {
|
|
136
|
-
const sso =
|
|
136
|
+
const sso = server_1.FastCommentsSSO.createSimple(mockSimpleUser);
|
|
137
137
|
const ssoToken = sso.createToken();
|
|
138
138
|
try {
|
|
139
139
|
const response = await publicApi.getCommentsPublic({
|
|
@@ -154,7 +154,7 @@ const env_1 = require("./env");
|
|
|
154
154
|
}
|
|
155
155
|
});
|
|
156
156
|
(0, node_test_1.it)('should create comment with simple SSO', async () => {
|
|
157
|
-
const sso =
|
|
157
|
+
const sso = server_1.FastCommentsSSO.createSimple(mockSimpleUser);
|
|
158
158
|
const ssoToken = sso.createToken();
|
|
159
159
|
try {
|
|
160
160
|
const response = await publicApi.createCommentPublic({
|
|
@@ -213,7 +213,7 @@ const env_1 = require("./env");
|
|
|
213
213
|
});
|
|
214
214
|
(0, node_test_1.describe)('Error Handling', () => {
|
|
215
215
|
(0, node_test_1.it)('should handle invalid tenant ID gracefully', async () => {
|
|
216
|
-
const sso =
|
|
216
|
+
const sso = server_1.FastCommentsSSO.createSecure(env_1.API_KEY, mockSecureUser);
|
|
217
217
|
const ssoConfig = sso.prepareToSend();
|
|
218
218
|
try {
|
|
219
219
|
await publicApi.getCommentsPublic({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sso.integration.test.js","sourceRoot":"","sources":["../../src/__tests__/sso.integration.test.ts"],"names":[],"mappings":";;;;;AAAA,yCAAqD;AACrD,8DAAiC;AACjC,
|
|
1
|
+
{"version":3,"file":"sso.integration.test.js","sourceRoot":"","sources":["../../src/__tests__/sso.integration.test.ts"],"names":[],"mappings":";;;;;AAAA,yCAAqD;AACrD,8DAAiC;AACjC,sCAQmB;AACnB,+BAAqD;AAErD,yCAAyC;AACzC,IAAA,oBAAQ,EAAC,oCAAoC,EAAE,GAAG,EAAE;IAElD,IAAI,GAA6C,CAAC;IAClD,IAAI,SAAoB,CAAC;IACzB,IAAI,UAAsB,CAAC;IAE3B,IAAA,sBAAU,EAAC,GAAG,EAAE;QACd,GAAG,GAAG,IAAA,8BAAqB,EAAC;YAC1B,MAAM,EAAE,aAAO;YACf,QAAQ,EAAE,cAAQ;SACnB,CAAC,CAAC;QAEH,SAAS,GAAG,IAAI,kBAAS,CAAC,IAAI,sBAAa,CAAC,EAAE,QAAQ,EAAE,cAAQ,EAAE,CAAC,CAAC,CAAC;QACrE,UAAU,GAAG,IAAI,mBAAU,CAAC,IAAI,sBAAa,CAAC;YAC5C,MAAM,EAAE,aAAO;YACf,QAAQ,EAAE,cAAQ;SACnB,CAAC,CAAC,CAAC;IACN,CAAC,CAAC,CAAC;IAEH,MAAM,cAAc,GAAsB;QACxC,EAAE,EAAE,aAAa,IAAI,CAAC,GAAG,EAAE,EAAE;QAC7B,KAAK,EAAE,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;iBAC/B,CAAC,CAAC;YACL,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,qBAAM,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC;YACjC,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,IAAA,cAAE,EAAC,6CAA6C,EAAE,KAAK,IAAI,EAAE;YAC3D,IAAI,CAAC;gBACH,MAAM,SAAS,CAAC,iBAAiB,CAAC;oBAChC,QAAQ,EAAE,eAAS;oBACnB,KAAK,EAAE,WAAW;oBAClB,GAAG,EAAE,kBAAkB;iBACxB,CAAC,CAAC;YACL,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBACpB,qBAAM,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC;YACjC,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export * from './generated/src/apis';
|
|
2
|
+
export * from './generated/src/models';
|
|
3
|
+
export { Configuration } from './generated/src/runtime';
|
|
4
|
+
export { DefaultApi, PublicApi, HiddenApi } from './generated/src/apis';
|
|
5
|
+
export { createURLQueryString, isAPIError, debounce, makeRequest } from './live/utils';
|
|
6
|
+
export { default as subscribeToChanges } from './live/subscribe-to-changes';
|
|
7
|
+
export type { SubscribeToChangesResult, SubscribeToChangesConfig } from './live/subscribe-to-changes';
|
|
8
|
+
export { subscribeToUserFeed } from './live/user-feed';
|
|
9
|
+
export type { UserFeedConfig } from './live/user-feed';
|
|
10
|
+
export type { LiveEvent, LiveEventType, EventLogEntry, PubSubComment, PubSubVote, FeedPost, UserNotification } from './generated/src/index';
|
|
11
|
+
export type * from './sso/types';
|
|
12
|
+
import { DefaultApi, PublicApi, HiddenApi } from './generated/src/apis';
|
|
13
|
+
export interface FastCommentsBrowserSDKConfig {
|
|
14
|
+
apiKey?: string;
|
|
15
|
+
basePath?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare class FastCommentsBrowserSDK {
|
|
18
|
+
private config;
|
|
19
|
+
private _defaultApi;
|
|
20
|
+
private _publicApi;
|
|
21
|
+
private _hiddenApi;
|
|
22
|
+
constructor(config?: FastCommentsBrowserSDKConfig);
|
|
23
|
+
private getConfiguration;
|
|
24
|
+
get defaultApi(): DefaultApi;
|
|
25
|
+
get publicApi(): PublicApi;
|
|
26
|
+
get hiddenApi(): HiddenApi;
|
|
27
|
+
/**
|
|
28
|
+
* Update the API key for authenticated requests
|
|
29
|
+
*/
|
|
30
|
+
setApiKey(apiKey: string): void;
|
|
31
|
+
/**
|
|
32
|
+
* Update the base path for API requests
|
|
33
|
+
*/
|
|
34
|
+
setBasePath(basePath: string): void;
|
|
35
|
+
}
|
|
36
|
+
export declare function createFastCommentsBrowserSDK(config?: FastCommentsBrowserSDKConfig): FastCommentsBrowserSDK;
|
|
37
|
+
//# sourceMappingURL=browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAIA,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGxE,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvF,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAC5E,YAAY,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACtG,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG5I,mBAAmB,aAAa,CAAC;AAGjC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGxE,MAAM,WAAW,4BAA4B;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,sBAAsB;IACjC,OAAO,CAAC,MAAM,CAA+B;IAC7C,OAAO,CAAC,WAAW,CAA2B;IAC9C,OAAO,CAAC,UAAU,CAA0B;IAC5C,OAAO,CAAC,UAAU,CAA0B;gBAEhC,MAAM,GAAE,4BAAiC;IAOrD,OAAO,CAAC,gBAAgB;IAOxB,IAAW,UAAU,IAAI,UAAU,CAKlC;IAED,IAAW,SAAS,IAAI,SAAS,CAKhC;IAED,IAAW,SAAS,IAAI,SAAS,CAKhC;IAED;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAO/B;;OAEG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;CAMpC;AAGD,wBAAgB,4BAA4B,CAAC,MAAM,CAAC,EAAE,4BAA4B,GAAG,sBAAsB,CAE1G"}
|
package/dist/browser.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Browser-safe exports - no Node.js dependencies
|
|
3
|
+
// Safe for use in browsers and environments without Node.js crypto
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17
|
+
};
|
|
18
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
19
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.FastCommentsBrowserSDK = exports.subscribeToUserFeed = exports.subscribeToChanges = exports.makeRequest = exports.debounce = exports.isAPIError = exports.createURLQueryString = exports.HiddenApi = exports.PublicApi = exports.DefaultApi = exports.Configuration = void 0;
|
|
23
|
+
exports.createFastCommentsBrowserSDK = createFastCommentsBrowserSDK;
|
|
24
|
+
// Export the generated API client (fetch-based, works in browsers)
|
|
25
|
+
__exportStar(require("./generated/src/apis"), exports);
|
|
26
|
+
__exportStar(require("./generated/src/models"), exports);
|
|
27
|
+
var runtime_1 = require("./generated/src/runtime");
|
|
28
|
+
Object.defineProperty(exports, "Configuration", { enumerable: true, get: function () { return runtime_1.Configuration; } });
|
|
29
|
+
// Re-export commonly used types and classes for convenience
|
|
30
|
+
var apis_1 = require("./generated/src/apis");
|
|
31
|
+
Object.defineProperty(exports, "DefaultApi", { enumerable: true, get: function () { return apis_1.DefaultApi; } });
|
|
32
|
+
Object.defineProperty(exports, "PublicApi", { enumerable: true, get: function () { return apis_1.PublicApi; } });
|
|
33
|
+
Object.defineProperty(exports, "HiddenApi", { enumerable: true, get: function () { return apis_1.HiddenApi; } });
|
|
34
|
+
// Export client-safe live utilities (fetch-based WebSocket fallbacks)
|
|
35
|
+
var utils_1 = require("./live/utils");
|
|
36
|
+
Object.defineProperty(exports, "createURLQueryString", { enumerable: true, get: function () { return utils_1.createURLQueryString; } });
|
|
37
|
+
Object.defineProperty(exports, "isAPIError", { enumerable: true, get: function () { return utils_1.isAPIError; } });
|
|
38
|
+
Object.defineProperty(exports, "debounce", { enumerable: true, get: function () { return utils_1.debounce; } });
|
|
39
|
+
Object.defineProperty(exports, "makeRequest", { enumerable: true, get: function () { return utils_1.makeRequest; } });
|
|
40
|
+
var subscribe_to_changes_1 = require("./live/subscribe-to-changes");
|
|
41
|
+
Object.defineProperty(exports, "subscribeToChanges", { enumerable: true, get: function () { return __importDefault(subscribe_to_changes_1).default; } });
|
|
42
|
+
var user_feed_1 = require("./live/user-feed");
|
|
43
|
+
Object.defineProperty(exports, "subscribeToUserFeed", { enumerable: true, get: function () { return user_feed_1.subscribeToUserFeed; } });
|
|
44
|
+
// Browser-safe SDK class
|
|
45
|
+
const apis_2 = require("./generated/src/apis");
|
|
46
|
+
const runtime_2 = require("./generated/src/runtime");
|
|
47
|
+
class FastCommentsBrowserSDK {
|
|
48
|
+
constructor(config = {}) {
|
|
49
|
+
this._defaultApi = null;
|
|
50
|
+
this._publicApi = null;
|
|
51
|
+
this._hiddenApi = null;
|
|
52
|
+
this.config = { ...config };
|
|
53
|
+
if (!this.config.basePath) {
|
|
54
|
+
this.config.basePath = 'https://fastcomments.com';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
getConfiguration() {
|
|
58
|
+
return new runtime_2.Configuration({
|
|
59
|
+
apiKey: this.config.apiKey,
|
|
60
|
+
basePath: this.config.basePath,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
get defaultApi() {
|
|
64
|
+
if (!this._defaultApi) {
|
|
65
|
+
this._defaultApi = new apis_2.DefaultApi(this.getConfiguration());
|
|
66
|
+
}
|
|
67
|
+
return this._defaultApi;
|
|
68
|
+
}
|
|
69
|
+
get publicApi() {
|
|
70
|
+
if (!this._publicApi) {
|
|
71
|
+
this._publicApi = new apis_2.PublicApi(this.getConfiguration());
|
|
72
|
+
}
|
|
73
|
+
return this._publicApi;
|
|
74
|
+
}
|
|
75
|
+
get hiddenApi() {
|
|
76
|
+
if (!this._hiddenApi) {
|
|
77
|
+
this._hiddenApi = new apis_2.HiddenApi(this.getConfiguration());
|
|
78
|
+
}
|
|
79
|
+
return this._hiddenApi;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Update the API key for authenticated requests
|
|
83
|
+
*/
|
|
84
|
+
setApiKey(apiKey) {
|
|
85
|
+
this.config.apiKey = apiKey;
|
|
86
|
+
this._defaultApi = null;
|
|
87
|
+
this._publicApi = null;
|
|
88
|
+
this._hiddenApi = null;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Update the base path for API requests
|
|
92
|
+
*/
|
|
93
|
+
setBasePath(basePath) {
|
|
94
|
+
this.config.basePath = basePath;
|
|
95
|
+
this._defaultApi = null;
|
|
96
|
+
this._publicApi = null;
|
|
97
|
+
this._hiddenApi = null;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.FastCommentsBrowserSDK = FastCommentsBrowserSDK;
|
|
101
|
+
// Export a convenience function to create a new browser SDK instance
|
|
102
|
+
function createFastCommentsBrowserSDK(config) {
|
|
103
|
+
return new FastCommentsBrowserSDK(config);
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,mEAAmE;;;;;;;;;;;;;;;;;;;;AA+FnE,oEAEC;AA/FD,mEAAmE;AACnE,uDAAqC;AACrC,yDAAuC;AACvC,mDAAwD;AAA/C,wGAAA,aAAa,OAAA;AAEtB,4DAA4D;AAC5D,6CAAwE;AAA/D,kGAAA,UAAU,OAAA;AAAE,iGAAA,SAAS,OAAA;AAAE,iGAAA,SAAS,OAAA;AAEzC,sEAAsE;AACtE,sCAAuF;AAA9E,6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AU,EAAE,CAAC;YACrB,IAAI,CAAC,UAAU,GAAG,IAAI,gBAAS,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,SAAS,CAAC,MAAc;QACtB,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,QAAgB;QAC1B,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAChC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC;CACF;AA5DD,wDA4DC;AAED,qEAAqE;AACrE,SAAgB,4BAA4B,CAAC,MAAqC;IAChF,OAAO,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAAC;AAC5C,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,31 +1,8 @@
|
|
|
1
|
-
export * from './generated/src/apis';
|
|
2
|
-
export * from './generated/src/models';
|
|
3
|
-
export { Configuration } from './generated/src/runtime';
|
|
4
|
-
export {
|
|
5
|
-
export * from './sso';
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
apiKey?: string;
|
|
9
|
-
basePath?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare class FastCommentsSDK {
|
|
12
|
-
private config;
|
|
13
|
-
private _defaultApi;
|
|
14
|
-
private _publicApi;
|
|
15
|
-
private _hiddenApi;
|
|
16
|
-
constructor(config?: FastCommentsSDKConfig);
|
|
17
|
-
private getConfiguration;
|
|
18
|
-
get defaultApi(): DefaultApi;
|
|
19
|
-
get publicApi(): PublicApi;
|
|
20
|
-
get hiddenApi(): HiddenApi;
|
|
21
|
-
/**
|
|
22
|
-
* Update the API key for authenticated requests
|
|
23
|
-
*/
|
|
24
|
-
setApiKey(apiKey: string): void;
|
|
25
|
-
/**
|
|
26
|
-
* Update the base path for API requests
|
|
27
|
-
*/
|
|
28
|
-
setBasePath(basePath: string): void;
|
|
29
|
-
}
|
|
30
|
-
export declare function createFastCommentsSDK(config?: FastCommentsSDKConfig): FastCommentsSDK;
|
|
1
|
+
export type * from './generated/src/apis';
|
|
2
|
+
export type * from './generated/src/models';
|
|
3
|
+
export type { Configuration } from './generated/src/runtime';
|
|
4
|
+
export type { LiveEvent, LiveEventType, EventLogEntry, PubSubComment, PubSubVote, FeedPost, UserNotification } from './generated/src/index';
|
|
5
|
+
export type * from './sso/types';
|
|
6
|
+
export type { SubscribeToChangesResult, SubscribeToChangesConfig } from './live/subscribe-to-changes';
|
|
7
|
+
export type { UserFeedConfig } from './live/user-feed';
|
|
31
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,wBAAwB,CAAC;AAC5C,YAAY,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAG7D,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG5I,mBAAmB,aAAa,CAAC;AAGjC,YAAY,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACtG,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,92 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
};
|
|
2
|
+
// Default export - Types only (safe for both client and server)
|
|
3
|
+
// This ensures the main package can be imported anywhere without Node.js dependencies
|
|
16
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
//
|
|
20
|
-
__exportStar(require("./generated/src/apis"), exports);
|
|
21
|
-
__exportStar(require("./generated/src/models"), exports);
|
|
22
|
-
var runtime_1 = require("./generated/src/runtime");
|
|
23
|
-
Object.defineProperty(exports, "Configuration", { enumerable: true, get: function () { return runtime_1.Configuration; } });
|
|
24
|
-
// Re-export commonly used types and classes for convenience
|
|
25
|
-
var apis_1 = require("./generated/src/apis");
|
|
26
|
-
Object.defineProperty(exports, "DefaultApi", { enumerable: true, get: function () { return apis_1.DefaultApi; } });
|
|
27
|
-
Object.defineProperty(exports, "PublicApi", { enumerable: true, get: function () { return apis_1.PublicApi; } });
|
|
28
|
-
Object.defineProperty(exports, "HiddenApi", { enumerable: true, get: function () { return apis_1.HiddenApi; } });
|
|
29
|
-
// Export SSO functionality
|
|
30
|
-
__exportStar(require("./sso"), exports);
|
|
31
|
-
// Export a default factory function for easy initialization
|
|
32
|
-
const apis_2 = require("./generated/src/apis");
|
|
33
|
-
const runtime_2 = require("./generated/src/runtime");
|
|
34
|
-
class FastCommentsSDK {
|
|
35
|
-
constructor(config = {}) {
|
|
36
|
-
this._defaultApi = null;
|
|
37
|
-
this._publicApi = null;
|
|
38
|
-
this._hiddenApi = null;
|
|
39
|
-
this.config = { ...config };
|
|
40
|
-
if (!this.config.basePath) {
|
|
41
|
-
this.config.basePath = 'https://fastcomments.com';
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
getConfiguration() {
|
|
45
|
-
return new runtime_2.Configuration({
|
|
46
|
-
apiKey: this.config.apiKey,
|
|
47
|
-
basePath: this.config.basePath,
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
get defaultApi() {
|
|
51
|
-
if (!this._defaultApi) {
|
|
52
|
-
this._defaultApi = new apis_2.DefaultApi(this.getConfiguration());
|
|
53
|
-
}
|
|
54
|
-
return this._defaultApi;
|
|
55
|
-
}
|
|
56
|
-
get publicApi() {
|
|
57
|
-
if (!this._publicApi) {
|
|
58
|
-
this._publicApi = new apis_2.PublicApi(this.getConfiguration());
|
|
59
|
-
}
|
|
60
|
-
return this._publicApi;
|
|
61
|
-
}
|
|
62
|
-
get hiddenApi() {
|
|
63
|
-
if (!this._hiddenApi) {
|
|
64
|
-
this._hiddenApi = new apis_2.HiddenApi(this.getConfiguration());
|
|
65
|
-
}
|
|
66
|
-
return this._hiddenApi;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Update the API key for authenticated requests
|
|
70
|
-
*/
|
|
71
|
-
setApiKey(apiKey) {
|
|
72
|
-
this.config.apiKey = apiKey;
|
|
73
|
-
this._defaultApi = null;
|
|
74
|
-
this._publicApi = null;
|
|
75
|
-
this._hiddenApi = null;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Update the base path for API requests
|
|
79
|
-
*/
|
|
80
|
-
setBasePath(basePath) {
|
|
81
|
-
this.config.basePath = basePath;
|
|
82
|
-
this._defaultApi = null;
|
|
83
|
-
this._publicApi = null;
|
|
84
|
-
this._hiddenApi = null;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
exports.FastCommentsSDK = FastCommentsSDK;
|
|
88
|
-
// Export a convenience function to create a new SDK instance
|
|
89
|
-
function createFastCommentsSDK(config) {
|
|
90
|
-
return new FastCommentsSDK(config);
|
|
91
|
-
}
|
|
5
|
+
// For actual usage, import from specific entry points:
|
|
6
|
+
// - import { ... } from 'fastcomments-sdk/browser' // Browser-safe APIs
|
|
7
|
+
// - import { ... } from 'fastcomments-sdk/server' // Full Node.js SDK with SSO
|
|
92
8
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,gEAAgE;AAChE,sFAAsF;;AAiBtF,uDAAuD;AACvD,wEAAwE;AACxE,+EAA+E"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './browser';
|
|
2
|
+
export * from './sso';
|
|
3
|
+
import { FastCommentsBrowserSDK, type FastCommentsBrowserSDKConfig } from './browser';
|
|
4
|
+
export interface FastCommentsServerSDKConfig extends FastCommentsBrowserSDKConfig {
|
|
5
|
+
apiKey?: string;
|
|
6
|
+
basePath?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class FastCommentsServerSDK extends FastCommentsBrowserSDK {
|
|
9
|
+
constructor(config?: FastCommentsServerSDKConfig);
|
|
10
|
+
}
|
|
11
|
+
export declare const FastCommentsSDK: typeof FastCommentsServerSDK;
|
|
12
|
+
export type FastCommentsSDKConfig = FastCommentsServerSDKConfig;
|
|
13
|
+
export declare function createFastCommentsSDK(config?: FastCommentsServerSDKConfig): FastCommentsServerSDK;
|
|
14
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAG1B,cAAc,OAAO,CAAC;AAGtB,OAAO,EAAE,sBAAsB,EAAE,KAAK,4BAA4B,EAAE,MAAM,WAAW,CAAC;AAEtF,MAAM,WAAW,2BAA4B,SAAQ,4BAA4B;IAC/E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,qBAAsB,SAAQ,sBAAsB;gBACnD,MAAM,GAAE,2BAAgC;CAGrD;AAGD,eAAO,MAAM,eAAe,8BAAwB,CAAC;AACrD,MAAM,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AAGhE,wBAAgB,qBAAqB,CAAC,MAAM,CAAC,EAAE,2BAA2B,GAAG,qBAAqB,CAEjG"}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Server-only exports - includes Node.js dependencies
|
|
3
|
+
// Use this for Node.js server environments
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.FastCommentsSDK = exports.FastCommentsServerSDK = void 0;
|
|
20
|
+
exports.createFastCommentsSDK = createFastCommentsSDK;
|
|
21
|
+
// Export everything from browser (APIs, types, live utilities)
|
|
22
|
+
__exportStar(require("./browser"), exports);
|
|
23
|
+
// Export SSO functionality (requires Node.js crypto)
|
|
24
|
+
__exportStar(require("./sso"), exports);
|
|
25
|
+
// Export full server SDK (browser SDK + SSO)
|
|
26
|
+
const browser_1 = require("./browser");
|
|
27
|
+
class FastCommentsServerSDK extends browser_1.FastCommentsBrowserSDK {
|
|
28
|
+
constructor(config = {}) {
|
|
29
|
+
super(config);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.FastCommentsServerSDK = FastCommentsServerSDK;
|
|
33
|
+
// Alias the full SDK for compatibility
|
|
34
|
+
exports.FastCommentsSDK = FastCommentsServerSDK;
|
|
35
|
+
// Export a convenience function to create a new server SDK instance
|
|
36
|
+
function createFastCommentsSDK(config) {
|
|
37
|
+
return new FastCommentsServerSDK(config);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";AAAA,sDAAsD;AACtD,2CAA2C;;;;;;;;;;;;;;;;;AA2B3C,sDAEC;AA3BD,+DAA+D;AAC/D,4CAA0B;AAE1B,qDAAqD;AACrD,wCAAsB;AAEtB,6CAA6C;AAC7C,uCAAsF;AAOtF,MAAa,qBAAsB,SAAQ,gCAAsB;IAC/D,YAAY,SAAsC,EAAE;QAClD,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;CACF;AAJD,sDAIC;AAED,uCAAuC;AAC1B,QAAA,eAAe,GAAG,qBAAqB,CAAC;AAGrD,sEAAsE;AACtE,SAAgB,qBAAqB,CAAC,MAAoC;IACxE,OAAO,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAC3C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,20 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fastcomments-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "FastComments API Client - A SDK for interacting with the FastComments API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"default": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"./browser": {
|
|
13
|
+
"types": "./dist/browser.d.ts",
|
|
14
|
+
"default": "./dist/browser.js"
|
|
15
|
+
},
|
|
16
|
+
"./server": {
|
|
17
|
+
"types": "./dist/server.d.ts",
|
|
18
|
+
"default": "./dist/server.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
7
21
|
"scripts": {
|
|
8
22
|
"build": "npm run generate && npm run compile",
|
|
9
23
|
"compile": "tsc",
|
|
10
24
|
"generate": "npm run clean:generated && ./scripts/update.sh",
|
|
11
25
|
"clean:generated": "rm -rf src/generated",
|
|
12
26
|
"clean": "rm -rf dist",
|
|
13
|
-
"prepublishOnly": "npm run build",
|
|
27
|
+
"prepublishOnly": "npm run build && npm run test:browser",
|
|
14
28
|
"publish:npm": "./scripts/publish.sh",
|
|
15
29
|
"test": "node --test dist/__tests__/**/*.test.js",
|
|
16
30
|
"test:unit": "node --test dist/__tests__/sso.test.js",
|
|
17
31
|
"test:integration": "node --test dist/__tests__/sso.integration.test.js",
|
|
32
|
+
"test:browser": "node --test dist/__tests__/browser-compatibility.test.js",
|
|
18
33
|
"test:watch": "node --test --watch dist/__tests__/**/*.test.js",
|
|
19
34
|
"lint": "eslint src --ext .ts",
|
|
20
35
|
"format": "prettier --write src/**/*.ts"
|
|
@@ -45,9 +60,10 @@
|
|
|
45
60
|
"devDependencies": {
|
|
46
61
|
"@openapitools/openapi-generator-cli": "^2.13.12",
|
|
47
62
|
"@types/node": "^20.0.0",
|
|
48
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
49
|
-
"@typescript-eslint/parser": "^
|
|
50
|
-
"eslint": "^
|
|
63
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
64
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
65
|
+
"eslint": "^9.35.0",
|
|
66
|
+
"happy-dom": "^12.0.0",
|
|
51
67
|
"prettier": "^3.0.0",
|
|
52
68
|
"typescript": "^5.0.0"
|
|
53
69
|
},
|