n8n-nodes-pocketbase 2.3.63 → 2.3.64
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 +1 -1
- package/dist/nodes/Common/LoadOptions.d.ts +1 -0
- package/dist/nodes/Common/LoadOptions.js +43 -16
- package/dist/nodes/Common/LoadOptions.js.map +1 -1
- package/dist/package.json +2 -2
- package/dist/tests/LoadOptions.spec.d.ts +1 -0
- package/dist/tests/LoadOptions.spec.js +136 -0
- package/dist/tests/LoadOptions.spec.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -49,7 +49,7 @@ Alternatively, you can use your administrator account and the "\_superusers" col
|
|
|
49
49
|
- **PocketBase 0.23.0 or newer.** The node signs in through the `_superusers` collection, which PocketBase introduced in 0.23.0.
|
|
50
50
|
- **n8n 1.85.0 or newer.** Older versions can't load the node, because it uses `NodeConnectionTypes`, which n8n added in 1.85.0.
|
|
51
51
|
|
|
52
|
-
When a new n8n or PocketBase version comes out, a nightly job runs the integration tests against it and releases an update once they pass. Last tested with n8n 2.44.6 and PocketBase 0.40.
|
|
52
|
+
When a new n8n or PocketBase version comes out, a nightly job runs the integration tests against it and releases an update once they pass. Last tested with n8n 2.44.6 and PocketBase 0.40.6.
|
|
53
53
|
|
|
54
54
|
## Development
|
|
55
55
|
|
|
@@ -20,6 +20,7 @@ export interface PocketBaseField {
|
|
|
20
20
|
collectionId?: string;
|
|
21
21
|
minSelect?: number;
|
|
22
22
|
}
|
|
23
|
+
export declare function _resetCollectionTypeCacheForTesting(): void;
|
|
23
24
|
export declare const LoadOptions: {
|
|
24
25
|
getCollections(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
25
26
|
getFields(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
@@ -1,7 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LoadOptions = void 0;
|
|
4
|
+
exports._resetCollectionTypeCacheForTesting = _resetCollectionTypeCacheForTesting;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
4
6
|
const GenericFunctions_1 = require("./GenericFunctions");
|
|
7
|
+
const collectionTypes = new Map();
|
|
8
|
+
function _resetCollectionTypeCacheForTesting() {
|
|
9
|
+
collectionTypes.clear();
|
|
10
|
+
}
|
|
11
|
+
function collectionKey(url, collection) {
|
|
12
|
+
return `${url}::${collection}`;
|
|
13
|
+
}
|
|
14
|
+
async function fetchCollection(url, token, collection) {
|
|
15
|
+
const result = (await this.helpers.httpRequest({
|
|
16
|
+
url: `${url}/api/collections/${collection}`,
|
|
17
|
+
method: "GET",
|
|
18
|
+
headers: { Authorization: token },
|
|
19
|
+
}));
|
|
20
|
+
collectionTypes.set(collectionKey(url, collection), result.type);
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
async function getCollectionType(url, token, collection) {
|
|
24
|
+
var _a;
|
|
25
|
+
return ((_a = collectionTypes.get(collectionKey(url, collection))) !== null && _a !== void 0 ? _a : (await fetchCollection.call(this, url, token, collection)).type);
|
|
26
|
+
}
|
|
5
27
|
async function loadPocketBaseFields(collectionName = null) {
|
|
6
28
|
const credentials = await this.getCredentials("pocketbaseHttpApi");
|
|
7
29
|
const normalizedUrl = credentials.url.replace(/\/$/, "");
|
|
@@ -9,11 +31,7 @@ async function loadPocketBaseFields(collectionName = null) {
|
|
|
9
31
|
? collectionName
|
|
10
32
|
: this.getNodeParameter("resource");
|
|
11
33
|
const token = await (0, GenericFunctions_1.fetchPocketbaseToken)((opts) => this.helpers.httpRequest(opts), normalizedUrl, credentials.username, credentials.password);
|
|
12
|
-
const { fields } =
|
|
13
|
-
url: `${normalizedUrl}/api/collections/${resource}`,
|
|
14
|
-
method: "GET",
|
|
15
|
-
headers: { Authorization: token },
|
|
16
|
-
}));
|
|
34
|
+
const { fields } = await fetchCollection.call(this, normalizedUrl, token, resource);
|
|
17
35
|
return fields;
|
|
18
36
|
}
|
|
19
37
|
function getRecordLabel(id, data) {
|
|
@@ -51,6 +69,7 @@ exports.LoadOptions = {
|
|
|
51
69
|
totalPages = pageTotalPages;
|
|
52
70
|
page++;
|
|
53
71
|
} while (page <= totalPages);
|
|
72
|
+
items.forEach(({ name, type }) => collectionTypes.set(collectionKey(normalizedUrl, name), type));
|
|
54
73
|
return items.map(({ name }) => ({ name, value: name }));
|
|
55
74
|
},
|
|
56
75
|
async getFields() {
|
|
@@ -95,21 +114,29 @@ exports.LoadOptions = {
|
|
|
95
114
|
const normalizedUrl = credentials.url.replace(/\/$/, "");
|
|
96
115
|
const resource = this.getNodeParameter("resource");
|
|
97
116
|
const token = await (0, GenericFunctions_1.fetchPocketbaseToken)((opts) => this.helpers.httpRequest(opts), normalizedUrl, credentials.username, credentials.password);
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
let totalPages = 1;
|
|
101
|
-
const maxPages = 5;
|
|
102
|
-
do {
|
|
103
|
-
const { items: pageItems, totalPages: pageTotalPages } = (await this.helpers.httpRequest({
|
|
117
|
+
const listRecords = async (type) => {
|
|
118
|
+
const { items } = (await this.helpers.httpRequest({
|
|
104
119
|
url: `${normalizedUrl}/api/collections/${resource}/records`,
|
|
105
120
|
method: "GET",
|
|
106
|
-
qs: { sort: "
|
|
121
|
+
qs: { ...(type === "view" ? {} : { sort: "-@rowid" }), perPage: 250, skipTotal: true },
|
|
107
122
|
headers: { Authorization: token },
|
|
108
123
|
}));
|
|
109
|
-
items
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
124
|
+
return items;
|
|
125
|
+
};
|
|
126
|
+
const type = await getCollectionType.call(this, normalizedUrl, token, resource);
|
|
127
|
+
let items;
|
|
128
|
+
try {
|
|
129
|
+
items = await listRecords(type);
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
const currentType = await fetchCollection.call(this, normalizedUrl, token, resource).then((collection) => collection.type, () => type);
|
|
133
|
+
if (currentType === type) {
|
|
134
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
|
|
135
|
+
}
|
|
136
|
+
items = await listRecords(currentType).catch((retryError) => {
|
|
137
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), retryError);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
113
140
|
if (items.length === 0) {
|
|
114
141
|
return [
|
|
115
142
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadOptions.js","sourceRoot":"","sources":["../../../nodes/Common/LoadOptions.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"LoadOptions.js","sourceRoot":"","sources":["../../../nodes/Common/LoadOptions.ts"],"names":[],"mappings":";;;AAuCA,kFAEC;AAzCD,+CAA4C;AAO5C,yDAA0D;AA8B1D,MAAM,eAAe,GAAG,IAAI,GAAG,EAAkB,CAAC;AAElD,SAAgB,mCAAmC;IACjD,eAAe,CAAC,KAAK,EAAE,CAAC;AAC1B,CAAC;AAED,SAAS,aAAa,CAAC,GAAW,EAAE,UAAkB;IACpD,OAAO,GAAG,GAAG,KAAK,UAAU,EAAE,CAAC;AACjC,CAAC;AAED,KAAK,UAAU,eAAe,CAE5B,GAAW,EACX,KAAa,EACb,UAAkB;IAElB,MAAM,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;QAC7C,GAAG,EAAE,GAAG,GAAG,oBAAoB,UAAU,EAAE;QAC3C,MAAM,EAAE,KAAK;QACb,OAAO,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE;KAClC,CAAC,CAAyB,CAAC;IAC5B,eAAe,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IACjE,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,KAAK,UAAU,iBAAiB,CAE9B,GAAW,EACX,KAAa,EACb,UAAkB;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,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,OAAO;gBACL;oBACE,IAAI,EAAE,kBAAkB;oBACxB,KAAK,EAAE,EAAE;iBACV;aACF,CAAC;QACJ,CAAC;QAED,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACrB,MAAM,EAAE,GAAG,IAAI,CAAC,EAAY,CAAC;YAC7B,UAAU,CAAC,IAAI,CAAC;gBACd,IAAI,EAAE,cAAc,CAAC,EAAE,EAAE,IAAI,CAAC;gBAC9B,KAAK,EAAE,EAAE;aACV,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,UAAU,CAAC;IACpB,CAAC;CACF,CAAC"}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-pocketbase",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.64",
|
|
4
4
|
"description": "Interact with your PocketBase instance",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node-package"
|
|
@@ -61,6 +61,6 @@
|
|
|
61
61
|
"dist/nodes/PocketbaseTrigger/PocketbaseTrigger.node.js"
|
|
62
62
|
]
|
|
63
63
|
},
|
|
64
|
-
"pocketbaseVersion": "0.40.
|
|
64
|
+
"pocketbaseVersion": "0.40.6",
|
|
65
65
|
"n8nWorkflowVersion": "2.44.2"
|
|
66
66
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const vitest_1 = require("vitest");
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const LoadOptions_1 = require("../nodes/Common/LoadOptions");
|
|
6
|
+
const GenericFunctions_1 = require("../nodes/Common/GenericFunctions");
|
|
7
|
+
(0, vitest_1.describe)("LoadOptions.getRows", () => {
|
|
8
|
+
let httpRequest;
|
|
9
|
+
let context;
|
|
10
|
+
let collectionTypes;
|
|
11
|
+
(0, vitest_1.beforeEach)(() => {
|
|
12
|
+
(0, GenericFunctions_1._resetTokenCacheForTesting)();
|
|
13
|
+
(0, LoadOptions_1._resetCollectionTypeCacheForTesting)();
|
|
14
|
+
collectionTypes = { posts: "base", posts_view: "view" };
|
|
15
|
+
httpRequest = vitest_1.vi.fn();
|
|
16
|
+
httpRequest.mockImplementation(async (options) => {
|
|
17
|
+
if (options.method === "POST")
|
|
18
|
+
return { token: "token" };
|
|
19
|
+
if (options.url.endsWith("/api/collections")) {
|
|
20
|
+
return {
|
|
21
|
+
totalPages: 1,
|
|
22
|
+
items: Object.entries(collectionTypes).map(([name, type]) => ({ name, type })),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const collection = options.url.match(/\/api\/collections\/([^/]+)/)[1];
|
|
26
|
+
if (options.url.endsWith("/records")) {
|
|
27
|
+
return { items: [{ id: "abc", name: `Latest in ${collection}` }] };
|
|
28
|
+
}
|
|
29
|
+
return { name: collection, type: collectionTypes[collection], fields: [] };
|
|
30
|
+
});
|
|
31
|
+
context = {
|
|
32
|
+
getCredentials: vitest_1.vi.fn().mockResolvedValue({
|
|
33
|
+
url: "http://localhost:8090/",
|
|
34
|
+
username: "admin@example.com",
|
|
35
|
+
password: "password123",
|
|
36
|
+
}),
|
|
37
|
+
getNodeParameter: vitest_1.vi.fn().mockReturnValue("posts"),
|
|
38
|
+
getNode: vitest_1.vi.fn().mockReturnValue({ name: "Pocketbase HTTP", type: "pocketbaseHttp" }),
|
|
39
|
+
helpers: { httpRequest },
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
const requestsTo = (pattern) => httpRequest.mock.calls
|
|
43
|
+
.map(([options]) => options)
|
|
44
|
+
.filter((options) => pattern.test(options.url));
|
|
45
|
+
(0, vitest_1.it)("loads the 250 most recent records in a single request without counting", async () => {
|
|
46
|
+
const options = await LoadOptions_1.LoadOptions.getRows.call(context);
|
|
47
|
+
(0, vitest_1.expect)(options).toEqual([{ name: "Latest in posts", value: "abc" }]);
|
|
48
|
+
(0, vitest_1.expect)(requestsTo(/\/records$/)).toHaveLength(1);
|
|
49
|
+
(0, vitest_1.expect)(requestsTo(/\/records$/)[0].qs).toEqual({
|
|
50
|
+
sort: "-@rowid",
|
|
51
|
+
perPage: 250,
|
|
52
|
+
skipTotal: true,
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
(0, vitest_1.it)("doesn't sort view collections, which can't be sorted by rowid", async () => {
|
|
56
|
+
vitest_1.vi.mocked(context.getNodeParameter).mockReturnValue("posts_view");
|
|
57
|
+
await LoadOptions_1.LoadOptions.getRows.call(context);
|
|
58
|
+
(0, vitest_1.expect)(requestsTo(/\/records$/)[0].qs).toEqual({ perPage: 250, skipTotal: true });
|
|
59
|
+
});
|
|
60
|
+
(0, vitest_1.it)("looks up a collection's type only once", async () => {
|
|
61
|
+
await LoadOptions_1.LoadOptions.getRows.call(context);
|
|
62
|
+
await LoadOptions_1.LoadOptions.getRows.call(context);
|
|
63
|
+
(0, vitest_1.expect)(requestsTo(/\/api\/collections\/posts$/)).toHaveLength(1);
|
|
64
|
+
});
|
|
65
|
+
(0, vitest_1.it)("reuses collection types already loaded for the collection dropdown", async () => {
|
|
66
|
+
await LoadOptions_1.LoadOptions.getCollections.call(context);
|
|
67
|
+
vitest_1.vi.mocked(context.getNodeParameter).mockReturnValue("posts_view");
|
|
68
|
+
await LoadOptions_1.LoadOptions.getRows.call(context);
|
|
69
|
+
(0, vitest_1.expect)(requestsTo(/\/api\/collections\/[^/]+$/)).toHaveLength(0);
|
|
70
|
+
(0, vitest_1.expect)(requestsTo(/\/records$/)[0].qs).toEqual({ perPage: 250, skipTotal: true });
|
|
71
|
+
});
|
|
72
|
+
(0, vitest_1.it)("reuses collection types loaded for the field dropdowns", async () => {
|
|
73
|
+
vitest_1.vi.mocked(context.getNodeParameter).mockReturnValue("posts_view");
|
|
74
|
+
await LoadOptions_1.LoadOptions.getFields.call(context);
|
|
75
|
+
await LoadOptions_1.LoadOptions.getRows.call(context);
|
|
76
|
+
(0, vitest_1.expect)(requestsTo(/\/api\/collections\/posts_view$/)).toHaveLength(1);
|
|
77
|
+
(0, vitest_1.expect)(requestsTo(/\/records$/)[0].qs).toEqual({ perPage: 250, skipTotal: true });
|
|
78
|
+
});
|
|
79
|
+
(0, vitest_1.it)("re-checks a cached type when loading fails and retries if the type changed", async () => {
|
|
80
|
+
await LoadOptions_1.LoadOptions.getCollections.call(context);
|
|
81
|
+
collectionTypes.posts = "view";
|
|
82
|
+
const recordsHandler = httpRequest.getMockImplementation();
|
|
83
|
+
httpRequest.mockImplementation(async (options) => {
|
|
84
|
+
var _a;
|
|
85
|
+
if (options.url.endsWith("/records") && ((_a = options.qs) === null || _a === void 0 ? void 0 : _a.sort)) {
|
|
86
|
+
throw Object.assign(new Error("Bad Request"), { response: { status: 400 } });
|
|
87
|
+
}
|
|
88
|
+
return await recordsHandler(options);
|
|
89
|
+
});
|
|
90
|
+
const options = await LoadOptions_1.LoadOptions.getRows.call(context);
|
|
91
|
+
(0, vitest_1.expect)(options).toEqual([{ name: "Latest in posts", value: "abc" }]);
|
|
92
|
+
(0, vitest_1.expect)(requestsTo(/\/records$/).map((request) => request.qs)).toEqual([
|
|
93
|
+
{ sort: "-@rowid", perPage: 250, skipTotal: true },
|
|
94
|
+
{ perPage: 250, skipTotal: true },
|
|
95
|
+
]);
|
|
96
|
+
});
|
|
97
|
+
(0, vitest_1.it)("doesn't retry when the type is unchanged", async () => {
|
|
98
|
+
const recordsHandler = httpRequest.getMockImplementation();
|
|
99
|
+
httpRequest.mockImplementation(async (options) => {
|
|
100
|
+
if (options.url.endsWith("/records")) {
|
|
101
|
+
throw Object.assign(new Error("Forbidden"), { response: { status: 403 } });
|
|
102
|
+
}
|
|
103
|
+
return await recordsHandler(options);
|
|
104
|
+
});
|
|
105
|
+
await (0, vitest_1.expect)(LoadOptions_1.LoadOptions.getRows.call(context)).rejects.toBeInstanceOf(n8n_workflow_1.NodeApiError);
|
|
106
|
+
(0, vitest_1.expect)(requestsTo(/\/records$/)).toHaveLength(1);
|
|
107
|
+
});
|
|
108
|
+
(0, vitest_1.it)("reports the records error when re-checking the type also fails", async () => {
|
|
109
|
+
await LoadOptions_1.LoadOptions.getCollections.call(context);
|
|
110
|
+
const recordsHandler = httpRequest.getMockImplementation();
|
|
111
|
+
httpRequest.mockImplementation(async (options) => {
|
|
112
|
+
if (options.url.endsWith("/records"))
|
|
113
|
+
throw new Error("Forbidden");
|
|
114
|
+
if (options.url.endsWith("/api/collections/posts"))
|
|
115
|
+
throw new Error("Unavailable");
|
|
116
|
+
return await recordsHandler(options);
|
|
117
|
+
});
|
|
118
|
+
const error = await LoadOptions_1.LoadOptions.getRows.call(context).catch((e) => e);
|
|
119
|
+
(0, vitest_1.expect)(error).toBeInstanceOf(n8n_workflow_1.NodeApiError);
|
|
120
|
+
(0, vitest_1.expect)(error.message).toContain("Forbidden");
|
|
121
|
+
(0, vitest_1.expect)(requestsTo(/\/records$/)).toHaveLength(1);
|
|
122
|
+
});
|
|
123
|
+
(0, vitest_1.it)("wraps a failed retry after a type change in NodeApiError", async () => {
|
|
124
|
+
await LoadOptions_1.LoadOptions.getCollections.call(context);
|
|
125
|
+
collectionTypes.posts = "view";
|
|
126
|
+
const recordsHandler = httpRequest.getMockImplementation();
|
|
127
|
+
httpRequest.mockImplementation(async (options) => {
|
|
128
|
+
if (options.url.endsWith("/records"))
|
|
129
|
+
throw new Error("Forbidden");
|
|
130
|
+
return await recordsHandler(options);
|
|
131
|
+
});
|
|
132
|
+
await (0, vitest_1.expect)(LoadOptions_1.LoadOptions.getRows.call(context)).rejects.toBeInstanceOf(n8n_workflow_1.NodeApiError);
|
|
133
|
+
(0, vitest_1.expect)(requestsTo(/\/records$/)).toHaveLength(2);
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
//# sourceMappingURL=LoadOptions.spec.js.map
|
|
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