n8n-nodes-liveblocks 0.0.0 → 0.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.
Files changed (93) hide show
  1. package/README.md +97 -0
  2. package/dist/credentials/LiveblocksApi.credentials.d.ts +9 -0
  3. package/dist/credentials/LiveblocksApi.credentials.js +35 -0
  4. package/dist/credentials/LiveblocksApi.credentials.js.map +1 -0
  5. package/dist/credentials/LiveblocksWebhookSigningSecretApi.credentials.d.ts +8 -0
  6. package/dist/credentials/LiveblocksWebhookSigningSecretApi.credentials.js +25 -0
  7. package/dist/credentials/LiveblocksWebhookSigningSecretApi.credentials.js.map +1 -0
  8. package/dist/credentials/liveblocks.svg +1 -0
  9. package/dist/nodes/Liveblocks/Liveblocks.node.d.ts +5 -0
  10. package/dist/nodes/Liveblocks/Liveblocks.node.js +365 -0
  11. package/dist/nodes/Liveblocks/Liveblocks.node.js.map +1 -0
  12. package/dist/nodes/Liveblocks/Liveblocks.node.json +28 -0
  13. package/dist/nodes/Liveblocks/LiveblocksTrigger.node.d.ts +5 -0
  14. package/dist/nodes/Liveblocks/LiveblocksTrigger.node.js +251 -0
  15. package/dist/nodes/Liveblocks/LiveblocksTrigger.node.js.map +1 -0
  16. package/dist/nodes/Liveblocks/client/client/client.gen.d.ts +2 -0
  17. package/dist/nodes/Liveblocks/client/client/client.gen.js +231 -0
  18. package/dist/nodes/Liveblocks/client/client/client.gen.js.map +1 -0
  19. package/dist/nodes/Liveblocks/client/client/index.d.ts +8 -0
  20. package/dist/nodes/Liveblocks/client/client/index.js +17 -0
  21. package/dist/nodes/Liveblocks/client/client/index.js.map +1 -0
  22. package/dist/nodes/Liveblocks/client/client/types.gen.d.ts +68 -0
  23. package/dist/nodes/Liveblocks/client/client/types.gen.js +3 -0
  24. package/dist/nodes/Liveblocks/client/client/types.gen.js.map +1 -0
  25. package/dist/nodes/Liveblocks/client/client/utils.gen.d.ts +30 -0
  26. package/dist/nodes/Liveblocks/client/client/utils.gen.js +238 -0
  27. package/dist/nodes/Liveblocks/client/client/utils.gen.js.map +1 -0
  28. package/dist/nodes/Liveblocks/client/client.gen.d.ts +4 -0
  29. package/dist/nodes/Liveblocks/client/client.gen.js +6 -0
  30. package/dist/nodes/Liveblocks/client/client.gen.js.map +1 -0
  31. package/dist/nodes/Liveblocks/client/core/auth.gen.d.ts +8 -0
  32. package/dist/nodes/Liveblocks/client/core/auth.gen.js +18 -0
  33. package/dist/nodes/Liveblocks/client/core/auth.gen.js.map +1 -0
  34. package/dist/nodes/Liveblocks/client/core/bodySerializer.gen.d.ts +21 -0
  35. package/dist/nodes/Liveblocks/client/core/bodySerializer.gen.js +60 -0
  36. package/dist/nodes/Liveblocks/client/core/bodySerializer.gen.js.map +1 -0
  37. package/dist/nodes/Liveblocks/client/core/params.gen.d.ts +26 -0
  38. package/dist/nodes/Liveblocks/client/core/params.gen.js +104 -0
  39. package/dist/nodes/Liveblocks/client/core/params.gen.js.map +1 -0
  40. package/dist/nodes/Liveblocks/client/core/pathSerializer.gen.d.ts +30 -0
  41. package/dist/nodes/Liveblocks/client/core/pathSerializer.gen.js +115 -0
  42. package/dist/nodes/Liveblocks/client/core/pathSerializer.gen.js.map +1 -0
  43. package/dist/nodes/Liveblocks/client/core/queryKeySerializer.gen.d.ts +6 -0
  44. package/dist/nodes/Liveblocks/client/core/queryKeySerializer.gen.js +83 -0
  45. package/dist/nodes/Liveblocks/client/core/queryKeySerializer.gen.js.map +1 -0
  46. package/dist/nodes/Liveblocks/client/core/serverSentEvents.gen.d.ts +23 -0
  47. package/dist/nodes/Liveblocks/client/core/serverSentEvents.gen.js +133 -0
  48. package/dist/nodes/Liveblocks/client/core/serverSentEvents.gen.js.map +1 -0
  49. package/dist/nodes/Liveblocks/client/core/types.gen.d.ts +32 -0
  50. package/dist/nodes/Liveblocks/client/core/types.gen.js +3 -0
  51. package/dist/nodes/Liveblocks/client/core/types.gen.js.map +1 -0
  52. package/dist/nodes/Liveblocks/client/core/utils.gen.d.ts +19 -0
  53. package/dist/nodes/Liveblocks/client/core/utils.gen.js +90 -0
  54. package/dist/nodes/Liveblocks/client/core/utils.gen.js.map +1 -0
  55. package/dist/nodes/Liveblocks/client/index.d.ts +2 -0
  56. package/dist/nodes/Liveblocks/client/index.js +106 -0
  57. package/dist/nodes/Liveblocks/client/index.js.map +1 -0
  58. package/dist/nodes/Liveblocks/client/sdk.gen.d.ts +106 -0
  59. package/dist/nodes/Liveblocks/client/sdk.gen.js +648 -0
  60. package/dist/nodes/Liveblocks/client/sdk.gen.js.map +1 -0
  61. package/dist/nodes/Liveblocks/client/types.gen.d.ts +2612 -0
  62. package/dist/nodes/Liveblocks/client/types.gen.js +3 -0
  63. package/dist/nodes/Liveblocks/client/types.gen.js.map +1 -0
  64. package/dist/nodes/Liveblocks/liveblocks.dark.svg +3 -0
  65. package/dist/nodes/Liveblocks/liveblocks.svg +3 -0
  66. package/dist/nodes/Liveblocks/operations/definitions.d.ts +2 -0
  67. package/dist/nodes/Liveblocks/operations/definitions.js +966 -0
  68. package/dist/nodes/Liveblocks/operations/definitions.js.map +1 -0
  69. package/dist/nodes/Liveblocks/operations/properties.d.ts +2 -0
  70. package/dist/nodes/Liveblocks/operations/properties.js +206 -0
  71. package/dist/nodes/Liveblocks/operations/properties.js.map +1 -0
  72. package/dist/nodes/Liveblocks/operations/registry.d.ts +8 -0
  73. package/dist/nodes/Liveblocks/operations/registry.js +41 -0
  74. package/dist/nodes/Liveblocks/operations/registry.js.map +1 -0
  75. package/dist/nodes/Liveblocks/operations/requestAssembly.d.ts +14 -0
  76. package/dist/nodes/Liveblocks/operations/requestAssembly.js +913 -0
  77. package/dist/nodes/Liveblocks/operations/requestAssembly.js.map +1 -0
  78. package/dist/nodes/Liveblocks/operations/structuredFields.d.ts +2 -0
  79. package/dist/nodes/Liveblocks/operations/structuredFields.js +1138 -0
  80. package/dist/nodes/Liveblocks/operations/structuredFields.js.map +1 -0
  81. package/dist/nodes/Liveblocks/operations/types.d.ts +17 -0
  82. package/dist/nodes/Liveblocks/operations/types.js +3 -0
  83. package/dist/nodes/Liveblocks/operations/types.js.map +1 -0
  84. package/dist/nodes/Liveblocks/transport/configureClient.d.ts +1 -0
  85. package/dist/nodes/Liveblocks/transport/configureClient.js +14 -0
  86. package/dist/nodes/Liveblocks/transport/configureClient.js.map +1 -0
  87. package/dist/nodes/Liveblocks/utils/commentBodyEnrichment.d.ts +34 -0
  88. package/dist/nodes/Liveblocks/utils/commentBodyEnrichment.js +314 -0
  89. package/dist/nodes/Liveblocks/utils/commentBodyEnrichment.js.map +1 -0
  90. package/dist/package.json +62 -0
  91. package/dist/tsconfig.tsbuildinfo +1 -0
  92. package/package.json +60 -5
  93. package/index.js +0 -1
