@drosenthal/n8n-nodes-ynab 0.1.2 → 0.2.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.
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ynabApiRequest = ynabApiRequest;
4
+ exports.getPlans = getPlans;
5
+ exports.getAccounts = getAccounts;
6
+ exports.getCategories = getCategories;
7
+ exports.getCategoryGroups = getCategoryGroups;
8
+ const YNAB_BASE_URL = 'https://api.ynab.com/v1';
9
+ async function ynabApiRequest(method, endpoint, body = {}, qs = {}) {
10
+ const options = {
11
+ method,
12
+ url: `${YNAB_BASE_URL}${endpoint}`,
13
+ qs,
14
+ body,
15
+ json: true,
16
+ };
17
+ if (Object.keys(body).length === 0) {
18
+ delete options.body;
19
+ }
20
+ return this.helpers.httpRequestWithAuthentication.call(this, 'ynabApi', options);
21
+ }
22
+ async function getPlans() {
23
+ var _a, _b;
24
+ const response = await ynabApiRequest.call(this, 'GET', '/plans');
25
+ const plans = ((_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.plans) !== null && _b !== void 0 ? _b : []);
26
+ const options = [
27
+ { name: 'Last Used', value: 'last-used' },
28
+ { name: 'Default', value: 'default' },
29
+ ];
30
+ for (const plan of plans) {
31
+ options.push({ name: plan.name, value: plan.id });
32
+ }
33
+ return options;
34
+ }
35
+ async function getAccounts() {
36
+ var _a, _b;
37
+ const planId = this.getCurrentNodeParameter('plan_id');
38
+ if (!planId)
39
+ return [];
40
+ const response = await ynabApiRequest.call(this, 'GET', `/plans/${planId}/accounts`);
41
+ const accounts = ((_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.accounts) !== null && _b !== void 0 ? _b : []);
42
+ return accounts
43
+ .filter((a) => !a.closed)
44
+ .map((a) => ({ name: a.name, value: a.id }));
45
+ }
46
+ async function getCategories() {
47
+ var _a, _b, _c;
48
+ const planId = this.getCurrentNodeParameter('plan_id');
49
+ if (!planId)
50
+ return [];
51
+ const response = await ynabApiRequest.call(this, 'GET', `/plans/${planId}/categories`);
52
+ const groups = ((_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.category_groups) !== null && _b !== void 0 ? _b : []);
53
+ const options = [];
54
+ for (const group of groups) {
55
+ if (group.hidden || group.deleted)
56
+ continue;
57
+ for (const cat of (_c = group.categories) !== null && _c !== void 0 ? _c : []) {
58
+ if (cat.hidden || cat.deleted)
59
+ continue;
60
+ options.push({ name: `${group.name}: ${cat.name}`, value: cat.id });
61
+ }
62
+ }
63
+ return options;
64
+ }
65
+ async function getCategoryGroups() {
66
+ var _a, _b;
67
+ const planId = this.getCurrentNodeParameter('plan_id');
68
+ if (!planId)
69
+ return [];
70
+ const response = await ynabApiRequest.call(this, 'GET', `/plans/${planId}/categories`);
71
+ const groups = ((_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.category_groups) !== null && _b !== void 0 ? _b : []);
72
+ return groups
73
+ .filter((g) => !g.hidden && !g.deleted)
74
+ .map((g) => ({ name: g.name, value: g.id }));
75
+ }
@@ -1,44 +1,8 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  Object.defineProperty(exports, "__esModule", { value: true });
36
3
  exports.Ynab = void 0;
