n8n-nodes-primavera 0.0.0-stage → 0.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.
Files changed (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +156 -2
  3. package/dist/credentials/PrimaveraApi.credentials.d.ts +10 -0
  4. package/dist/credentials/PrimaveraApi.credentials.js +56 -0
  5. package/dist/credentials/PrimaveraApi.credentials.js.map +1 -0
  6. package/dist/icons/primavera.dark.svg +1 -0
  7. package/dist/icons/primavera.svg +1 -0
  8. package/dist/nodes/Primavera/Primavera.node.d.ts +10 -0
  9. package/dist/nodes/Primavera/Primavera.node.js +144 -0
  10. package/dist/nodes/Primavera/Primavera.node.js.map +1 -0
  11. package/dist/nodes/Primavera/Primavera.node.json +18 -0
  12. package/dist/nodes/Primavera/actions.d.ts +4 -0
  13. package/dist/nodes/Primavera/actions.js +504 -0
  14. package/dist/nodes/Primavera/actions.js.map +1 -0
  15. package/dist/nodes/Primavera/descriptions/common.d.ts +7 -0
  16. package/dist/nodes/Primavera/descriptions/common.js +102 -0
  17. package/dist/nodes/Primavera/descriptions/common.js.map +1 -0
  18. package/dist/nodes/Primavera/descriptions/job.d.ts +3 -0
  19. package/dist/nodes/Primavera/descriptions/job.js +144 -0
  20. package/dist/nodes/Primavera/descriptions/job.js.map +1 -0
  21. package/dist/nodes/Primavera/descriptions/list.d.ts +3 -0
  22. package/dist/nodes/Primavera/descriptions/list.js +200 -0
  23. package/dist/nodes/Primavera/descriptions/list.js.map +1 -0
  24. package/dist/nodes/Primavera/descriptions/lookups.d.ts +8 -0
  25. package/dist/nodes/Primavera/descriptions/lookups.js +245 -0
  26. package/dist/nodes/Primavera/descriptions/lookups.js.map +1 -0
  27. package/dist/nodes/Primavera/descriptions/search.d.ts +4 -0
  28. package/dist/nodes/Primavera/descriptions/search.js +109 -0
  29. package/dist/nodes/Primavera/descriptions/search.js.map +1 -0
  30. package/dist/nodes/Primavera/shared/clock.d.ts +4 -0
  31. package/dist/nodes/Primavera/shared/clock.js +9 -0
  32. package/dist/nodes/Primavera/shared/clock.js.map +1 -0
  33. package/dist/nodes/Primavera/shared/params.d.ts +11 -0
  34. package/dist/nodes/Primavera/shared/params.js +130 -0
  35. package/dist/nodes/Primavera/shared/params.js.map +1 -0
  36. package/dist/nodes/Primavera/shared/transport.d.ts +32 -0
  37. package/dist/nodes/Primavera/shared/transport.js +142 -0
  38. package/dist/nodes/Primavera/shared/transport.js.map +1 -0
  39. package/dist/nodes/Primavera/shared/wait.d.ts +8 -0
  40. package/dist/nodes/Primavera/shared/wait.js +42 -0
  41. package/dist/nodes/Primavera/shared/wait.js.map +1 -0
  42. package/dist/nodes/PrimaveraTrigger/PrimaveraTrigger.node.d.ts +17 -0
  43. package/dist/nodes/PrimaveraTrigger/PrimaveraTrigger.node.js +232 -0
  44. package/dist/nodes/PrimaveraTrigger/PrimaveraTrigger.node.js.map +1 -0
  45. package/dist/nodes/PrimaveraTrigger/PrimaveraTrigger.node.json +18 -0
  46. package/dist/package.json +69 -0
  47. package/dist/tsconfig.tsbuildinfo +1 -0
  48. package/package.json +68 -5
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Primavera
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,157 @@
1
- # Temporary Holding Version
1
+ # n8n-nodes-primavera
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Build B2B lists of local businesses in your n8n workflows. [Primavera](https://primaverapp.com) is a database of
4
+ businesses: the Google Maps places of France and of other countries, read with their websites (email addresses, phone
5
+ numbers, websites, social networks, technologies; executives in France and the United States). This package is a client
6
+ of the [Primavera API](https://primaverapp.com/docs/api): it turns a target written in plain words ("independent car
7
+ repair shops") into a search, counts and estimates it for free, creates the list, reads its rows, runs jobs on it and
8
+ verifies its email addresses.
9
+
10
+ [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/sustainable-use-license/) workflow automation
11
+ platform.
12
+
13
+ - [Installation](#installation)
14
+ - [Credentials](#credentials)
15
+ - [Operations](#operations)
16
+ - [Trigger](#trigger)
17
+ - [Credits, limits and retries](#credits-limits-and-retries)
18
+ - [Errors](#errors)
19
+ - [Example workflow](#example-workflow)
20
+ - [Compatibility](#compatibility)
21
+ - [Resources](#resources)
22
+
23
+ ## Installation
24
+
25
+ Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community
26
+ nodes documentation: in n8n, open **Settings › Community Nodes › Install** and enter `n8n-nodes-primavera`.
27
+
28
+ ## Credentials
29
+
30
+ You need a Primavera account whose email address is confirmed, with or without a subscription (without one, the
31
+ free credits of a new account work here as in the web app, with lower rate limits), and an API key:
32
+
33
+ 1. Create a key at https://primaverapp.com/dashboard/api. It reads `pv_live_` followed by 32 letters and digits and is
34
+ shown once.
35
+ 2. In n8n, create a **Primavera API** credential and paste the key. n8n checks it with `GET /account`: a `403` means the
36
+ key is valid but the email address of the account is not confirmed yet, or the account is on hold.
37
+
38
+ The key is sent only to `https://primaverapp.com`, in the `Authorization` header. A key can carry a monthly credit cap,
39
+ set on the same page: a useful guard for automated workflows.
40
+
41
+ ## Operations
42
+
43
+ Each operation returns the JSON of its API route, except the operations that return many things (rows, lists,
44
+ categories, networks, preview rows): one n8n item each. The [API documentation](https://primaverapp.com/docs/api)
45
+ describes every field.
46
+
47
+ | Resource | Operation | Route | Cost |
48
+ |---|---|---|---|
49
+ | Account | Get | `GET /account` | free |
50
+ | Area | Search | `GET /areas` | free |
51
+ | Category | Suggest (entry point of every target) | `POST /categories/suggest` | paid |
52
+ | Category | Search | `GET /categories` | free |
53
+ | Network | Search (brands and networks) | `GET /networks` | free |
54
+ | Search | Count | `POST /search/count` | free |
55
+ | Search | Get Metrics (with email, phone, website) | `POST /search/metrics` | free |
56
+ | Search | Preview (sample rows, no contact details) | `POST /search/preview` | free |
57
+ | Search | Estimate (rows and cost of a list) | `POST /search/estimate` | free |
58
+ | List | Create | `POST /lists` | paid |
59
+ | List | Get | `GET /lists/{id}` | free |
60
+ | List | Get Many | `GET /lists` | free |
61
+ | List | Get Rows (one item per row, pages of 1,000 followed) | `GET /lists/{id}/items` | free |
62
+ | List | Prepare File (CSV or Excel, optional download into binary data) | `POST /lists/{id}/files` | free |
63
+ | List | Verify Emails | `POST /lists/{id}/email-check` | paid |
64
+ | Job | Estimate | `POST /lists/{id}/jobs/estimate` | free |
65
+ | Job | Start (executives, website summary, question to the website, AI filter) | `POST /lists/{id}/jobs` | paid |
66
+ | Job | Get | `GET /jobs/{id}` | free |
67
+
68
+ Prices are those of the Primavera web app, with the same balance: see
69
+ [Prices](https://primaverapp.com/docs/api#prices). The node never computes a price itself; the estimates of the API
70
+ give the amount to send.
71
+
72
+ Some work goes on in the background: a list of more than 10,000 rows, the guessed addresses of a list "with email", a
73
+ list in a rarely searched area, a job, an email verification, a file. By default the node waits for it, polling the
74
+ API (every 10 seconds for a list), up to a **Wait Limit** you set. When the limit comes first, the node returns the
75
+ current state with `wait.timedOut: true`; follow it later with List › Get, Job › Get or the trigger. A list is never
76
+ created twice to catch up.
77
+
78
+ The node can be used as a tool by the n8n AI Agent.
79
+
80
+ ## Trigger
81
+
82
+ **Primavera Trigger › List Ready** starts a workflow when a list of the account is ready (optionally: when one fails).
83
+ It reads the 100 newest lists of the account once a minute at most, whatever the poll times, and reports each list
84
+ once. Lists created before the workflow was activated are not reported, except those still being built then. A list
85
+ "with email" is reported once its missing addresses have been guessed (one more call, `GET /lists/{id}`, for those
86
+ lists only). **Fetch Test Event** returns the newest ready list.
87
+
88
+ ## Credits, limits and retries
89
+
90
+ Every paid operation (Category › Suggest, List › Create, List › Verify Emails, Job › Start) has two fields:
91
+
92
+ - **Max Credits**, required and empty by default: the most credits the call may spend. The API never goes over it, and
93
+ the node sends nothing when it is empty. Use the `cost` of Search › Estimate (made with the same rows and the same
94
+ "With Email" choice), `estimate.maxCredits` of Job › Estimate, or for Verify Emails the number of addresses you
95
+ accept to verify (`progress.emailCheck.unverified` of List › Get). A suggestion costs 100 credits.
96
+ - **Idempotency Key**, filled by default with `{{ $execution.id }}-{{ $itemIndex }}-{{ JSON.stringify($json).hash() }}`
97
+ (the execution, the item index and the content of the input item). The node sends the API an `Idempotency-Key`
98
+ header derived from it (a UUID is sent as is; any other value becomes a UUID, the same value always giving the same
99
+ UUID in the same node and operation). A retry of the same item ("Retry On Fail", a lost answer, the retries of an AI
100
+ Agent tool call) therefore gets the saved result and is never charged twice. Two different requests under the same
101
+ key are refused (`idempotency_conflict`), never charged. The default changes with each execution; to keep a key
102
+ across executions (for example one list per row of a sheet), use an ID from your data. Used as a tool by the AI
103
+ Agent, the node also puts the request itself in the key, so that the different calls of the agent get different
104
+ keys while a retried call keeps its own.
105
+
106
+ The API allows 20 requests per minute without a subscription, 60 on Pro and 300 on Agency, per account. On a `429`, the free operations wait for
107
+ `Retry-After` once and send the same request again; paid operations do not retry by themselves.
108
+
109
+ Contact details (email addresses, phone numbers, websites) only come with a list: previews say whether they exist,
110
+ not what they are.
111
+
112
+ ## Errors
113
+
114
+ A refusal of the API shows its code and its hint, for example:
115
+
116
+ ```
117
+ [insufficient_credits] The balance does not cover the call. Hint: Lower rows, or ask the account owner to top up at https://primaverapp.com/dashboard/billing.
118
+ ```
119
+
120
+ With **On Error › Continue**, the item carries `error.code`, `error.message`, `error.hint`, `error.httpCode`,
121
+ `error.retryAfterSeconds` and `error.details`. The codes are listed in the
122
+ [API documentation](https://primaverapp.com/docs/api#errors).
123
+
124
+ ## Example workflow
125
+
126
+ 1. **Primavera › Category › Suggest**, renamed "Suggest": Target "independent car repair shops", Options › Area "Lyon",
127
+ Max Credits 100.
128
+ 2. **Primavera › Search › Estimate**: Search `{{ $('Suggest').item.json.search }}`, Rows 300.
129
+ 3. **Primavera › List › Create**: Search as above, Rows 300, Max Credits `{{ $json.cost }}`.
130
+ 4. **Primavera › List › Get Rows**: List `{{ $json.list.id }}` (By ID), Return All.
131
+ 5. Send the rows to your sheet, CRM or sequencer (Google Sheets, Instantly, lemlist...).
132
+
133
+ ## Compatibility
134
+
135
+ Built with `@n8n/node-cli` 0.57 against `n8n-workflow` 2.48 (n8n 2.48). No runtime dependency.
136
+
137
+ ## Development
138
+
139
+ ```bash
140
+ pnpm install
141
+ pnpm run lint
142
+ pnpm test # build, then unit tests on a fake n8n context (no network)
143
+ ```
144
+
145
+ `node test/live-free.mjs` checks the built node against the production API with free calls only (no key: an unknown
146
+ key must get `401 unauthorized` with its hint; with `PRIMAVERA_API_KEY` set: account, area, categories, count,
147
+ figures, preview, estimate and lists).
148
+
149
+ ## Resources
150
+
151
+ - [Primavera API documentation](https://primaverapp.com/docs/api) and [OpenAPI](https://primaverapp.com/api/v1/openapi.json)
152
+ - [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
153
+ - [Privacy policy](https://primaverapp.com/privacy) · [Terms](https://primaverapp.com/terms)
154
+
155
+ ## License
156
+
157
+ [MIT](LICENSE)
@@ -0,0 +1,10 @@
1
+ import type { IAuthenticateGeneric, Icon, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class PrimaveraApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ icon: Icon;
6
+ documentationUrl: string;
7
+ properties: INodeProperties[];
8
+ authenticate: IAuthenticateGeneric;
9
+ test: ICredentialTestRequest;
10
+ }
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PrimaveraApi = void 0;
4
+ class PrimaveraApi {
5
+ constructor() {
6
+ this.name = 'primaveraApi';
7
+ this.displayName = 'Primavera API';
8
+ this.icon = { light: 'file:../icons/primavera.svg', dark: 'file:../icons/primavera.dark.svg' };
9
+ this.documentationUrl = 'https://primaverapp.com/docs/api#authentication';
10
+ this.properties = [
11
+ {
12
+ displayName: 'API Key',
13
+ name: 'apiKey',
14
+ type: 'string',
15
+ typeOptions: { password: true },
16
+ required: true,
17
+ default: '',
18
+ placeholder: 'pv_live_...',
19
+ description: 'Your Primavera API key, created at https://primaverapp.com/dashboard/api. The API is open to accounts with a confirmed email address, with or without a subscription.',
20
+ },
21
+ ];
22
+ this.authenticate = {
23
+ type: 'generic',
24
+ properties: {
25
+ headers: {
26
+ Authorization: '=Bearer {{$credentials.apiKey}}',
27
+ },
28
+ },
29
+ };
30
+ this.test = {
31
+ request: {
32
+ baseURL: 'https://primaverapp.com/api/v1',
33
+ url: '/account',
34
+ method: 'GET',
35
+ },
36
+ rules: [
37
+ {
38
+ type: 'responseCode',
39
+ properties: {
40
+ value: 401,
41
+ message: 'The API key is missing, unknown or revoked: create one at https://primaverapp.com/dashboard/api.',
42
+ },
43
+ },
44
+ {
45
+ type: 'responseCode',
46
+ properties: {
47
+ value: 403,
48
+ message: 'The key is valid, but the email address of the account is not confirmed yet (log in once at https://primaverapp.com with Google with that address, or subscribe), or the account is on hold (contact Primavera support).',
49
+ },
50
+ },
51
+ ],
52
+ };
53
+ }
54
+ }
55
+ exports.PrimaveraApi = PrimaveraApi;
56
+ //# sourceMappingURL=PrimaveraApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PrimaveraApi.credentials.js","sourceRoot":"","sources":["../../credentials/PrimaveraApi.credentials.ts"],"names":[],"mappings":";;;AAQA,MAAa,YAAY;IAAzB;QACC,SAAI,GAAG,cAAc,CAAC;QAEtB,gBAAW,GAAG,eAAe,CAAC;QAE9B,SAAI,GAAS,EAAE,KAAK,EAAE,6BAA6B,EAAE,IAAI,EAAE,kCAAkC,EAAE,CAAC;QAEhG,qBAAgB,GAAG,iDAAiD,CAAC;QAErE,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,aAAa;gBAC1B,WAAW,EACV,uKAAuK;aACxK;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,iCAAiC;iBAChD;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,gCAAgC;gBACzC,GAAG,EAAE,UAAU;gBACf,MAAM,EAAE,KAAK;aACb;YACD,KAAK,EAAE;gBACN;oBACC,IAAI,EAAE,cAAc;oBACpB,UAAU,EAAE;wBACX,KAAK,EAAE,GAAG;wBACV,OAAO,EACN,kGAAkG;qBACnG;iBACD;gBACD;oBACC,IAAI,EAAE,cAAc;oBACpB,UAAU,EAAE;wBACX,KAAK,EAAE,GAAG;wBACV,OAAO,EACN,0NAA0N;qBAC3N;iBACD;aACD;SACD,CAAC;IACH,CAAC;CAAA;AAzDD,oCAyDC"}
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="20 20 240 240" width="60" height="60"><g fill="none" stroke-linecap="round" stroke-width="17"><path d="M204.3 66.0A98 98 0 1 1 148.5 42.4" stroke="#4C82FF"/><path d="M183.1 84.8A70 70 0 1 1 154.6 71.5" stroke="#A98BFA"/><path d="M178.1 122.3A42 42 0 1 1 127.7 99.8" stroke="#4C82FF"/></g><circle cx="161.6" cy="99.4" r="10" fill="#F5B90A"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="20 20 240 240" width="60" height="60"><g fill="none" stroke-linecap="round" stroke-width="17"><path d="M204.3 66.0A98 98 0 1 1 148.5 42.4" stroke="#0B4FE6"/><path d="M183.1 84.8A70 70 0 1 1 154.6 71.5" stroke="#8B5CF6"/><path d="M178.1 122.3A42 42 0 1 1 127.7 99.8" stroke="#0B4FE6"/></g><circle cx="161.6" cy="99.4" r="10" fill="#F5B90A"/></svg>
@@ -0,0 +1,10 @@
1
+ import type { IExecuteFunctions, ILoadOptionsFunctions, INodeExecutionData, INodeListSearchResult, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class Primavera implements INodeType {
3
+ description: INodeTypeDescription;
4
+ methods: {
5
+ listSearch: {
6
+ searchLists(this: ILoadOptionsFunctions, filter?: string, paginationToken?: string): Promise<INodeListSearchResult>;
7
+ };
8
+ };
9
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
10
+ }
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Primavera = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const actions_1 = require("./actions");
6
+ const job_1 = require("./descriptions/job");
7
+ const list_1 = require("./descriptions/list");
8
+ const lookups_1 = require("./descriptions/lookups");
9
+ const search_1 = require("./descriptions/search");
10
+ const transport_1 = require("./shared/transport");
11
+ class Primavera {
12
+ constructor() {
13
+ this.description = {
14
+ displayName: 'Primavera',
15
+ name: 'primavera',
16
+ icon: { light: 'file:../../icons/primavera.svg', dark: 'file:../../icons/primavera.dark.svg' },
17
+ group: ['input'],
18
+ version: 1,
19
+ subtitle: '={{ $parameter["operation"] + ": " + $parameter["resource"] }}',
20
+ description: 'Build B2B lists of local businesses (Google Maps places read with their websites) with the Primavera API',
21
+ defaults: {
22
+ name: 'Primavera',
23
+ },
24
+ usableAsTool: true,
25
+ inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
26
+ outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
27
+ credentials: [
28
+ {
29
+ name: 'primaveraApi',
30
+ required: true,
31
+ },
32
+ ],
33
+ properties: [
34
+ {
35
+ displayName: 'Resource',
36
+ name: 'resource',
37
+ type: 'options',
38
+ noDataExpression: true,
39
+ options: [
40
+ { name: 'Account', value: 'account' },
41
+ { name: 'Area', value: 'area' },
42
+ { name: 'Category', value: 'category' },
43
+ { name: 'Job', value: 'job' },
44
+ { name: 'List', value: 'list' },
45
+ { name: 'Network', value: 'network' },
46
+ { name: 'Search', value: 'search' },
47
+ ],
48
+ default: 'category',
49
+ },
50
+ ...lookups_1.accountOperations,
51
+ ...lookups_1.areaOperations,
52
+ ...lookups_1.areaFields,
53
+ ...lookups_1.categoryOperations,
54
+ ...lookups_1.categoryFields,
55
+ ...lookups_1.networkOperations,
56
+ ...lookups_1.networkFields,
57
+ ...search_1.searchOperations,
58
+ ...search_1.searchFields,
59
+ ...list_1.listOperations,
60
+ ...list_1.listFields,
61
+ ...job_1.jobOperations,
62
+ ...job_1.jobFields,
63
+ ],
64
+ };
65
+ this.methods = {
66
+ listSearch: {
67
+ async searchLists(filter, paginationToken) {
68
+ const res = await transport_1.primaveraRequest.call(this, {
69
+ method: 'GET',
70
+ path: '/lists',
71
+ qs: { limit: 100, cursor: paginationToken },
72
+ retryOnRateLimit: true,
73
+ });
74
+ const wanted = (filter !== null && filter !== void 0 ? filter : '').trim().toLowerCase();
75
+ const lists = Array.isArray(res.body.lists) ? res.body.lists : [];
76
+ const results = lists
77
+ .filter((list) => typeof list.id === 'string')
78
+ .filter((list) => {
79
+ var _a;
80
+ return wanted === '' ||
81
+ String((_a = list.name) !== null && _a !== void 0 ? _a : '')
82
+ .toLowerCase()
83
+ .includes(wanted);
84
+ })
85
+ .map((list) => {
86
+ var _a, _b, _c;
87
+ return ({
88
+ name: `${String((_a = list.name) !== null && _a !== void 0 ? _a : list.id)} (${String((_b = list.rows) !== null && _b !== void 0 ? _b : 0)} rows, ${String((_c = list.status) !== null && _c !== void 0 ? _c : '')})`,
89
+ value: String(list.id),
90
+ url: `https://primaverapp.com/dashboard/lists/${encodeURIComponent(String(list.id))}`,
91
+ });
92
+ });
93
+ const next = res.body.nextCursor;
94
+ return {
95
+ results,
96
+ paginationToken: typeof next === 'string' && next !== '' ? next : undefined,
97
+ };
98
+ },
99
+ },
100
+ };
101
+ }
102
+ async execute() {
103
+ const items = this.getInputData();
104
+ const returnData = [];
105
+ for (let i = 0; i < items.length; i++) {
106
+ try {
107
+ const resource = this.getNodeParameter('resource', i);
108
+ const operation = this.getNodeParameter('operation', i);
109
+ const results = await actions_1.runOperation.call(this, resource, operation, i);
110
+ for (const result of results) {
111
+ returnData.push({ ...result, pairedItem: { item: i } });
112
+ }
113
+ }
114
+ catch (error) {
115
+ if (this.continueOnFail()) {
116
+ const refusal = (0, transport_1.refusalOf)(error);
117
+ returnData.push({
118
+ json: {
119
+ error: refusal
120
+ ? {
121
+ code: refusal.code,
122
+ message: refusal.message,
123
+ hint: refusal.hint,
124
+ httpCode: refusal.httpCode,
125
+ retryAfterSeconds: refusal.retryAfterSeconds,
126
+ details: refusal.details,
127
+ }
128
+ : { message: error.message },
129
+ },
130
+ pairedItem: { item: i },
131
+ });
132
+ continue;
133
+ }
134
+ if (error instanceof n8n_workflow_1.NodeApiError) {
135
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error, { itemIndex: i });
136
+ }
137
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex: i });
138
+ }
139
+ }
140
+ return [returnData];
141
+ }
142
+ }
143
+ exports.Primavera = Primavera;
144
+ //# sourceMappingURL=Primavera.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Primavera.node.js","sourceRoot":"","sources":["../../../nodes/Primavera/Primavera.node.ts"],"names":[],"mappings":";;;AAUA,+CAAqF;AACrF,uCAAyC;AACzC,4CAA8D;AAC9D,8CAAiE;AACjE,oDAQgC;AAChC,kDAAuE;AACvE,kDAAiE;AASjE,MAAa,SAAS;IAAtB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,WAAW;YACxB,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,EAAE,KAAK,EAAE,gCAAgC,EAAE,IAAI,EAAE,qCAAqC,EAAE;YAC9F,KAAK,EAAE,CAAC,OAAO,CAAC;YAChB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,gEAAgE;YAC1E,WAAW,EACV,0GAA0G;YAC3G,QAAQ,EAAE;gBACT,IAAI,EAAE,WAAW;aACjB;YACD,YAAY,EAAE,IAAI;YAClB,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YAClC,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YACnC,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,cAAc;oBACpB,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,UAAU;oBACvB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACR,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE;wBACrC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE;wBAC/B,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE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E,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;gBAC1F,CAAC;gBACD,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAc,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;YAChF,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AAvID,8BAuIC"}
@@ -0,0 +1,18 @@
1
+ {
2
+ "node": "n8n-nodes-primavera.primavera",
3
+ "nodeVersion": "1.0",
4
+ "codexVersion": "1.0",
5
+ "categories": ["Sales", "Data & Storage"],
6
+ "resources": {
7
+ "credentialDocumentation": [
8
+ {
9
+ "url": "https://github.com/Primavera-SaaS/n8n-nodes-primavera#credentials"
10
+ }
11
+ ],
12
+ "primaryDocumentation": [
13
+ {
14
+ "url": "https://github.com/Primavera-SaaS/n8n-nodes-primavera#readme"
15
+ }
16
+ ]
17
+ }
18
+ }
@@ -0,0 +1,4 @@
1
+ import type { IDataObject, IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
2
+ export declare function listSettled(list: IDataObject, expectGuess: boolean): boolean;
3
+ export declare function runOperation(this: IExecuteFunctions, resource: string, operation: string, i: number): Promise<INodeExecutionData[]>;
4
+ export declare const OPERATIONS: string[];