package/README.md ADDED
@@ -0,0 +1,97 @@
1
+ # Liveblocks Official n8n Nodes
2
+
3
+ This is the official Liveblocks [n8n](https://n8n.io/) node repository. These nodes cand ownload and modify room storage, interact with threads, comments, and attachments, send notifications and more in real-time.
4
+
5
+ - [Installation](#installation)
6
+ - [Operations](#operations)
7
+ - [Credentials](#credentials)
8
+ - [Compatibility](#compatibility)
9
+ - [Usage](#usage)
10
+ - [Resources](#resources)
11
+ - [Version history](#version-history)
12
+
13
+ ## Installation
14
+
15
+ Install this package as a [community node](https://docs.n8n.io/integrations/community-nodes/installation/) in your n8n instance. The npm package name is **`n8n-nodes-liveblocks`**.
16
+
17
+ In n8n, open **Settings → Community nodes**, enter `n8n-nodes-liveblocks`, and install. After installation, **Liveblocks** and **Liveblocks Trigger** appear in the node palette.
18
+
19
+ For local development of this repository, clone the project and use the [n8n node CLI](https://docs.n8n.io/integrations/creating-nodes/build/n8n-node-cli/) (`n8n-node dev`, `n8n-node build`) as described in the project’s contributor docs.
20
+
21
+ ## Operations
22
+
23
+ The package provides two nodes.
24
+
25
+ ### Liveblocks (action node)
26
+
27
+ Calls the [Liveblocks REST API](https://liveblocks.io/docs/api-reference/rest-api-endpoints). Choose a **resource**, then an **operation**. Operations map to the API (rooms, storage, Yjs, comments, inbox, webhooks-related server flows, etc.).
28
+
29
+ | Resource | What you can do (examples) |
30
+ | --- | --- |
31
+ | **Room** | List, create, update, delete, and upsert rooms; change room or organization IDs; prewarm; list active users; **set presence**; **broadcast** custom events to the room. |
32
+ | **Storage** | Get, initialize, patch (JSON Patch), or delete Liveblocks storage documents. |
33
+ | **Yjs** | Read Yjs state, send binary updates, list versions, and create or fetch specific versions. |
34
+ | **Thread** | CRUD threads; edit metadata; resolve/unresolve; subscribe/unsubscribe; list subscriptions and thread inbox notifications. |
35
+ | **Comment** | Create, read, edit, and delete comments; add/remove reactions; edit metadata. |
36
+ | **Attachment** | Download comment attachments (binary response when applicable). |
37
+ | **User** | Identify users for Liveblocks features that require user metadata. |
38
+ | **Inbox** | Inbox notifications, notification settings, room subscription settings, mark-as-read, and related triggers. |
39
+ | **Group** | Manage groups and membership; list a user’s groups. |
40
+ | **AI Copilot** | List, create, read, update, and delete AI copilot configurations. |
41
+ | **AI Knowledge** | Manage web and file knowledge sources, fetch markdown or links, and delete sources. |
42
+
43
+ The node builds requests from the fields you configure in the UI; some endpoints accept raw JSON for advanced bodies (for example JSON Patch or broadcast payloads). Refer to the [Liveblocks REST API reference](https://liveblocks.io/docs/api-reference/rest-api-endpoints) for request and response shapes.
44
+
45
+ ### Liveblocks Trigger (webhook)
46
+
47
+ Starts a workflow when Liveblocks sends a **webhook** to n8n. Configure the webhook URL from the trigger in your [Liveblocks dashboard](https://liveblocks.io/dashboard) webhook settings. You can filter by **event type** or leave the filter empty to receive all supported types.
48
+
49
+ Supported event filters include: `commentCreated`, `commentDeleted`, `commentEdited`, `notification`, `storageUpdated`, `threadCreated`, `threadDeleted`, `threadMetadataUpdated`, `userEntered`, `userLeft`, `yjsUpdate`. The trigger verifies the request using your **webhook signing secret** before running the workflow.
50
+
51
+ ## Credentials
52
+
53
+ ### Liveblocks API (required for the Liveblocks action node)
54
+
55
+ 1. Create or open a project in the [Liveblocks dashboard](https://liveblocks.io/dashboard).
56
+ 2. Copy the **secret key** (`sk_…`) from project settings.
57
+ 3. In n8n, create a credential of type **Liveblocks API** and paste the secret key.
58
+
59
+ The credential test calls the REST API (for example listing rooms) to confirm the key works.
60
+
61
+ ### Liveblocks Webhook Signing Secret (required for Liveblocks Trigger)
62
+
63
+ 1. In the Liveblocks dashboard, open your project’s **webhook** configuration and copy the **signing secret** (`whsec_…`).
64
+ 2. In n8n, create a credential of type **Liveblocks Webhook Signing Secret API** and paste that value.
65
+
66
+ This secret is only used to verify incoming webhook signatures; it is not validated with a live HTTP test in the credentials UI.
67
+
68
+ ## Compatibility
69
+
70
+ - This package declares **`n8nNodesApiVersion` 1** in `package.json`, in line with current n8n community node conventions.
71
+ - It lists **`n8n-workflow`** as a peer dependency (version resolved by your n8n install).
72
+
73
+ Use a [current n8n release](https://docs.n8n.io/release-notes/) that supports community nodes and API version 1. If you hit a compatibility issue, report it with your n8n version and this package version.
74
+
75
+ ## Usage
76
+
77
+ - **Action node**: Add **Liveblocks**, select **resource** and **operation**, then fill the parameters. Map data from previous nodes into room IDs, user IDs, and bodies as needed. Use **Execute step** while designing to inspect API responses and errors.
78
+ - **Trigger**: Add **Liveblocks Trigger**, set credentials, copy the **webhook URL** into the Liveblocks dashboard, and choose which events to listen for. Use n8n’s test URL while building, then switch to the production URL when the workflow is active.
79
+ - **Errors**: Failed API calls surface as n8n errors with HTTP status and message when the API returns them. If webhooks fail verification, check that the signing secret matches the project and that the request is actually from Liveblocks.
80
+
81
+ New to n8n? See [Try it out](https://docs.n8n.io/try-it-out/) in the n8n docs.
82
+
83
+ ## Resources
84
+
85
+ - [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
86
+ - [Liveblocks documentation](https://liveblocks.io/docs)
87
+ - [Liveblocks REST API reference](https://liveblocks.io/docs/api-reference/rest-api-endpoints)
88
+ - [Liveblocks webhooks](https://liveblocks.io/docs/platform/webhooks)
89
+ - [Liveblocks dashboard](https://liveblocks.io/dashboard)
90
+
91
+ ## Version history
92
+
93
+ | Version | Notes |
94
+ | --- | --- |
95
+ | **0.1.0** | Initial published release: **Liveblocks** action node (REST API operations) and **Liveblocks Trigger** (signed webhooks). |
96
+
97
+ Future releases will be noted here and in the repository changelog when present.
@@ -0,0 +1,9 @@
1
+ import type { ICredentialType, INodeProperties, ICredentialTestRequest } from 'n8n-workflow';
2
+ export declare class LiveblocksApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ icon: "file:liveblocks.svg";
7
+ properties: INodeProperties[];
8
+ test: ICredentialTestRequest;
9
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LiveblocksApi = void 0;
4
+ class LiveblocksApi {
5
+ constructor() {
6
+ this.name = 'liveblocksApi';
7
+ this.displayName = 'Liveblocks API';
8
+ this.documentationUrl = 'https://liveblocks.io/docs/api-reference/rest-api-endpoints';
9
+ this.icon = 'file:liveblocks.svg';
10
+ this.properties = [
11
+ {
12
+ displayName: 'Secret Key',
13
+ name: 'secretKey',
14
+ type: 'string',
15
+ typeOptions: { password: true },
16
+ default: '',
17
+ required: true,
18
+ description: 'The secret key from your Liveblocks project. You can find this in your project settings at https://liveblocks.io/dashboard',
19
+ placeholder: 'sk_...',
20
+ },
21
+ ];
22
+ this.test = {
23
+ request: {
24
+ baseURL: 'https://api.liveblocks.io/v2',
25
+ url: '/rooms',
26
+ method: 'GET',
27
+ headers: {
28
+ Authorization: '=Bearer {{$credentials.secretKey}}',
29
+ },
30
+ },
31
+ };
32
+ }
33
+ }
34
+ exports.LiveblocksApi = LiveblocksApi;
35
+ //# sourceMappingURL=LiveblocksApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LiveblocksApi.credentials.js","sourceRoot":"","sources":["../../credentials/LiveblocksApi.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,aAAa;IAA1B;QACC,SAAI,GAAG,eAAe,CAAC;QACvB,gBAAW,GAAG,gBAAgB,CAAC;QAC/B,qBAAgB,GAAG,6DAA6D,CAAC;QACjF,SAAI,GAAG,qBAA8B,CAAC;QACtC,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EACV,4HAA4H;gBAC7H,WAAW,EAAE,QAAQ;aACrB;SACD,CAAC;QAGF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,8BAA8B;gBACvC,GAAG,EAAE,QAAQ;gBACb,MAAM,EAAE,KAAK;gBACb,OAAO,EAAE;oBACR,aAAa,EAAE,oCAAoC;iBACnD;aACD;SACD,CAAC;IACH,CAAC;CAAA;AA9BD,sCA8BC"}
@@ -0,0 +1,8 @@
1
+ import type { ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class LiveblocksWebhookSigningSecretApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ icon: "file:liveblocks.svg";
7
+ properties: INodeProperties[];
8
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LiveblocksWebhookSigningSecretApi = void 0;
4
+ class LiveblocksWebhookSigningSecretApi {
5
+ constructor() {
6
+ this.name = 'liveblocksWebhookSigningSecretApi';
7
+ this.displayName = 'Liveblocks Webhook Signing Secret API';
8
+ this.documentationUrl = 'https://liveblocks.io/docs/platform/webhooks';
9
+ this.icon = 'file:liveblocks.svg';
10
+ this.properties = [
11
+ {
12
+ displayName: 'Webhook Signing Secret',
13
+ name: 'webhookSigningSecret',
14
+ type: 'string',
15
+ typeOptions: { password: true },
16
+ default: '',
17
+ required: true,
18
+ description: "The webhook signing secret from your Liveblocks project. You can find this in your project's webhook settings at https://liveblocks.io/dashboard",
19
+ placeholder: 'whsec_...',
20
+ },
21
+ ];
22
+ }
23
+ }
24
+ exports.LiveblocksWebhookSigningSecretApi = LiveblocksWebhookSigningSecretApi;
25
+ //# sourceMappingURL=LiveblocksWebhookSigningSecretApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LiveblocksWebhookSigningSecretApi.credentials.js","sourceRoot":"","sources":["../../credentials/LiveblocksWebhookSigningSecretApi.credentials.ts"],"names":[],"mappings":";;;AAGA,MAAa,iCAAiC;IAA9C;QACC,SAAI,GAAG,mCAAmC,CAAC;QAC3C,gBAAW,GAAG,uCAAuC,CAAC;QACtD,qBAAgB,GAAG,8CAA8C,CAAC;QAClE,SAAI,GAAG,qBAA8B,CAAC;QACtC,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,wBAAwB;gBACrC,IAAI,EAAE,sBAAsB;gBAC5B,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EACV,kJAAkJ;gBACnJ,WAAW,EAAE,WAAW;aACxB;SACD,CAAC;IAIH,CAAC;CAAA;AArBD,8EAqBC"}
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="400" height="400" fill="none" viewBox="0 0 400 400"><g clip-path="url(#a)"><path fill="#fff" d="M400 0H0v400h400z"/><path fill="#000" fill-rule="evenodd" d="M260 107H31l67.852 67.789V268zM141 293h228l-67.556-67.789V132z" clip-rule="evenodd"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h400v400H0z"/></clipPath></defs></svg>
@@ -0,0 +1,5 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class Liveblocks implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
@@ -0,0 +1,365 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Liveblocks = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const registry_1 = require("./operations/registry");
6
+ const properties_1 = require("./operations/properties");
7
+ const requestAssembly_1 = require("./operations/requestAssembly");
8
+ const configureClient_1 = require("./transport/configureClient");
9
+ const commentBodyEnrichment_1 = require("./utils/commentBodyEnrichment");
10
+ function liveblocksErrorToNodePayload(error, response) {
11
+ const httpCode = (response === null || response === void 0 ? void 0 : response.status) !== undefined ? String(response.status) : undefined;
12
+ if (error && typeof error === 'object' && !Array.isArray(error)) {
13
+ const e = error;
14
+ if (Object.keys(e).length === 0) {
15
+ return {
16
+ message: httpCode ? `HTTP ${httpCode}` : 'Request failed',
17
+ ...(httpCode ? { httpCode } : {}),
18
+ };
19
+ }
20
+ const msg = typeof e.message === 'string' && e.message.trim()
21
+ ? e.message
22
+ : typeof e.error === 'string'
23
+ ? e.error
24
+ : httpCode
25
+ ? `HTTP ${httpCode}`
26
+ : 'Request failed';
27
+ return { ...e, message: msg, ...(httpCode ? { httpCode } : {}) };
28
+ }
29
+ if (typeof error === 'string') {
30
+ const msg = error.trim() || (httpCode ? `HTTP ${httpCode}` : 'Request failed');
31
+ return { message: msg, ...(httpCode ? { httpCode } : {}) };
32
+ }
33
+ return {
34
+ message: httpCode ? `HTTP ${httpCode}` : 'Request failed',
35
+ ...(httpCode ? { httpCode } : {}),
36
+ };
37
+ }
38
+ function isResponseLike(obj) {
39
+ return (obj !== null &&
40
+ typeof obj === 'object' &&
41
+ typeof obj.status === 'number' &&
42
+ typeof obj.clone === 'function');
43
+ }
44
+ function isRequestLike(obj) {
45
+ return (obj !== null &&
46
+ typeof obj === 'object' &&
47
+ typeof obj.url === 'string' &&
48
+ typeof obj.method === 'string' &&
49
+ typeof obj.headers === 'object');
50
+ }
51
+ function redactHeaders(headers) {
52
+ const out = {};
53
+ headers.forEach((value, key) => {
54
+ out[key] = key.toLowerCase() === 'authorization' ? '[redacted]' : value;
55
+ });
56
+ return out;
57
+ }
58
+ function serializeBodyForDebug(body) {
59
+ if (body === undefined)
60
+ return undefined;
61
+ if (body instanceof Blob) {
62
+ return `[binary blob, ${body.size} bytes]`;
63
+ }
64
+ if (typeof body === 'string') {
65
+ return body.length > 8000 ? `${body.slice(0, 8000)}…` : body;
66
+ }
67
+ try {
68
+ return JSON.stringify(body, null, 2);
69
+ }
70
+ catch {
71
+ return String(body);
72
+ }
73
+ }
74
+ function formatPartialCallOptsDebug(opts) {
75
+ if (!opts)
76
+ return undefined;
77
+ const lines = [];
78
+ if (opts.path)
79
+ lines.push(`path: ${JSON.stringify(opts.path)}`);
80
+ if (opts.query)
81
+ lines.push(`query: ${JSON.stringify(opts.query)}`);
82
+ const bodyStr = serializeBodyForDebug(opts.body);
83
+ if (bodyStr !== undefined)
84
+ lines.push(`body: ${bodyStr}`);
85
+ return lines.length ? lines.join('\n') : undefined;
86
+ }
87
+ async function buildLiveblocksRequestDebug(envelope, callOpts) {
88
+ const parts = [];
89
+ parts.push(`${envelope.request.method} ${envelope.request.url}`);
90
+ parts.push('Request headers:');
91
+ parts.push(JSON.stringify(redactHeaders(envelope.request.headers), null, 2));
92
+ const bodyStr = serializeBodyForDebug(callOpts.body);
93
+ if (bodyStr !== undefined) {
94
+ parts.push('Request body:');
95
+ parts.push(bodyStr);
96
+ }
97
+ try {
98
+ const text = await envelope.response.clone().text();
99
+ if (text) {
100
+ parts.push('Response body:');
101
+ parts.push(text.length > 8000 ? `${text.slice(0, 8000)}…` : text);
102
+ }
103
+ }
104
+ catch {
105
+ }
106
+ return parts.join('\n');
107
+ }
108
+ function isSdkFieldsErrorEnvelope(raw) {
109
+ if (!raw || typeof raw !== 'object' || Array.isArray(raw))
110
+ return false;
111
+ const o = raw;
112
+ return ('error' in o &&
113
+ o.error !== undefined &&
114
+ 'response' in o &&
115
+ isResponseLike(o.response) &&
116
+ 'request' in o &&
117
+ isRequestLike(o.request));
118
+ }
119
+ function unwrapSdkResult(raw, spec) {
120
+ if (spec.responseMode === 'binaryDownload') {
121
+ return raw;
122
+ }
123
+ if (raw && typeof raw === 'object' && 'data' in raw && 'response' in raw) {
124
+ return raw.data;
125
+ }
126
+ return raw;
127
+ }
128
+ class Liveblocks {
129
+ constructor() {
130
+ this.description = {
131
+ displayName: 'Liveblocks',
132
+ name: 'liveblocks',
133
+ icon: {
134
+ light: 'file:liveblocks.svg',
135
+ dark: 'file:liveblocks.dark.svg',
136
+ },
137
+ group: ['transform'],
138
+ version: [1],
139
+ subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
140
+ description: 'Call the Liveblocks REST API (rooms, comments, Yjs, AI, and more)',
141
+ defaults: {
142
+ name: 'Liveblocks',
143
+ },
144
+ credentials: [
145
+ {
146
+ name: 'liveblocksApi',
147
+ required: true,
148
+ },
149
+ ],
150
+ inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
151
+ outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
152
+ usableAsTool: true,
153
+ properties: (0, properties_1.buildLiveblocksProperties)(),
154
+ };
155
+ }
156
+ async execute() {
157
+ const items = this.getInputData();
158
+ const returnData = [];
159
+ const credentials = await this.getCredentials('liveblocksApi');
160
+ const secretKey = credentials.secretKey;
161
+ if (!secretKey) {
162
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Liveblocks secret key is required');
163
+ }
164
+ (0, configureClient_1.configureLiveblocksClient)(secretKey);
165
+ for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
166
+ let lastCallOpts;
167
+ try {
168
+ const resource = this.getNodeParameter('resource', itemIndex);
169
+ const operation = this.getNodeParameter('operation', itemIndex);
170
+ const spec = registry_1.OPERATION_MAP.get(operation);
171
+ if (!spec) {
172
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation: ${operation}`);
173
+ }
174
+ if (spec.resource !== resource) {
175
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Operation ${operation} does not belong to resource ${resource}`);
176
+ }
177
+ const path = {};
178
+ for (const key of spec.pathParams) {
179
+ const v = this.getNodeParameter(key, itemIndex, '');
180
+ if (!v || String(v).trim() === '') {
181
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Required path parameter missing: ${key}`, { itemIndex });
182
+ }
183
+ path[key] = String(v).trim();
184
+ }
185
+ const getParam = (name, defaultValue) => this.getNodeParameter(name, itemIndex, defaultValue);
186
+ let query;
187
+ try {
188
+ query = spec.supportsQuery ? (0, requestAssembly_1.assembleQuery)(operation, getParam) : undefined;
189
+ }
190
+ catch (e) {
191
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), e instanceof Error ? e.message : 'Invalid query parameters', { itemIndex });
192
+ }
193
+ let body;
194
+ if (spec.bodyMode === 'binaryUpload') {
195
+ body = undefined;
196
+ }
197
+ else if (spec.bodyMode === 'none') {
198
+ body = undefined;
199
+ }
200
+ else {
201
+ try {
202
+ body = (0, requestAssembly_1.assembleBody)(operation, spec.bodyMode, getParam);
203
+ }
204
+ catch (e) {
205
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), e instanceof Error ? e.message : 'Invalid request body', { itemIndex });
206
+ }
207
+ if (spec.bodyMode === 'json') {
208
+ if (body === undefined ||
209
+ body === null ||
210
+ (typeof body === 'object' && !Array.isArray(body) && (0, requestAssembly_1.isEmptyObject)(body))) {
211
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Body is required for this operation', {
212
+ itemIndex,
213
+ });
214
+ }
215
+ }
216
+ if (spec.bodyMode === 'optionalJson') {
217
+ if (body !== undefined &&
218
+ typeof body === 'object' &&
219
+ !Array.isArray(body) &&
220
+ (0, requestAssembly_1.isEmptyObject)(body)) {
221
+ body = undefined;
222
+ }
223
+ }
224
+ }
225
+ const callOpts = {
226
+ throwOnError: spec.responseMode === 'binaryDownload',
227
+ };
228
+ if (Object.keys(path).length > 0) {
229
+ callOpts.path = path;
230
+ }
231
+ if (query !== undefined) {
232
+ callOpts.query = query;
233
+ }
234
+ if (spec.bodyMode === 'binaryUpload') {
235
+ const binField = this.getNodeParameter('binaryPropertyName', itemIndex, 'data');
236
+ const buf = await this.helpers.getBinaryDataBuffer(itemIndex, binField);
237
+ callOpts.body = new Blob([new Uint8Array(buf)]);
238
+ }
239
+ else if (body !== undefined) {
240
+ callOpts.body = body;
241
+ }
242
+ if (operation === 'createWebKnowledgeSource' && callOpts.body && path.copilotId) {
243
+ callOpts.body.copilotId = path.copilotId;
244
+ }
245
+ if (spec.responseMode === 'binaryDownload') {
246
+ callOpts.parseAs = 'arrayBuffer';
247
+ callOpts.responseStyle = 'data';
248
+ }
249
+ const includeRequestInError = this.getNodeParameter('includeRequestInError', itemIndex, false);
250
+ lastCallOpts = callOpts;
251
+ const rawResult = await spec.run(callOpts);
252
+ if (spec.responseMode !== 'binaryDownload' && isSdkFieldsErrorEnvelope(rawResult)) {
253
+ let errorDescription;
254
+ if (includeRequestInError) {
255
+ errorDescription = await buildLiveblocksRequestDebug(rawResult, callOpts);
256
+ }
257
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), liveblocksErrorToNodePayload(rawResult.error, rawResult.response), {
258
+ itemIndex,
259
+ httpCode: String(rawResult.response.status),
260
+ description: errorDescription,
261
+ });
262
+ }
263
+ const unwrapped = unwrapSdkResult(rawResult, spec);
264
+ const jsonPayload = (0, commentBodyEnrichment_1.enrichLiveblocksJson)(operation, unwrapped);
265
+ if (spec.responseMode === 'binaryDownload') {
266
+ const ab = unwrapped;
267
+ if (!(ab instanceof ArrayBuffer)) {
268
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Expected binary response body', {
269
+ itemIndex,
270
+ });
271
+ }
272
+ const buffer = Buffer.from(ab);
273
+ const prop = this.getNodeParameter('binaryOutputProperty', itemIndex, 'data');
274
+ const fileName = this.getNodeParameter('binaryOutputFileName', itemIndex, 'liveblocks.bin');
275
+ const mime = this.getNodeParameter('binaryMimeType', itemIndex, 'application/octet-stream');
276
+ const binary = await this.helpers.prepareBinaryData(buffer, mime, fileName);
277
+ returnData.push({
278
+ json: { fileName, mimeType: mime, fileSize: buffer.length },
279
+ binary: { [prop]: binary },
280
+ pairedItem: { item: itemIndex },
281
+ });
282
+ continue;
283
+ }
284
+ if (spec.responseMode === 'empty') {
285
+ const emptyJson = unwrapped !== undefined && unwrapped !== null && typeof unwrapped === 'object'
286
+ ? JSON.parse(JSON.stringify(unwrapped))
287
+ : {};
288
+ returnData.push({
289
+ json: emptyJson,
290
+ pairedItem: { item: itemIndex },
291
+ });
292
+ continue;
293
+ }
294
+ const splitIntoItems = spec.splitArrayPath
295
+ ? this.getNodeParameter('splitIntoItems', itemIndex, true)
296
+ : false;
297
+ const splitKey = spec.splitArrayPath;
298
+ if (splitIntoItems &&
299
+ splitKey &&
300
+ jsonPayload &&
301
+ typeof jsonPayload === 'object' &&
302
+ !Array.isArray(jsonPayload)) {
303
+ const row = jsonPayload;
304
+ const arr = row[splitKey];
305
+ const nextCursor = row.nextCursor;
306
+ if (Array.isArray(arr)) {
307
+ if (arr.length === 0) {
308
+ returnData.push({
309
+ json: { data: [], nextCursor: nextCursor !== null && nextCursor !== void 0 ? nextCursor : null },
310
+ pairedItem: { item: itemIndex },
311
+ });
312
+ continue;
313
+ }
314
+ for (const el of arr) {
315
+ const json = el !== null && typeof el === 'object' && !Array.isArray(el)
316
+ ? {
317
+ ...JSON.parse(JSON.stringify(el)),
318
+ nextCursor: nextCursor !== null && nextCursor !== void 0 ? nextCursor : null,
319
+ }
320
+ : { value: el, nextCursor: nextCursor !== null && nextCursor !== void 0 ? nextCursor : null };
321
+ returnData.push({
322
+ json,
323
+ pairedItem: { item: itemIndex },
324
+ });
325
+ }
326
+ continue;
327
+ }
328
+ }
329
+ const outJson = jsonPayload !== null && typeof jsonPayload === 'object'
330
+ ? JSON.parse(JSON.stringify(jsonPayload))
331
+ : { value: jsonPayload };
332
+ returnData.push({
333
+ json: outJson,
334
+ pairedItem: { item: itemIndex },
335
+ });
336
+ }
337
+ catch (error) {
338
+ if (this.continueOnFail()) {
339
+ returnData.push({
340
+ json: { error: error instanceof Error ? error.message : String(error) },
341
+ pairedItem: { item: itemIndex },
342
+ });
343
+ continue;
344
+ }
345
+ if (error instanceof n8n_workflow_1.NodeOperationError || error instanceof n8n_workflow_1.NodeApiError) {
346
+ if (error.context && typeof error.context === 'object') {
347
+ error.context.itemIndex = itemIndex;
348
+ }
349
+ throw error;
350
+ }
351
+ const includeRequestInError = this.getNodeParameter('includeRequestInError', itemIndex, false);
352
+ const partialDebug = includeRequestInError
353
+ ? formatPartialCallOptsDebug(lastCallOpts)
354
+ : undefined;
355
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), liveblocksErrorToNodePayload(error), {
356
+ itemIndex,
357
+ ...(partialDebug ? { description: partialDebug } : {}),
358
+ });
359
+ }
360
+ }
361
+ return [returnData];
362
+ }
363
+ }
364
+ exports.Liveblocks = Liveblocks;
365
+ //# sourceMappingURL=Liveblocks.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Liveblocks.node.js","sourceRoot":"","sources":["../../../nodes/Liveblocks/Liveblocks.node.ts"],"names":[],"mappings":";;;AAQA,+CAAqF;AAErF,oDAAsD;AACtD,wDAAoE;AAEpE,kEAA0F;AAC1F,iEAAwE;AACxE,yEAAqE;AAGrE,SAAS,4BAA4B,CAAC,KAAc,EAAE,QAAmB;IACxE,MAAM,QAAQ,GAAG,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,MAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEtF,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACjE,MAAM,CAAC,GAAG,KAAgC,CAAC;QAC3C,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,C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C,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;wBACvE,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;qBAC/B,CAAC,CAAC;oBACH,SAAS;gBACV,CAAC;gBACD,IAAI,KAAK,YAAY,iCAAkB,IAAI,KAAK,YAAY,2BAAY,EAAE,CAAC;oBAC1E,IAAI,KAAK,CAAC,OAAO,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;wBACvD,KAAK,CAAC,OAAmC,CAAC,SAAS,GAAG,SAAS,CAAC;oBAClE,CAAC;oBACD,MAAM,KAAK,CAAC;gBACb,CAAC;gBACD,MAAM,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,CAClD,uBAAuB,EACvB,SAAS,EACT,KAAK,CACM,CAAC;gBACb,MAAM,YAAY,GAAG,qBAAqB;oBACzC,CAAC,CAAC,0BAA0B,CAAC,YAAY,CAAC;oBAC1C,CAAC,CAAC,SAAS,CAAC;gBACb,MAAM,IAAI,2BAAY,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,4BAA4B,CAAC,KAAK,CAAC,EAAE;oBAC3E,SAAS;oBACT,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;iBACtD,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AAxSD,gCAwSC"}
@@ -0,0 +1,28 @@
1
+ {
2
+ "node": "n8n-nodes-liveblocks",
3
+ "nodeVersion": "1.0",
4
+ "codexVersion": "1.0",
5
+ "categories": ["Development", "Developer Tools"],
6
+ "resources": {
7
+ "credentialDocumentation": [
8
+ {
9
+ "url": "https://liveblocks.io/docs/api-reference/rest-api-endpoints#Auth"
10
+ }
11
+ ],
12
+ "primaryDocumentation": [
13
+ {
14
+ "url": "https://liveblocks.io/docs/"
15
+ }
16
+ ]
17
+ },
18
+ "alias": [
19
+ "liveblocks",
20
+ "collaboration",
21
+ "realtime",
22
+ "storage",
23
+ "yjs",
24
+ "hitl",
25
+ "comments",
26
+ "notifications"
27
+ ]
28
+ }
@@ -0,0 +1,5 @@
1
+ import type { IWebhookFunctions, INodeType, INodeTypeDescription, IWebhookResponseData } from 'n8n-workflow';
2
+ export declare class LiveblocksTrigger implements INodeType {
3
+ description: INodeTypeDescription;
4
+ webhook(this: IWebhookFunctions): Promise<IWebhookResponseData>;
5
+ }