37
- const n8n_openapi_node_1 = require("@devlikeapro/n8n-openapi-node");
38
- const doc = __importStar(require("./openapi.json"));
39
- const config = {};
40
- const parser = new n8n_openapi_node_1.N8NPropertiesBuilder(doc, config);
41
- const properties = parser.build();
4
+ const descriptions_1 = require("./descriptions");
5
+ const GenericFunctions_1 = require("./GenericFunctions");
42
6
  class Ynab {
43
7
  constructor() {
44
8
  this.description = {
@@ -49,17 +13,10 @@ class Ynab {
49
13
  version: 1,
50
14
  subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
51
15
  description: 'Interact with the YNAB (You Need A Budget) API',
52
- defaults: {
53
- name: 'YNAB',
54
- },
16
+ defaults: { name: 'YNAB' },
55
17
  inputs: ['main'],
56
18
  outputs: ['main'],
57
- credentials: [
58
- {
59
- name: 'ynabApi',
60
- required: true,
61
- },
62
- ],
19
+ credentials: [{ name: 'ynabApi', required: true }],
63
20
  requestDefaults: {
64
21
  baseURL: 'https://api.ynab.com/v1',
65
22
  headers: {
@@ -67,7 +24,15 @@ class Ynab {
67
24
  'Content-Type': 'application/json',
68
25
  },
69
26
  },
70
- properties,
27
+ properties: descriptions_1.allProperties,
28
+ };
29
+ this.methods = {
30
+ loadOptions: {
31
+ getPlans: GenericFunctions_1.getPlans,
32
+ getAccounts: GenericFunctions_1.getAccounts,
33
+ getCategories: GenericFunctions_1.getCategories,
34
+ getCategoryGroups: GenericFunctions_1.getCategoryGroups,
35
+ },
71
36
  };
72
37
  }
73
38
  }
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.accountFields = exports.accountOperations = void 0;
4
+ exports.accountOperations = [
5
+ {
6
+ displayName: 'Operation',
7
+ name: 'operation',
8
+ type: 'options',
9
+ noDataExpression: true,
10
+ displayOptions: { show: { resource: ['account'] } },
11
+ options: [
12
+ {
13
+ name: 'Get All',
14
+ value: 'getAll',
15
+ action: 'Get all accounts',
16
+ routing: {
17
+ request: { method: 'GET', url: '=/plans/{{$parameter.plan_id}}/accounts' },
18
+ },
19
+ },
20
+ {
21
+ name: 'Get',
22
+ value: 'get',
23
+ action: 'Get an account',
24
+ routing: {
25
+ request: {
26
+ method: 'GET',
27
+ url: '=/plans/{{$parameter.plan_id}}/accounts/{{$parameter.account_id}}',
28
+ },
29
+ },
30
+ },
31
+ {
32
+ name: 'Create',
33
+ value: 'create',
34
+ action: 'Create an account',
35
+ routing: {
36
+ request: { method: 'POST', url: '=/plans/{{$parameter.plan_id}}/accounts' },
37
+ },
38
+ },
39
+ ],
40
+ default: 'getAll',
41
+ },
42
+ ];
43
+ exports.accountFields = [
44
+ {
45
+ displayName: 'Plan Name or ID',
46
+ name: 'plan_id',
47
+ type: 'options',
48
+ required: true,
49
+ default: '',
50
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
51
+ typeOptions: { loadOptionsMethod: 'getPlans' },
52
+ displayOptions: { show: { resource: ['account'] } },
53
+ },
54
+ {
55
+ displayName: 'Account Name or ID',
56
+ name: 'account_id',
57
+ type: 'options',
58
+ required: true,
59
+ default: '',
60
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
61
+ typeOptions: { loadOptionsMethod: 'getAccounts', loadOptionsDependsOn: ['plan_id'] },
62
+ displayOptions: { show: { resource: ['account'], operation: ['get'] } },
63
+ },
64
+ // getAll: last_knowledge_of_server
65
+ {
66
+ displayName: 'Last Knowledge of Server',
67
+ name: 'last_knowledge_of_server',
68
+ type: 'number',
69
+ default: 0,
70
+ description: 'Returns entities changed since this knowledge value. Use 0 to fetch everything.',
71
+ displayOptions: { show: { resource: ['account'], operation: ['getAll'] } },
72
+ routing: {
73
+ request: {
74
+ qs: { last_knowledge_of_server: '={{ $value > 0 ? $value : undefined }}' },
75
+ },
76
+ },
77
+ },
78
+ // create: body fields
79
+ {
80
+ displayName: 'Name',
81
+ name: 'name',
82
+ type: 'string',
83
+ default: '',
84
+ required: true,
85
+ description: 'The name of the account',
86
+ displayOptions: { show: { resource: ['account'], operation: ['create'] } },
87
+ routing: { send: { type: 'body', property: 'account.name' } },
88
+ },
89
+ {
90
+ displayName: 'Type',
91
+ name: 'type',
92
+ type: 'options',
93
+ default: 'checking',
94
+ required: true,
95
+ options: [
96
+ { name: 'Checking', value: 'checking' },
97
+ { name: 'Savings', value: 'savings' },
98
+ { name: 'Cash', value: 'cash' },
99
+ { name: 'Credit Card', value: 'creditCard' },
100
+ { name: 'Other Asset', value: 'otherAsset' },
101
+ { name: 'Other Liability', value: 'otherLiability' },
102
+ ],
103
+ displayOptions: { show: { resource: ['account'], operation: ['create'] } },
104
+ routing: { send: { type: 'body', property: 'account.type' } },
105
+ },
106
+ {
107
+ displayName: 'Balance (Milliunits)',
108
+ name: 'balance',
109
+ type: 'number',
110
+ default: 0,
111
+ required: true,
112
+ description: 'The current balance of the account in milliunits format (multiply dollars by 1000)',
113
+ displayOptions: { show: { resource: ['account'], operation: ['create'] } },
114
+ routing: { send: { type: 'body', property: 'account.balance' } },
115
+ },
116
+ ];
@@ -0,0 +1,286 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.categoryFields = exports.categoryOperations = void 0;
4
+ exports.categoryOperations = [
5
+ {
6
+ displayName: 'Operation',
7
+ name: 'operation',
8
+ type: 'options',
9
+ noDataExpression: true,
10
+ displayOptions: { show: { resource: ['category'] } },
11
+ options: [
12
+ {
13
+ name: 'Get All',
14
+ value: 'getAll',
15
+ action: 'Get all categories',
16
+ routing: {
17
+ request: { method: 'GET', url: '=/plans/{{$parameter.plan_id}}/categories' },
18
+ },
19
+ },
20
+ {
21
+ name: 'Get',
22
+ value: 'get',
23
+ action: 'Get a category',
24
+ routing: {
25
+ request: {
26
+ method: 'GET',
27
+ url: '=/plans/{{$parameter.plan_id}}/categories/{{$parameter.category_id}}',
28
+ },
29
+ },
30
+ },
31
+ {
32
+ name: 'Create',
33
+ value: 'create',
34
+ action: 'Create a category',
35
+ routing: {
36
+ request: { method: 'POST', url: '=/plans/{{$parameter.plan_id}}/categories' },
37
+ },
38
+ },
39
+ {
40
+ name: 'Update',
41
+ value: 'update',
42
+ action: 'Update a category',
43
+ routing: {
44
+ request: {
45
+ method: 'PATCH',
46
+ url: '=/plans/{{$parameter.plan_id}}/categories/{{$parameter.category_id}}',
47
+ },
48
+ },
49
+ },
50
+ {
51
+ name: 'Get For Month',
52
+ value: 'getForMonth',
53
+ action: 'Get a category for a specific month',
54
+ routing: {
55
+ request: {
56
+ method: 'GET',
57
+ url: '=/plans/{{$parameter.plan_id}}/months/{{$parameter.month}}/categories/{{$parameter.category_id}}',
58
+ },
59
+ },
60
+ },
61
+ {
62
+ name: 'Update For Month',
63
+ value: 'updateForMonth',
64
+ action: 'Update a category for a specific month',
65
+ routing: {
66
+ request: {
67
+ method: 'PATCH',
68
+ url: '=/plans/{{$parameter.plan_id}}/months/{{$parameter.month}}/categories/{{$parameter.category_id}}',
69
+ },
70
+ },
71
+ },
72
+ {
73
+ name: 'Create Group',
74
+ value: 'createGroup',
75
+ action: 'Create a category group',
76
+ routing: {
77
+ request: { method: 'POST', url: '=/plans/{{$parameter.plan_id}}/category_groups' },
78
+ },
79
+ },
80
+ {
81
+ name: 'Update Group',
82
+ value: 'updateGroup',
83
+ action: 'Update a category group',
84
+ routing: {
85
+ request: {
86
+ method: 'PATCH',
87
+ url: '=/plans/{{$parameter.plan_id}}/category_groups/{{$parameter.category_group_id}}',
88
+ },
89
+ },
90
+ },
91
+ ],
92
+ default: 'getAll',
93
+ },
94
+ ];
95
+ exports.categoryFields = [
96
+ // plan_id for all
97
+ {
98
+ displayName: 'Plan Name or ID',
99
+ name: 'plan_id',
100
+ type: 'options',
101
+ required: true,
102
+ default: '',
103
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
104
+ typeOptions: { loadOptionsMethod: 'getPlans' },
105
+ displayOptions: { show: { resource: ['category'] } },
106
+ },
107
+ // category_id (get, update, getForMonth, updateForMonth)
108
+ {
109
+ displayName: 'Category Name or ID',
110
+ name: 'category_id',
111
+ type: 'options',
112
+ required: true,
113
+ default: '',
114
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
115
+ typeOptions: { loadOptionsMethod: 'getCategories', loadOptionsDependsOn: ['plan_id'] },
116
+ displayOptions: {
117
+ show: {
118
+ resource: ['category'],
119
+ operation: ['get', 'update', 'getForMonth', 'updateForMonth'],
120
+ },
121
+ },
122
+ },
123
+ // category_group_id (updateGroup)
124
+ {
125
+ displayName: 'Category Group Name or ID',
126
+ name: 'category_group_id',
127
+ type: 'options',
128
+ required: true,
129
+ default: '',
130
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
131
+ typeOptions: { loadOptionsMethod: 'getCategoryGroups', loadOptionsDependsOn: ['plan_id'] },
132
+ displayOptions: { show: { resource: ['category'], operation: ['updateGroup'] } },
133
+ },
134
+ // month (getForMonth, updateForMonth)
135
+ {
136
+ displayName: 'Month',
137
+ name: 'month',
138
+ type: 'string',
139
+ required: true,
140
+ default: 'current',
141
+ placeholder: 'current or YYYY-MM-01',
142
+ description: 'ISO-formatted month (e.g. 2024-03-01) or "current"',
143
+ displayOptions: {
144
+ show: { resource: ['category'], operation: ['getForMonth', 'updateForMonth'] },
145
+ },
146
+ },
147
+ // getAll: last_knowledge_of_server
148
+ {
149
+ displayName: 'Last Knowledge of Server',
150
+ name: 'last_knowledge_of_server',
151
+ type: 'number',
152
+ default: 0,
153
+ description: 'Returns entities changed since this knowledge value. Use 0 to fetch everything.',
154
+ displayOptions: { show: { resource: ['category'], operation: ['getAll'] } },
155
+ routing: {
156
+ request: {
157
+ qs: { last_knowledge_of_server: '={{ $value > 0 ? $value : undefined }}' },
158
+ },
159
+ },
160
+ },
161
+ // create: NewCategory body (name + category_group_id required, others optional)
162
+ {
163
+ displayName: 'Name',
164
+ name: 'name',
165
+ type: 'string',
166
+ default: '',
167
+ required: true,
168
+ displayOptions: { show: { resource: ['category'], operation: ['create'] } },
169
+ routing: { send: { type: 'body', property: 'category.name' } },
170
+ },
171
+ {
172
+ displayName: 'Parent Category Group Name or ID',
173
+ name: 'parent_category_group_id',
174
+ type: 'options',
175
+ required: true,
176
+ default: '',
177
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
178
+ typeOptions: { loadOptionsMethod: 'getCategoryGroups', loadOptionsDependsOn: ['plan_id'] },
179
+ displayOptions: { show: { resource: ['category'], operation: ['create'] } },
180
+ routing: { send: { type: 'body', property: 'category.category_group_id' } },
181
+ },
182
+ {
183
+ displayName: 'Additional Fields',
184
+ name: 'additionalFields',
185
+ type: 'collection',
186
+ default: {},
187
+ placeholder: 'Add Field',
188
+ displayOptions: { show: { resource: ['category'], operation: ['create'] } },
189
+ options: [
190
+ {
191
+ displayName: 'Note',
192
+ name: 'note',
193
+ type: 'string',
194
+ default: '',
195
+ routing: { send: { type: 'body', property: 'category.note' } },
196
+ },
197
+ {
198
+ displayName: 'Goal Target (Milliunits)',
199
+ name: 'goal_target',
200
+ type: 'number',
201
+ default: 0,
202
+ description: 'Goal target amount in milliunits (multiply dollars by 1000)',
203
+ routing: { send: { type: 'body', property: 'category.goal_target' } },
204
+ },
205
+ {
206
+ displayName: 'Goal Target Date',
207
+ name: 'goal_target_date',
208
+ type: 'string',
209
+ default: '',
210
+ placeholder: 'YYYY-MM-DD',
211
+ routing: { send: { type: 'body', property: 'category.goal_target_date' } },
212
+ },
213
+ ],
214
+ },
215
+ // update: ExistingCategory body (all optional)
216
+ {
217
+ displayName: 'Update Fields',
218
+ name: 'updateFields',
219
+ type: 'collection',
220
+ default: {},
221
+ placeholder: 'Add Field',
222
+ displayOptions: { show: { resource: ['category'], operation: ['update'] } },
223
+ options: [
224
+ {
225
+ displayName: 'Name',
226
+ name: 'name',
227
+ type: 'string',
228
+ default: '',
229
+ routing: { send: { type: 'body', property: 'category.name' } },
230
+ },
231
+ {
232
+ displayName: 'Note',
233
+ name: 'note',
234
+ type: 'string',
235
+ default: '',
236
+ routing: { send: { type: 'body', property: 'category.note' } },
237
+ },
238
+ {
239
+ displayName: 'Category Group Name or ID',
240
+ name: 'category_group_id',
241
+ type: 'options',
242
+ default: '',
243
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
244
+ typeOptions: { loadOptionsMethod: 'getCategoryGroups', loadOptionsDependsOn: ['plan_id'] },
245
+ routing: { send: { type: 'body', property: 'category.category_group_id' } },
246
+ },
247
+ {
248
+ displayName: 'Goal Target (Milliunits)',
249
+ name: 'goal_target',
250
+ type: 'number',
251
+ default: 0,
252
+ routing: { send: { type: 'body', property: 'category.goal_target' } },
253
+ },
254
+ {
255
+ displayName: 'Goal Target Date',
256
+ name: 'goal_target_date',
257
+ type: 'string',
258
+ default: '',
259
+ placeholder: 'YYYY-MM-DD',
260
+ routing: { send: { type: 'body', property: 'category.goal_target_date' } },
261
+ },
262
+ ],
263
+ },
264
+ // updateForMonth: SaveMonthCategory (budgeted required)
265
+ {
266
+ displayName: 'Budgeted (Milliunits)',
267
+ name: 'budgeted',
268
+ type: 'number',
269
+ default: 0,
270
+ required: true,
271
+ description: 'The amount budgeted for the month in milliunits (multiply dollars by 1000)',
272
+ displayOptions: { show: { resource: ['category'], operation: ['updateForMonth'] } },
273
+ routing: { send: { type: 'body', property: 'category.budgeted' } },
274
+ },
275
+ // createGroup, updateGroup: name
276
+ {
277
+ displayName: 'Name',
278
+ name: 'group_name',
279
+ type: 'string',
280
+ default: '',
281
+ required: true,
282
+ description: 'Category group name (max 50 characters)',
283
+ displayOptions: { show: { resource: ['category'], operation: ['createGroup', 'updateGroup'] } },
284
+ routing: { send: { type: 'body', property: 'category_group.name' } },
285
+ },
286
+ ];
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.moneyMovementFields = exports.moneyMovementOperations = void 0;
4
+ exports.moneyMovementOperations = [
5
+ {
6
+ displayName: 'Operation',
7
+ name: 'operation',
8
+ type: 'options',
9
+ noDataExpression: true,
10
+ displayOptions: { show: { resource: ['moneyMovement'] } },
11
+ options: [
12
+ {
13
+ name: 'Get All',
14
+ value: 'getAll',
15
+ action: 'Get all money movements',
16
+ routing: {
17
+ request: { method: 'GET', url: '=/plans/{{$parameter.plan_id}}/money_movements' },
18
+ },
19
+ },
20
+ {
21
+ name: 'Get All By Month',
22
+ value: 'getAllByMonth',
23
+ action: 'Get money movements for a month',
24
+ routing: {
25
+ request: {
26
+ method: 'GET',
27
+ url: '=/plans/{{$parameter.plan_id}}/months/{{$parameter.month}}/money_movements',
28
+ },
29
+ },
30
+ },
31
+ {
32
+ name: 'Get All Groups',
33
+ value: 'getAllGroups',
34
+ action: 'Get all money movement groups',
35
+ routing: {
36
+ request: { method: 'GET', url: '=/plans/{{$parameter.plan_id}}/money_movement_groups' },
37
+ },
38
+ },
39
+ {
40
+ name: 'Get All Groups By Month',
41
+ value: 'getAllGroupsByMonth',
42
+ action: 'Get money movement groups for a month',
43
+ routing: {
44
+ request: {
45
+ method: 'GET',
46
+ url: '=/plans/{{$parameter.plan_id}}/months/{{$parameter.month}}/money_movement_groups',
47
+ },
48
+ },
49
+ },
50
+ ],
51
+ default: 'getAll',
52
+ },
53
+ ];
54
+ exports.moneyMovementFields = [
55
+ {
56
+ displayName: 'Plan Name or ID',
57
+ name: 'plan_id',
58
+ type: 'options',
59
+ required: true,
60
+ default: '',
61
+ description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
62
+ typeOptions: { loadOptionsMethod: 'getPlans' },
63
+ displayOptions: { show: { resource: ['moneyMovement'] } },
64
+ },
65
+ {
66
+ displayName: 'Month',
67
+ name: 'month',
68
+ type: 'string',
69
+ required: true,
70
+ default: 'current',
71
+ placeholder: 'current or YYYY-MM-01',
72
+ description: 'ISO-formatted month (e.g. 2024-03-01) or "current"',
73
+ displayOptions: {
74
+ show: {
75
+ resource: ['moneyMovement'],
76
+ operation: ['getAllByMonth', 'getAllGroupsByMonth'],
77
+ },
78
+ },
79
+ },
80
+ ];