@astro-api/n8n-nodes-astrology 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nodes/Astrology/Astrology.node.js +4 -0
- package/dist/nodes/Astrology/handlers/humanDesign.handler.d.ts +10 -0
- package/dist/nodes/Astrology/handlers/humanDesign.handler.js +249 -0
- package/dist/nodes/Astrology/handlers/index.d.ts +2 -0
- package/dist/nodes/Astrology/handlers/index.js +5 -1
- package/dist/nodes/Astrology/handlers/numerology.handler.d.ts +10 -0
- package/dist/nodes/Astrology/handlers/numerology.handler.js +141 -0
- package/dist/nodes/Astrology/interfaces/types.d.ts +17 -1
- package/dist/nodes/Astrology/operations/humanDesign.operation.d.ts +5 -0
- package/dist/nodes/Astrology/operations/humanDesign.operation.js +270 -0
- package/dist/nodes/Astrology/operations/index.d.ts +2 -0
- package/dist/nodes/Astrology/operations/index.js +5 -1
- package/dist/nodes/Astrology/operations/numerology.operation.d.ts +5 -0
- package/dist/nodes/Astrology/operations/numerology.operation.js +239 -0
- package/dist/nodes/Astrology/operations/resource.options.js +10 -0
- package/dist/nodes/Astrology/shared/index.d.ts +2 -0
- package/dist/nodes/Astrology/shared/index.js +8 -1
- package/dist/nodes/Astrology/shared/language.fields.d.ts +21 -0
- package/dist/nodes/Astrology/shared/language.fields.js +81 -0
- package/dist/nodes/Astrology/shared/name.fields.d.ts +16 -0
- package/dist/nodes/Astrology/shared/name.fields.js +62 -0
- package/package.json +1 -1
|
@@ -19,6 +19,8 @@ const resourceHandlers = {
|
|
|
19
19
|
data: handlers_1.handleDataResource,
|
|
20
20
|
horoscope: handlers_1.handleHoroscopeResource,
|
|
21
21
|
charts: handlers_1.handleChartsResource,
|
|
22
|
+
humanDesign: handlers_1.handleHumanDesignResource,
|
|
23
|
+
numerology: handlers_1.handleNumerologyResource,
|
|
22
24
|
};
|
|
23
25
|
class Astrology {
|
|
24
26
|
constructor() {
|
|
@@ -47,6 +49,8 @@ class Astrology {
|
|
|
47
49
|
...operations_1.dataOperations,
|
|
48
50
|
...operations_1.horoscopeOperations,
|
|
49
51
|
...operations_1.chartsOperations,
|
|
52
|
+
...operations_1.humanDesignOperations,
|
|
53
|
+
...operations_1.numerologyOperations,
|
|
50
54
|
],
|
|
51
55
|
};
|
|
52
56
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IDataObject } from "n8n-workflow";
|
|
2
|
+
import type { IHandlerContext } from "../interfaces/types";
|
|
3
|
+
/**
|
|
4
|
+
* Handles all Human Design resource operations
|
|
5
|
+
*
|
|
6
|
+
* @param context - Handler context with execution functions and credentials
|
|
7
|
+
* @param operation - The operation to execute
|
|
8
|
+
* @returns API response data
|
|
9
|
+
*/
|
|
10
|
+
export declare function handleHumanDesignResource(context: IHandlerContext, operation: string): Promise<IDataObject>;
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleHumanDesignResource = handleHumanDesignResource;
|
|
4
|
+
const shared_1 = require("../shared");
|
|
5
|
+
/**
|
|
6
|
+
* Endpoint mapping for Human Design operations
|
|
7
|
+
*/
|
|
8
|
+
const HD_ENDPOINTS = {
|
|
9
|
+
glossaryChannels: "/api/v3/human-design/glossary/channels",
|
|
10
|
+
glossaryGates: "/api/v3/human-design/glossary/gates",
|
|
11
|
+
glossaryTypes: "/api/v3/human-design/glossary/types",
|
|
12
|
+
bodygraph: "/api/v3/human-design/bodygraph",
|
|
13
|
+
compatibility: "/api/v3/human-design/compatibility",
|
|
14
|
+
designDate: "/api/v3/human-design/design-date",
|
|
15
|
+
transits: "/api/v3/human-design/transits",
|
|
16
|
+
typeOnly: "/api/v3/human-design/type",
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Handles all Human Design resource operations
|
|
20
|
+
*
|
|
21
|
+
* @param context - Handler context with execution functions and credentials
|
|
22
|
+
* @param operation - The operation to execute
|
|
23
|
+
* @returns API response data
|
|
24
|
+
*/
|
|
25
|
+
async function handleHumanDesignResource(context, operation) {
|
|
26
|
+
const op = operation;
|
|
27
|
+
switch (op) {
|
|
28
|
+
case "glossaryChannels":
|
|
29
|
+
return handleGlossaryChannels(context);
|
|
30
|
+
case "glossaryGates":
|
|
31
|
+
return handleGlossaryGates(context);
|
|
32
|
+
case "glossaryTypes":
|
|
33
|
+
return handleGlossaryTypes(context);
|
|
34
|
+
case "bodygraph":
|
|
35
|
+
return handleBodygraph(context);
|
|
36
|
+
case "compatibility":
|
|
37
|
+
return handleCompatibility(context);
|
|
38
|
+
case "designDate":
|
|
39
|
+
return handleDesignDate(context);
|
|
40
|
+
case "transits":
|
|
41
|
+
return handleTransits(context);
|
|
42
|
+
case "typeOnly":
|
|
43
|
+
return handleTypeOnly(context);
|
|
44
|
+
default:
|
|
45
|
+
throw new Error(`The operation '${operation}' is not supported for the humanDesign resource`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Handles glossary channels request (GET with optional filters)
|
|
50
|
+
*/
|
|
51
|
+
async function handleGlossaryChannels(context) {
|
|
52
|
+
const { executeFunctions, itemIndex, baseUrl, apiKey } = context;
|
|
53
|
+
// Build query parameters
|
|
54
|
+
const language = executeFunctions.getNodeParameter("language", itemIndex, "en");
|
|
55
|
+
const circuit = executeFunctions.getNodeParameter("circuit", itemIndex, "");
|
|
56
|
+
let endpoint = `${HD_ENDPOINTS.glossaryChannels}?language=${language}`;
|
|
57
|
+
if (circuit) {
|
|
58
|
+
endpoint += `&circuit=${circuit}`;
|
|
59
|
+
}
|
|
60
|
+
return await (0, shared_1.makeApiRequest)(executeFunctions, "GET", baseUrl, endpoint, apiKey);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Handles glossary gates request (GET with optional filters)
|
|
64
|
+
*/
|
|
65
|
+
async function handleGlossaryGates(context) {
|
|
66
|
+
const { executeFunctions, itemIndex, baseUrl, apiKey } = context;
|
|
67
|
+
// Build query parameters
|
|
68
|
+
const language = executeFunctions.getNodeParameter("language", itemIndex, "en");
|
|
69
|
+
const center = executeFunctions.getNodeParameter("center", itemIndex, "");
|
|
70
|
+
let endpoint = `${HD_ENDPOINTS.glossaryGates}?language=${language}`;
|
|
71
|
+
if (center) {
|
|
72
|
+
endpoint += `¢er=${center}`;
|
|
73
|
+
}
|
|
74
|
+
return await (0, shared_1.makeApiRequest)(executeFunctions, "GET", baseUrl, endpoint, apiKey);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Handles glossary types request (GET)
|
|
78
|
+
*/
|
|
79
|
+
async function handleGlossaryTypes(context) {
|
|
80
|
+
const { executeFunctions, itemIndex, baseUrl, apiKey } = context;
|
|
81
|
+
const language = executeFunctions.getNodeParameter("language", itemIndex, "en");
|
|
82
|
+
const endpoint = `${HD_ENDPOINTS.glossaryTypes}?language=${language}`;
|
|
83
|
+
return await (0, shared_1.makeApiRequest)(executeFunctions, "GET", baseUrl, endpoint, apiKey);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Handles bodygraph calculation (POST)
|
|
87
|
+
*/
|
|
88
|
+
async function handleBodygraph(context) {
|
|
89
|
+
const { executeFunctions, itemIndex, baseUrl, apiKey } = context;
|
|
90
|
+
// Build birth data
|
|
91
|
+
const birthData = (0, shared_1.buildBirthData)(executeFunctions, itemIndex);
|
|
92
|
+
const subjectName = executeFunctions.getNodeParameter("subjectName", itemIndex, "");
|
|
93
|
+
// Get options
|
|
94
|
+
const language = executeFunctions.getNodeParameter("language", itemIndex, "en");
|
|
95
|
+
const includeInterpretations = executeFunctions.getNodeParameter("includeInterpretations", itemIndex, true);
|
|
96
|
+
const includeChannels = executeFunctions.getNodeParameter("includeChannels", itemIndex, true);
|
|
97
|
+
const includeDesignChart = executeFunctions.getNodeParameter("includeDesignChart", itemIndex, true);
|
|
98
|
+
const includeVariables = executeFunctions.getNodeParameter("includeVariables", itemIndex, false);
|
|
99
|
+
// Build request body
|
|
100
|
+
const body = {
|
|
101
|
+
subject: {
|
|
102
|
+
birth_data: birthData,
|
|
103
|
+
...(subjectName && { name: subjectName }),
|
|
104
|
+
},
|
|
105
|
+
options: {
|
|
106
|
+
language,
|
|
107
|
+
include_interpretations: includeInterpretations,
|
|
108
|
+
},
|
|
109
|
+
hd_options: {
|
|
110
|
+
include_channels: includeChannels,
|
|
111
|
+
include_design_chart: includeDesignChart,
|
|
112
|
+
include_variables: includeVariables,
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
const responseData = await (0, shared_1.makeApiRequest)(executeFunctions, "POST", baseUrl, HD_ENDPOINTS.bodygraph, apiKey, body);
|
|
116
|
+
const simplify = executeFunctions.getNodeParameter("simplify", itemIndex, true);
|
|
117
|
+
return simplify ? (0, shared_1.simplifyResponse)(responseData) : responseData;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Builds second subject birth data from subject2* prefixed fields
|
|
121
|
+
*/
|
|
122
|
+
function buildSecondSubjectBirthData(executeFunctions, itemIndex) {
|
|
123
|
+
const locationType = executeFunctions.getNodeParameter("subject2LocationType", itemIndex);
|
|
124
|
+
const birthData = {
|
|
125
|
+
year: executeFunctions.getNodeParameter("subject2Year", itemIndex),
|
|
126
|
+
month: executeFunctions.getNodeParameter("subject2Month", itemIndex),
|
|
127
|
+
day: executeFunctions.getNodeParameter("subject2Day", itemIndex),
|
|
128
|
+
hour: executeFunctions.getNodeParameter("subject2Hour", itemIndex),
|
|
129
|
+
minute: executeFunctions.getNodeParameter("subject2Minute", itemIndex),
|
|
130
|
+
};
|
|
131
|
+
if (locationType === "city") {
|
|
132
|
+
birthData.city = executeFunctions.getNodeParameter("subject2City", itemIndex);
|
|
133
|
+
birthData.country_code = executeFunctions.getNodeParameter("subject2CountryCode", itemIndex);
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
birthData.latitude = executeFunctions.getNodeParameter("subject2Latitude", itemIndex);
|
|
137
|
+
birthData.longitude = executeFunctions.getNodeParameter("subject2Longitude", itemIndex);
|
|
138
|
+
}
|
|
139
|
+
return birthData;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Handles compatibility calculation (POST with two subjects)
|
|
143
|
+
*/
|
|
144
|
+
async function handleCompatibility(context) {
|
|
145
|
+
const { executeFunctions, itemIndex, baseUrl, apiKey } = context;
|
|
146
|
+
// Build subject 1
|
|
147
|
+
const birthData1 = (0, shared_1.buildBirthData)(executeFunctions, itemIndex);
|
|
148
|
+
const subjectName1 = executeFunctions.getNodeParameter("subjectName", itemIndex, "");
|
|
149
|
+
// Build subject 2
|
|
150
|
+
const birthData2 = buildSecondSubjectBirthData(executeFunctions, itemIndex);
|
|
151
|
+
const subjectName2 = executeFunctions.getNodeParameter("subject2Name", itemIndex, "");
|
|
152
|
+
// Get options
|
|
153
|
+
const language = executeFunctions.getNodeParameter("language", itemIndex, "en");
|
|
154
|
+
const includeInterpretations = executeFunctions.getNodeParameter("includeInterpretations", itemIndex, true);
|
|
155
|
+
const includeChannels = executeFunctions.getNodeParameter("includeChannels", itemIndex, true);
|
|
156
|
+
// Build request body
|
|
157
|
+
const body = {
|
|
158
|
+
subjects: [
|
|
159
|
+
{
|
|
160
|
+
birth_data: birthData1,
|
|
161
|
+
...(subjectName1 && { name: subjectName1 }),
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
birth_data: birthData2,
|
|
165
|
+
...(subjectName2 && { name: subjectName2 }),
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
options: {
|
|
169
|
+
language,
|
|
170
|
+
include_interpretations: includeInterpretations,
|
|
171
|
+
},
|
|
172
|
+
hd_options: {
|
|
173
|
+
include_channels: includeChannels,
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
const responseData = await (0, shared_1.makeApiRequest)(executeFunctions, "POST", baseUrl, HD_ENDPOINTS.compatibility, apiKey, body);
|
|
177
|
+
const simplify = executeFunctions.getNodeParameter("simplify", itemIndex, true);
|
|
178
|
+
return simplify ? (0, shared_1.simplifyResponse)(responseData) : responseData;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Handles design date calculation (POST)
|
|
182
|
+
*/
|
|
183
|
+
async function handleDesignDate(context) {
|
|
184
|
+
const { executeFunctions, itemIndex, baseUrl, apiKey } = context;
|
|
185
|
+
// Build birth data
|
|
186
|
+
const birthData = (0, shared_1.buildBirthData)(executeFunctions, itemIndex);
|
|
187
|
+
const subjectName = executeFunctions.getNodeParameter("subjectName", itemIndex, "");
|
|
188
|
+
// Build request body
|
|
189
|
+
const body = {
|
|
190
|
+
subject: {
|
|
191
|
+
birth_data: birthData,
|
|
192
|
+
...(subjectName && { name: subjectName }),
|
|
193
|
+
},
|
|
194
|
+
};
|
|
195
|
+
const responseData = await (0, shared_1.makeApiRequest)(executeFunctions, "POST", baseUrl, HD_ENDPOINTS.designDate, apiKey, body);
|
|
196
|
+
const simplify = executeFunctions.getNodeParameter("simplify", itemIndex, true);
|
|
197
|
+
return simplify ? (0, shared_1.simplifyResponse)(responseData) : responseData;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Handles transits calculation (POST with transit datetime)
|
|
201
|
+
*/
|
|
202
|
+
async function handleTransits(context) {
|
|
203
|
+
const { executeFunctions, itemIndex, baseUrl, apiKey } = context;
|
|
204
|
+
// Build birth data
|
|
205
|
+
const birthData = (0, shared_1.buildBirthData)(executeFunctions, itemIndex);
|
|
206
|
+
const subjectName = executeFunctions.getNodeParameter("subjectName", itemIndex, "");
|
|
207
|
+
// Get transit datetime (optional - defaults to current time)
|
|
208
|
+
const transitDatetime = executeFunctions.getNodeParameter("transitDatetime", itemIndex, "");
|
|
209
|
+
// Get options
|
|
210
|
+
const language = executeFunctions.getNodeParameter("language", itemIndex, "en");
|
|
211
|
+
const includeInterpretations = executeFunctions.getNodeParameter("includeInterpretations", itemIndex, true);
|
|
212
|
+
// Build request body
|
|
213
|
+
const body = {
|
|
214
|
+
subject: {
|
|
215
|
+
birth_data: birthData,
|
|
216
|
+
...(subjectName && { name: subjectName }),
|
|
217
|
+
},
|
|
218
|
+
options: {
|
|
219
|
+
language,
|
|
220
|
+
include_interpretations: includeInterpretations,
|
|
221
|
+
},
|
|
222
|
+
};
|
|
223
|
+
// Add transit datetime if provided
|
|
224
|
+
if (transitDatetime) {
|
|
225
|
+
body.transit_datetime = transitDatetime;
|
|
226
|
+
}
|
|
227
|
+
const responseData = await (0, shared_1.makeApiRequest)(executeFunctions, "POST", baseUrl, HD_ENDPOINTS.transits, apiKey, body);
|
|
228
|
+
const simplify = executeFunctions.getNodeParameter("simplify", itemIndex, true);
|
|
229
|
+
return simplify ? (0, shared_1.simplifyResponse)(responseData) : responseData;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Handles type only calculation (POST - quick type determination)
|
|
233
|
+
*/
|
|
234
|
+
async function handleTypeOnly(context) {
|
|
235
|
+
const { executeFunctions, itemIndex, baseUrl, apiKey } = context;
|
|
236
|
+
// Build birth data
|
|
237
|
+
const birthData = (0, shared_1.buildBirthData)(executeFunctions, itemIndex);
|
|
238
|
+
const subjectName = executeFunctions.getNodeParameter("subjectName", itemIndex, "");
|
|
239
|
+
// Build request body
|
|
240
|
+
const body = {
|
|
241
|
+
subject: {
|
|
242
|
+
birth_data: birthData,
|
|
243
|
+
...(subjectName && { name: subjectName }),
|
|
244
|
+
},
|
|
245
|
+
};
|
|
246
|
+
const responseData = await (0, shared_1.makeApiRequest)(executeFunctions, "POST", baseUrl, HD_ENDPOINTS.typeOnly, apiKey, body);
|
|
247
|
+
const simplify = executeFunctions.getNodeParameter("simplify", itemIndex, true);
|
|
248
|
+
return simplify ? (0, shared_1.simplifyResponse)(responseData) : responseData;
|
|
249
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export { handleDataResource } from "./data.handler";
|
|
2
2
|
export { handleHoroscopeResource } from "./horoscope.handler";
|
|
3
3
|
export { handleChartsResource } from "./charts.handler";
|
|
4
|
+
export { handleHumanDesignResource } from "./humanDesign.handler";
|
|
5
|
+
export { handleNumerologyResource } from "./numerology.handler";
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handleChartsResource = exports.handleHoroscopeResource = exports.handleDataResource = void 0;
|
|
3
|
+
exports.handleNumerologyResource = exports.handleHumanDesignResource = exports.handleChartsResource = exports.handleHoroscopeResource = exports.handleDataResource = void 0;
|
|
4
4
|
var data_handler_1 = require("./data.handler");
|
|
5
5
|
Object.defineProperty(exports, "handleDataResource", { enumerable: true, get: function () { return data_handler_1.handleDataResource; } });
|
|
6
6
|
var horoscope_handler_1 = require("./horoscope.handler");
|
|
7
7
|
Object.defineProperty(exports, "handleHoroscopeResource", { enumerable: true, get: function () { return horoscope_handler_1.handleHoroscopeResource; } });
|
|
8
8
|
var charts_handler_1 = require("./charts.handler");
|
|
9
9
|
Object.defineProperty(exports, "handleChartsResource", { enumerable: true, get: function () { return charts_handler_1.handleChartsResource; } });
|
|
10
|
+
var humanDesign_handler_1 = require("./humanDesign.handler");
|
|
11
|
+
Object.defineProperty(exports, "handleHumanDesignResource", { enumerable: true, get: function () { return humanDesign_handler_1.handleHumanDesignResource; } });
|
|
12
|
+
var numerology_handler_1 = require("./numerology.handler");
|
|
13
|
+
Object.defineProperty(exports, "handleNumerologyResource", { enumerable: true, get: function () { return numerology_handler_1.handleNumerologyResource; } });
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IDataObject } from "n8n-workflow";
|
|
2
|
+
import type { IHandlerContext } from "../interfaces/types";
|
|
3
|
+
/**
|
|
4
|
+
* Handles all Numerology resource operations
|
|
5
|
+
*
|
|
6
|
+
* @param context - Handler context with execution functions and credentials
|
|
7
|
+
* @param operation - The operation to execute
|
|
8
|
+
* @returns API response data
|
|
9
|
+
*/
|
|
10
|
+
export declare function handleNumerologyResource(context: IHandlerContext, operation: string): Promise<IDataObject>;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleNumerologyResource = handleNumerologyResource;
|
|
4
|
+
const shared_1 = require("../shared");
|
|
5
|
+
/**
|
|
6
|
+
* Endpoint mapping for Numerology operations
|
|
7
|
+
*/
|
|
8
|
+
const NUMEROLOGY_ENDPOINTS = {
|
|
9
|
+
coreNumbers: "/api/v3/numerology/core-numbers",
|
|
10
|
+
comprehensive: "/api/v3/numerology/comprehensive",
|
|
11
|
+
compatibility: "/api/v3/numerology/compatibility",
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Handles all Numerology resource operations
|
|
15
|
+
*
|
|
16
|
+
* @param context - Handler context with execution functions and credentials
|
|
17
|
+
* @param operation - The operation to execute
|
|
18
|
+
* @returns API response data
|
|
19
|
+
*/
|
|
20
|
+
async function handleNumerologyResource(context, operation) {
|
|
21
|
+
const op = operation;
|
|
22
|
+
switch (op) {
|
|
23
|
+
case "coreNumbers":
|
|
24
|
+
return handleCoreNumbers(context);
|
|
25
|
+
case "comprehensive":
|
|
26
|
+
return handleComprehensive(context);
|
|
27
|
+
case "compatibility":
|
|
28
|
+
return handleCompatibility(context);
|
|
29
|
+
default:
|
|
30
|
+
throw new Error(`The operation '${operation}' is not supported for the numerology resource`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Builds numerology birth data (date only, no time/location)
|
|
35
|
+
*/
|
|
36
|
+
function buildNumerologyBirthData(context) {
|
|
37
|
+
const { executeFunctions, itemIndex } = context;
|
|
38
|
+
return {
|
|
39
|
+
year: executeFunctions.getNodeParameter("year", itemIndex),
|
|
40
|
+
month: executeFunctions.getNodeParameter("month", itemIndex),
|
|
41
|
+
day: executeFunctions.getNodeParameter("day", itemIndex),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Builds second subject birth data for compatibility
|
|
46
|
+
*/
|
|
47
|
+
function buildSecondSubjectBirthData(context) {
|
|
48
|
+
const { executeFunctions, itemIndex } = context;
|
|
49
|
+
return {
|
|
50
|
+
year: executeFunctions.getNodeParameter("subject2Year", itemIndex),
|
|
51
|
+
month: executeFunctions.getNodeParameter("subject2Month", itemIndex),
|
|
52
|
+
day: executeFunctions.getNodeParameter("subject2Day", itemIndex),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Handles core numbers calculation (POST)
|
|
57
|
+
*/
|
|
58
|
+
async function handleCoreNumbers(context) {
|
|
59
|
+
const { executeFunctions, itemIndex, baseUrl, apiKey } = context;
|
|
60
|
+
// Get subject data
|
|
61
|
+
const subjectName = executeFunctions.getNodeParameter("subjectName", itemIndex);
|
|
62
|
+
const birthData = buildNumerologyBirthData(context);
|
|
63
|
+
// Get options
|
|
64
|
+
const language = executeFunctions.getNodeParameter("language", itemIndex, "en");
|
|
65
|
+
const includeInterpretations = executeFunctions.getNodeParameter("includeInterpretations", itemIndex, true);
|
|
66
|
+
// Build request body
|
|
67
|
+
const body = {
|
|
68
|
+
subject: {
|
|
69
|
+
name: subjectName,
|
|
70
|
+
birth_data: birthData,
|
|
71
|
+
},
|
|
72
|
+
options: {
|
|
73
|
+
language,
|
|
74
|
+
include_interpretations: includeInterpretations,
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
const responseData = await (0, shared_1.makeApiRequest)(executeFunctions, "POST", baseUrl, NUMEROLOGY_ENDPOINTS.coreNumbers, apiKey, body);
|
|
78
|
+
const simplify = executeFunctions.getNodeParameter("simplify", itemIndex, true);
|
|
79
|
+
return simplify ? (0, shared_1.simplifyResponse)(responseData) : responseData;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Handles comprehensive reading (POST)
|
|
83
|
+
*/
|
|
84
|
+
async function handleComprehensive(context) {
|
|
85
|
+
const { executeFunctions, itemIndex, baseUrl, apiKey } = context;
|
|
86
|
+
// Get subject data
|
|
87
|
+
const subjectName = executeFunctions.getNodeParameter("subjectName", itemIndex);
|
|
88
|
+
const birthData = buildNumerologyBirthData(context);
|
|
89
|
+
// Get options
|
|
90
|
+
const language = executeFunctions.getNodeParameter("language", itemIndex, "en");
|
|
91
|
+
const includeInterpretations = executeFunctions.getNodeParameter("includeInterpretations", itemIndex, true);
|
|
92
|
+
// Build request body
|
|
93
|
+
const body = {
|
|
94
|
+
subject: {
|
|
95
|
+
name: subjectName,
|
|
96
|
+
birth_data: birthData,
|
|
97
|
+
},
|
|
98
|
+
options: {
|
|
99
|
+
language,
|
|
100
|
+
include_interpretations: includeInterpretations,
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
const responseData = await (0, shared_1.makeApiRequest)(executeFunctions, "POST", baseUrl, NUMEROLOGY_ENDPOINTS.comprehensive, apiKey, body);
|
|
104
|
+
const simplify = executeFunctions.getNodeParameter("simplify", itemIndex, true);
|
|
105
|
+
return simplify ? (0, shared_1.simplifyResponse)(responseData) : responseData;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Handles compatibility analysis (POST with two subjects)
|
|
109
|
+
*/
|
|
110
|
+
async function handleCompatibility(context) {
|
|
111
|
+
const { executeFunctions, itemIndex, baseUrl, apiKey } = context;
|
|
112
|
+
// Get subject 1 data
|
|
113
|
+
const subjectName1 = executeFunctions.getNodeParameter("subjectName", itemIndex);
|
|
114
|
+
const birthData1 = buildNumerologyBirthData(context);
|
|
115
|
+
// Get subject 2 data
|
|
116
|
+
const subjectName2 = executeFunctions.getNodeParameter("subject2Name", itemIndex);
|
|
117
|
+
const birthData2 = buildSecondSubjectBirthData(context);
|
|
118
|
+
// Get options
|
|
119
|
+
const language = executeFunctions.getNodeParameter("language", itemIndex, "en");
|
|
120
|
+
const includeInterpretations = executeFunctions.getNodeParameter("includeInterpretations", itemIndex, true);
|
|
121
|
+
// Build request body
|
|
122
|
+
const body = {
|
|
123
|
+
subjects: [
|
|
124
|
+
{
|
|
125
|
+
name: subjectName1,
|
|
126
|
+
birth_data: birthData1,
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: subjectName2,
|
|
130
|
+
birth_data: birthData2,
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
options: {
|
|
134
|
+
language,
|
|
135
|
+
include_interpretations: includeInterpretations,
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
const responseData = await (0, shared_1.makeApiRequest)(executeFunctions, "POST", baseUrl, NUMEROLOGY_ENDPOINTS.compatibility, apiKey, body);
|
|
139
|
+
const simplify = executeFunctions.getNodeParameter("simplify", itemIndex, true);
|
|
140
|
+
return simplify ? (0, shared_1.simplifyResponse)(responseData) : responseData;
|
|
141
|
+
}
|
|
@@ -25,7 +25,7 @@ export interface ISubjectRequest {
|
|
|
25
25
|
/**
|
|
26
26
|
* Resource types available in the node
|
|
27
27
|
*/
|
|
28
|
-
export type ResourceType = "data" | "horoscope" | "charts";
|
|
28
|
+
export type ResourceType = "data" | "horoscope" | "charts" | "humanDesign" | "numerology";
|
|
29
29
|
/**
|
|
30
30
|
* Data resource operations
|
|
31
31
|
*/
|
|
@@ -38,6 +38,22 @@ export type HoroscopeOperation = "signDaily" | "signDailyText" | "signWeekly" |
|
|
|
38
38
|
* Charts resource operations
|
|
39
39
|
*/
|
|
40
40
|
export type ChartsOperation = "natal" | "synastry" | "transit" | "composite" | "solarReturn" | "solarReturnTransits" | "lunarReturn" | "lunarReturnTransits" | "progressions" | "natalTransits" | "directions";
|
|
41
|
+
/**
|
|
42
|
+
* Human Design resource operations
|
|
43
|
+
*/
|
|
44
|
+
export type HumanDesignOperation = "glossaryChannels" | "glossaryGates" | "glossaryTypes" | "bodygraph" | "compatibility" | "designDate" | "transits" | "typeOnly";
|
|
45
|
+
/**
|
|
46
|
+
* Numerology resource operations
|
|
47
|
+
*/
|
|
48
|
+
export type NumerologyOperation = "coreNumbers" | "comprehensive" | "compatibility";
|
|
49
|
+
/**
|
|
50
|
+
* Human Design circuit types
|
|
51
|
+
*/
|
|
52
|
+
export type HumanDesignCircuit = "individual" | "collective" | "tribal";
|
|
53
|
+
/**
|
|
54
|
+
* Human Design center types
|
|
55
|
+
*/
|
|
56
|
+
export type HumanDesignCenter = "head" | "ajna" | "throat" | "g_center" | "heart" | "sacral" | "solar_plexus" | "spleen" | "root";
|
|
41
57
|
/**
|
|
42
58
|
* Transit time structure for transit chart requests
|
|
43
59
|
*/
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.humanDesignOperations = void 0;
|
|
4
|
+
const shared_1 = require("../shared");
|
|
5
|
+
/**
|
|
6
|
+
* Operation groups for displayOptions
|
|
7
|
+
*/
|
|
8
|
+
const glossaryOperations = [
|
|
9
|
+
"glossaryChannels",
|
|
10
|
+
"glossaryGates",
|
|
11
|
+
"glossaryTypes",
|
|
12
|
+
];
|
|
13
|
+
const birthDataOperations = [
|
|
14
|
+
"bodygraph",
|
|
15
|
+
"compatibility",
|
|
16
|
+
"designDate",
|
|
17
|
+
"transits",
|
|
18
|
+
"typeOnly",
|
|
19
|
+
];
|
|
20
|
+
const locationOperations = [
|
|
21
|
+
"bodygraph",
|
|
22
|
+
"compatibility",
|
|
23
|
+
"designDate",
|
|
24
|
+
"transits",
|
|
25
|
+
"typeOnly",
|
|
26
|
+
];
|
|
27
|
+
const compatibilityOperations = ["compatibility"];
|
|
28
|
+
const transitOperations = ["transits"];
|
|
29
|
+
/**
|
|
30
|
+
* Operation selector for Human Design resource
|
|
31
|
+
*/
|
|
32
|
+
const humanDesignOperationField = {
|
|
33
|
+
displayName: "Operation",
|
|
34
|
+
name: "operation",
|
|
35
|
+
type: "options",
|
|
36
|
+
noDataExpression: true,
|
|
37
|
+
displayOptions: {
|
|
38
|
+
show: {
|
|
39
|
+
resource: ["humanDesign"],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
options: [
|
|
43
|
+
{
|
|
44
|
+
name: "BodyGraph",
|
|
45
|
+
value: "bodygraph",
|
|
46
|
+
description: "Generate complete Human Design BodyGraph chart with type, strategy, authority, centers, channels, and gates",
|
|
47
|
+
action: "Calculate bodygraph",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "Compatibility",
|
|
51
|
+
value: "compatibility",
|
|
52
|
+
description: "Human Design compatibility analysis between two people showing connection dynamics",
|
|
53
|
+
action: "Calculate compatibility",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "Design Date",
|
|
57
|
+
value: "designDate",
|
|
58
|
+
description: "Calculate the Design date (when Sun was 88° of arc earlier than birth) for Human Design calculations",
|
|
59
|
+
action: "Calculate design date",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "Glossary - Channels",
|
|
63
|
+
value: "glossaryChannels",
|
|
64
|
+
description: "Get information about all 36 Human Design channels with descriptions",
|
|
65
|
+
action: "Get channels glossary",
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: "Glossary - Gates",
|
|
69
|
+
value: "glossaryGates",
|
|
70
|
+
description: "Get information about all 64 Human Design gates with descriptions",
|
|
71
|
+
action: "Get gates glossary",
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: "Glossary - Types",
|
|
75
|
+
value: "glossaryTypes",
|
|
76
|
+
description: "Get information about the 5 Human Design types (Generator, Projector, Manifestor, etc.)",
|
|
77
|
+
action: "Get types glossary",
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: "Transits",
|
|
81
|
+
value: "transits",
|
|
82
|
+
description: "Calculate transit overlay showing how current planetary positions activate gates and channels",
|
|
83
|
+
action: "Calculate transit overlay",
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: "Type Only",
|
|
87
|
+
value: "typeOnly",
|
|
88
|
+
description: "Quick calculation of Human Design Type, Strategy, and Authority only (faster than full BodyGraph)",
|
|
89
|
+
action: "Get type only",
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
default: "bodygraph",
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Circuit filter for channels glossary
|
|
96
|
+
*/
|
|
97
|
+
const circuitFilterField = {
|
|
98
|
+
displayName: "Filter by Circuit",
|
|
99
|
+
name: "circuit",
|
|
100
|
+
type: "options",
|
|
101
|
+
displayOptions: {
|
|
102
|
+
show: {
|
|
103
|
+
resource: ["humanDesign"],
|
|
104
|
+
operation: ["glossaryChannels"],
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
options: [
|
|
108
|
+
{ name: "All Circuits", value: "" },
|
|
109
|
+
{ name: "Individual", value: "individual" },
|
|
110
|
+
{ name: "Collective", value: "collective" },
|
|
111
|
+
{ name: "Tribal", value: "tribal" },
|
|
112
|
+
],
|
|
113
|
+
default: "",
|
|
114
|
+
description: "Filter channels by circuit type",
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Center filter for gates glossary
|
|
118
|
+
*/
|
|
119
|
+
const centerFilterField = {
|
|
120
|
+
displayName: "Filter by Center",
|
|
121
|
+
name: "center",
|
|
122
|
+
type: "options",
|
|
123
|
+
displayOptions: {
|
|
124
|
+
show: {
|
|
125
|
+
resource: ["humanDesign"],
|
|
126
|
+
operation: ["glossaryGates"],
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
options: [
|
|
130
|
+
{ name: "Ajna", value: "ajna" },
|
|
131
|
+
{ name: "All Centers", value: "" },
|
|
132
|
+
{ name: "G Center (Identity)", value: "g_center" },
|
|
133
|
+
{ name: "Head", value: "head" },
|
|
134
|
+
{ name: "Heart (Will)", value: "heart" },
|
|
135
|
+
{ name: "Root", value: "root" },
|
|
136
|
+
{ name: "Sacral", value: "sacral" },
|
|
137
|
+
{ name: "Solar Plexus (Emotional)", value: "solar_plexus" },
|
|
138
|
+
{ name: "Spleen (Intuition)", value: "spleen" },
|
|
139
|
+
{ name: "Throat", value: "throat" },
|
|
140
|
+
],
|
|
141
|
+
default: "",
|
|
142
|
+
description: "Filter gates by center",
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Subject name field for Human Design
|
|
146
|
+
*/
|
|
147
|
+
const subjectNameField = {
|
|
148
|
+
displayName: "Name",
|
|
149
|
+
name: "subjectName",
|
|
150
|
+
type: "string",
|
|
151
|
+
displayOptions: {
|
|
152
|
+
show: {
|
|
153
|
+
resource: ["humanDesign"],
|
|
154
|
+
operation: birthDataOperations,
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
default: "",
|
|
158
|
+
placeholder: "e.g. John Doe",
|
|
159
|
+
description: "Optional name for the subject (used in report titles)",
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* Transit datetime field
|
|
163
|
+
*/
|
|
164
|
+
const transitDatetimeField = {
|
|
165
|
+
displayName: "Transit Date/Time",
|
|
166
|
+
name: "transitDatetime",
|
|
167
|
+
type: "dateTime",
|
|
168
|
+
displayOptions: {
|
|
169
|
+
show: {
|
|
170
|
+
resource: ["humanDesign"],
|
|
171
|
+
operation: transitOperations,
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
default: "",
|
|
175
|
+
description: "Date and time for transit calculation. Leave empty for current time.",
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* HD-specific options: Include channels
|
|
179
|
+
*/
|
|
180
|
+
const includeChannelsField = {
|
|
181
|
+
displayName: "Include Channels",
|
|
182
|
+
name: "includeChannels",
|
|
183
|
+
type: "boolean",
|
|
184
|
+
displayOptions: {
|
|
185
|
+
show: {
|
|
186
|
+
resource: ["humanDesign"],
|
|
187
|
+
operation: ["bodygraph", "compatibility"],
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
default: true,
|
|
191
|
+
description: "Whether to include detailed channel information in the response",
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* HD-specific options: Include design chart
|
|
195
|
+
*/
|
|
196
|
+
const includeDesignChartField = {
|
|
197
|
+
displayName: "Include Design Chart",
|
|
198
|
+
name: "includeDesignChart",
|
|
199
|
+
type: "boolean",
|
|
200
|
+
displayOptions: {
|
|
201
|
+
show: {
|
|
202
|
+
resource: ["humanDesign"],
|
|
203
|
+
operation: ["bodygraph"],
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
default: true,
|
|
207
|
+
description: "Whether to include the Design (unconscious) chart data alongside Personality",
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* HD-specific options: Include variables
|
|
211
|
+
*/
|
|
212
|
+
const includeVariablesField = {
|
|
213
|
+
displayName: "Include Variables",
|
|
214
|
+
name: "includeVariables",
|
|
215
|
+
type: "boolean",
|
|
216
|
+
displayOptions: {
|
|
217
|
+
show: {
|
|
218
|
+
resource: ["humanDesign"],
|
|
219
|
+
operation: ["bodygraph"],
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
default: false,
|
|
223
|
+
description: "Whether to include variable (arrow) analysis in the response",
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* Simplify output toggle for Human Design
|
|
227
|
+
*/
|
|
228
|
+
const simplifyField = {
|
|
229
|
+
displayName: "Simplify",
|
|
230
|
+
name: "simplify",
|
|
231
|
+
type: "boolean",
|
|
232
|
+
displayOptions: {
|
|
233
|
+
show: {
|
|
234
|
+
resource: ["humanDesign"],
|
|
235
|
+
},
|
|
236
|
+
hide: {
|
|
237
|
+
operation: glossaryOperations,
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
default: true,
|
|
241
|
+
description: "Whether to return simplified response with key data only. Disable for full API response.",
|
|
242
|
+
};
|
|
243
|
+
/**
|
|
244
|
+
* All properties for the Human Design resource
|
|
245
|
+
*/
|
|
246
|
+
exports.humanDesignOperations = [
|
|
247
|
+
// Operation selector
|
|
248
|
+
humanDesignOperationField,
|
|
249
|
+
// Glossary filters
|
|
250
|
+
(0, shared_1.createLanguageField)("humanDesign"),
|
|
251
|
+
circuitFilterField,
|
|
252
|
+
centerFilterField,
|
|
253
|
+
// Subject name (optional, for POST operations)
|
|
254
|
+
subjectNameField,
|
|
255
|
+
// Birth data fields (for POST operations only)
|
|
256
|
+
...(0, shared_1.createBirthDataFields)("humanDesign", birthDataOperations),
|
|
257
|
+
// Location fields (for POST operations only)
|
|
258
|
+
...(0, shared_1.createLocationFields)("humanDesign", locationOperations),
|
|
259
|
+
// Second subject fields (for compatibility)
|
|
260
|
+
...(0, shared_1.createSecondSubjectFields)("humanDesign", compatibilityOperations),
|
|
261
|
+
// Transit datetime (for transits operation)
|
|
262
|
+
transitDatetimeField,
|
|
263
|
+
// HD-specific options
|
|
264
|
+
includeChannelsField,
|
|
265
|
+
includeDesignChartField,
|
|
266
|
+
includeVariablesField,
|
|
267
|
+
(0, shared_1.createIncludeInterpretationsField)("humanDesign", birthDataOperations),
|
|
268
|
+
// Simplify output
|
|
269
|
+
simplifyField,
|
|
270
|
+
];
|
|
@@ -2,3 +2,5 @@ export { resourceField } from "./resource.options";
|
|
|
2
2
|
export { dataOperations } from "./data.operation";
|
|
3
3
|
export { horoscopeOperations } from "./horoscope.operation";
|
|
4
4
|
export { chartsOperations } from "./charts.operation";
|
|
5
|
+
export { humanDesignOperations } from "./humanDesign.operation";
|
|
6
|
+
export { numerologyOperations } from "./numerology.operation";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.chartsOperations = exports.horoscopeOperations = exports.dataOperations = exports.resourceField = void 0;
|
|
3
|
+
exports.numerologyOperations = exports.humanDesignOperations = exports.chartsOperations = exports.horoscopeOperations = exports.dataOperations = exports.resourceField = void 0;
|
|
4
4
|
var resource_options_1 = require("./resource.options");
|
|
5
5
|
Object.defineProperty(exports, "resourceField", { enumerable: true, get: function () { return resource_options_1.resourceField; } });
|
|
6
6
|
var data_operation_1 = require("./data.operation");
|
|
@@ -9,3 +9,7 @@ var horoscope_operation_1 = require("./horoscope.operation");
|
|
|
9
9
|
Object.defineProperty(exports, "horoscopeOperations", { enumerable: true, get: function () { return horoscope_operation_1.horoscopeOperations; } });
|
|
10
10
|
var charts_operation_1 = require("./charts.operation");
|
|
11
11
|
Object.defineProperty(exports, "chartsOperations", { enumerable: true, get: function () { return charts_operation_1.chartsOperations; } });
|
|
12
|
+
var humanDesign_operation_1 = require("./humanDesign.operation");
|
|
13
|
+
Object.defineProperty(exports, "humanDesignOperations", { enumerable: true, get: function () { return humanDesign_operation_1.humanDesignOperations; } });
|
|
14
|
+
var numerology_operation_1 = require("./numerology.operation");
|
|
15
|
+
Object.defineProperty(exports, "numerologyOperations", { enumerable: true, get: function () { return numerology_operation_1.numerologyOperations; } });
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.numerologyOperations = void 0;
|
|
4
|
+
const shared_1 = require("../shared");
|
|
5
|
+
/**
|
|
6
|
+
* Operation groups for displayOptions
|
|
7
|
+
*/
|
|
8
|
+
const allOperations = ["coreNumbers", "comprehensive", "compatibility"];
|
|
9
|
+
const compatibilityOperations = ["compatibility"];
|
|
10
|
+
/**
|
|
11
|
+
* Operation selector for Numerology resource
|
|
12
|
+
*/
|
|
13
|
+
const numerologyOperationField = {
|
|
14
|
+
displayName: "Operation",
|
|
15
|
+
name: "operation",
|
|
16
|
+
type: "options",
|
|
17
|
+
noDataExpression: true,
|
|
18
|
+
displayOptions: {
|
|
19
|
+
show: {
|
|
20
|
+
resource: ["numerology"],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
options: [
|
|
24
|
+
{
|
|
25
|
+
name: "Compatibility",
|
|
26
|
+
value: "compatibility",
|
|
27
|
+
description: "Numerology compatibility analysis between two people based on their core numbers",
|
|
28
|
+
action: "Analyze compatibility",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "Comprehensive Reading",
|
|
32
|
+
value: "comprehensive",
|
|
33
|
+
description: "Complete numerology reading with all core numbers, cycles, periods, and interpretations",
|
|
34
|
+
action: "Get comprehensive reading",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: "Core Numbers",
|
|
38
|
+
value: "coreNumbers",
|
|
39
|
+
description: "Calculate Life Path, Expression, Soul Urge, Personality, and Birth Day numbers",
|
|
40
|
+
action: "Get core numbers",
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
default: "coreNumbers",
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Name field for first subject (required for numerology)
|
|
47
|
+
*/
|
|
48
|
+
const subjectNameField = {
|
|
49
|
+
displayName: "Full Name",
|
|
50
|
+
name: "subjectName",
|
|
51
|
+
type: "string",
|
|
52
|
+
displayOptions: {
|
|
53
|
+
show: {
|
|
54
|
+
resource: ["numerology"],
|
|
55
|
+
operation: allOperations,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
default: "",
|
|
59
|
+
placeholder: "e.g. John Michael Doe",
|
|
60
|
+
description: "Full birth name for numerology calculations (required for name-based numbers)",
|
|
61
|
+
required: true,
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Birth date fields for numerology (only date, no time needed)
|
|
65
|
+
*/
|
|
66
|
+
const birthYearField = {
|
|
67
|
+
displayName: "Birth Year",
|
|
68
|
+
name: "year",
|
|
69
|
+
type: "number",
|
|
70
|
+
displayOptions: {
|
|
71
|
+
show: {
|
|
72
|
+
resource: ["numerology"],
|
|
73
|
+
operation: allOperations,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
default: 1990,
|
|
77
|
+
placeholder: "e.g. 1990",
|
|
78
|
+
description: "Birth year in 4-digit format (e.g., 1990)",
|
|
79
|
+
required: true,
|
|
80
|
+
};
|
|
81
|
+
const birthMonthField = {
|
|
82
|
+
displayName: "Birth Month",
|
|
83
|
+
name: "month",
|
|
84
|
+
type: "number",
|
|
85
|
+
displayOptions: {
|
|
86
|
+
show: {
|
|
87
|
+
resource: ["numerology"],
|
|
88
|
+
operation: allOperations,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
default: 1,
|
|
92
|
+
placeholder: "e.g. 6",
|
|
93
|
+
typeOptions: {
|
|
94
|
+
minValue: 1,
|
|
95
|
+
maxValue: 12,
|
|
96
|
+
},
|
|
97
|
+
description: "Birth month as number 1-12 (January=1, December=12)",
|
|
98
|
+
required: true,
|
|
99
|
+
};
|
|
100
|
+
const birthDayField = {
|
|
101
|
+
displayName: "Birth Day",
|
|
102
|
+
name: "day",
|
|
103
|
+
type: "number",
|
|
104
|
+
displayOptions: {
|
|
105
|
+
show: {
|
|
106
|
+
resource: ["numerology"],
|
|
107
|
+
operation: allOperations,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
default: 1,
|
|
111
|
+
placeholder: "e.g. 15",
|
|
112
|
+
typeOptions: {
|
|
113
|
+
minValue: 1,
|
|
114
|
+
maxValue: 31,
|
|
115
|
+
},
|
|
116
|
+
description: "Birth day of month (1-31)",
|
|
117
|
+
required: true,
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Second subject fields for compatibility
|
|
121
|
+
*/
|
|
122
|
+
const subject2NoticeField = {
|
|
123
|
+
displayName: "Second Person Data",
|
|
124
|
+
name: "subject2Notice",
|
|
125
|
+
type: "notice",
|
|
126
|
+
displayOptions: {
|
|
127
|
+
show: {
|
|
128
|
+
resource: ["numerology"],
|
|
129
|
+
operation: compatibilityOperations,
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
default: "",
|
|
133
|
+
};
|
|
134
|
+
const subject2NameField = {
|
|
135
|
+
displayName: "Second Person Name",
|
|
136
|
+
name: "subject2Name",
|
|
137
|
+
type: "string",
|
|
138
|
+
displayOptions: {
|
|
139
|
+
show: {
|
|
140
|
+
resource: ["numerology"],
|
|
141
|
+
operation: compatibilityOperations,
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
default: "",
|
|
145
|
+
placeholder: "e.g. Jane Elizabeth Smith",
|
|
146
|
+
description: "Full birth name for the second person",
|
|
147
|
+
required: true,
|
|
148
|
+
};
|
|
149
|
+
const subject2YearField = {
|
|
150
|
+
displayName: "Birth Year (Subject 2)",
|
|
151
|
+
name: "subject2Year",
|
|
152
|
+
type: "number",
|
|
153
|
+
displayOptions: {
|
|
154
|
+
show: {
|
|
155
|
+
resource: ["numerology"],
|
|
156
|
+
operation: compatibilityOperations,
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
default: 1990,
|
|
160
|
+
placeholder: "e.g. 1992",
|
|
161
|
+
description: "Birth year of the second person",
|
|
162
|
+
required: true,
|
|
163
|
+
};
|
|
164
|
+
const subject2MonthField = {
|
|
165
|
+
displayName: "Birth Month (Subject 2)",
|
|
166
|
+
name: "subject2Month",
|
|
167
|
+
type: "number",
|
|
168
|
+
displayOptions: {
|
|
169
|
+
show: {
|
|
170
|
+
resource: ["numerology"],
|
|
171
|
+
operation: compatibilityOperations,
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
default: 1,
|
|
175
|
+
placeholder: "e.g. 8",
|
|
176
|
+
typeOptions: {
|
|
177
|
+
minValue: 1,
|
|
178
|
+
maxValue: 12,
|
|
179
|
+
},
|
|
180
|
+
description: "Birth month of the second person (1-12)",
|
|
181
|
+
required: true,
|
|
182
|
+
};
|
|
183
|
+
const subject2DayField = {
|
|
184
|
+
displayName: "Birth Day (Subject 2)",
|
|
185
|
+
name: "subject2Day",
|
|
186
|
+
type: "number",
|
|
187
|
+
displayOptions: {
|
|
188
|
+
show: {
|
|
189
|
+
resource: ["numerology"],
|
|
190
|
+
operation: compatibilityOperations,
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
default: 1,
|
|
194
|
+
placeholder: "e.g. 22",
|
|
195
|
+
typeOptions: {
|
|
196
|
+
minValue: 1,
|
|
197
|
+
maxValue: 31,
|
|
198
|
+
},
|
|
199
|
+
description: "Birth day of the second person (1-31)",
|
|
200
|
+
required: true,
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* Simplify output toggle for Numerology
|
|
204
|
+
*/
|
|
205
|
+
const simplifyField = {
|
|
206
|
+
displayName: "Simplify",
|
|
207
|
+
name: "simplify",
|
|
208
|
+
type: "boolean",
|
|
209
|
+
displayOptions: {
|
|
210
|
+
show: {
|
|
211
|
+
resource: ["numerology"],
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
default: true,
|
|
215
|
+
description: "Whether to return simplified response with key data only. Disable for full API response.",
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* All properties for the Numerology resource
|
|
219
|
+
*/
|
|
220
|
+
exports.numerologyOperations = [
|
|
221
|
+
// Operation selector
|
|
222
|
+
numerologyOperationField,
|
|
223
|
+
// First subject data
|
|
224
|
+
subjectNameField,
|
|
225
|
+
birthYearField,
|
|
226
|
+
birthMonthField,
|
|
227
|
+
birthDayField,
|
|
228
|
+
// Second subject data (for compatibility)
|
|
229
|
+
subject2NoticeField,
|
|
230
|
+
subject2NameField,
|
|
231
|
+
subject2YearField,
|
|
232
|
+
subject2MonthField,
|
|
233
|
+
subject2DayField,
|
|
234
|
+
// Options
|
|
235
|
+
(0, shared_1.createLanguageField)("numerology"),
|
|
236
|
+
(0, shared_1.createIncludeInterpretationsField)("numerology"),
|
|
237
|
+
// Simplify output
|
|
238
|
+
simplifyField,
|
|
239
|
+
];
|
|
@@ -26,6 +26,16 @@ exports.resourceField = {
|
|
|
26
26
|
value: "horoscope",
|
|
27
27
|
description: "Generate horoscope predictions by zodiac sign or personalized by birth data (daily, weekly, monthly, yearly)",
|
|
28
28
|
},
|
|
29
|
+
{
|
|
30
|
+
name: "Human Design",
|
|
31
|
+
value: "humanDesign",
|
|
32
|
+
description: "Human Design System calculations: BodyGraph, type/strategy/authority, channels, gates, and compatibility analysis",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "Numerology",
|
|
36
|
+
value: "numerology",
|
|
37
|
+
description: "Numerology calculations: Life Path, Expression, Soul Urge numbers, comprehensive readings, and compatibility analysis",
|
|
38
|
+
},
|
|
29
39
|
],
|
|
30
40
|
default: "data",
|
|
31
41
|
};
|
|
@@ -4,4 +4,6 @@ export { zodiacSignOptions, createZodiacSignField, traditionOptions, createTradi
|
|
|
4
4
|
export { createSecondSubjectFields } from "./secondSubject.fields";
|
|
5
5
|
export { createTransitTimeFields } from "./transitTime.fields";
|
|
6
6
|
export { createDateRangeFields } from "./dateRange.fields";
|
|
7
|
+
export { createNameField, createSecondSubjectNameField } from "./name.fields";
|
|
8
|
+
export { languageOptions, createLanguageField, createIncludeInterpretationsField, } from "./language.fields";
|
|
7
9
|
export { buildBirthData, makeApiRequest, createSubjectRequest, simplifyResponse, } from "./helpers";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.simplifyResponse = exports.createSubjectRequest = exports.makeApiRequest = exports.buildBirthData = exports.createDateRangeFields = exports.createTransitTimeFields = exports.createSecondSubjectFields = exports.createTraditionField = exports.traditionOptions = exports.createZodiacSignField = exports.zodiacSignOptions = exports.createLocationFields = exports.createBirthDataFields = void 0;
|
|
3
|
+
exports.simplifyResponse = exports.createSubjectRequest = exports.makeApiRequest = exports.buildBirthData = exports.createIncludeInterpretationsField = exports.createLanguageField = exports.languageOptions = exports.createSecondSubjectNameField = exports.createNameField = exports.createDateRangeFields = exports.createTransitTimeFields = exports.createSecondSubjectFields = exports.createTraditionField = exports.traditionOptions = exports.createZodiacSignField = exports.zodiacSignOptions = exports.createLocationFields = exports.createBirthDataFields = void 0;
|
|
4
4
|
// Shared field creators
|
|
5
5
|
var birthData_fields_1 = require("./birthData.fields");
|
|
6
6
|
Object.defineProperty(exports, "createBirthDataFields", { enumerable: true, get: function () { return birthData_fields_1.createBirthDataFields; } });
|
|
@@ -17,6 +17,13 @@ var transitTime_fields_1 = require("./transitTime.fields");
|
|
|
17
17
|
Object.defineProperty(exports, "createTransitTimeFields", { enumerable: true, get: function () { return transitTime_fields_1.createTransitTimeFields; } });
|
|
18
18
|
var dateRange_fields_1 = require("./dateRange.fields");
|
|
19
19
|
Object.defineProperty(exports, "createDateRangeFields", { enumerable: true, get: function () { return dateRange_fields_1.createDateRangeFields; } });
|
|
20
|
+
var name_fields_1 = require("./name.fields");
|
|
21
|
+
Object.defineProperty(exports, "createNameField", { enumerable: true, get: function () { return name_fields_1.createNameField; } });
|
|
22
|
+
Object.defineProperty(exports, "createSecondSubjectNameField", { enumerable: true, get: function () { return name_fields_1.createSecondSubjectNameField; } });
|
|
23
|
+
var language_fields_1 = require("./language.fields");
|
|
24
|
+
Object.defineProperty(exports, "languageOptions", { enumerable: true, get: function () { return language_fields_1.languageOptions; } });
|
|
25
|
+
Object.defineProperty(exports, "createLanguageField", { enumerable: true, get: function () { return language_fields_1.createLanguageField; } });
|
|
26
|
+
Object.defineProperty(exports, "createIncludeInterpretationsField", { enumerable: true, get: function () { return language_fields_1.createIncludeInterpretationsField; } });
|
|
20
27
|
// Helper functions
|
|
21
28
|
var helpers_1 = require("./helpers");
|
|
22
29
|
Object.defineProperty(exports, "buildBirthData", { enumerable: true, get: function () { return helpers_1.buildBirthData; } });
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { INodeProperties } from "n8n-workflow";
|
|
2
|
+
/**
|
|
3
|
+
* Language options for API responses
|
|
4
|
+
*/
|
|
5
|
+
export declare const languageOptions: INodeProperties["options"];
|
|
6
|
+
/**
|
|
7
|
+
* Creates a language selection field
|
|
8
|
+
*
|
|
9
|
+
* @param resourceName - The resource value to show this field for
|
|
10
|
+
* @param showForOperations - Operations that should show this field (optional)
|
|
11
|
+
* @param hideForOperations - Operations that should hide this field (optional)
|
|
12
|
+
*/
|
|
13
|
+
export declare function createLanguageField(resourceName: string, showForOperations?: string[], hideForOperations?: string[]): INodeProperties;
|
|
14
|
+
/**
|
|
15
|
+
* Creates an include interpretations toggle field
|
|
16
|
+
*
|
|
17
|
+
* @param resourceName - The resource value to show this field for
|
|
18
|
+
* @param showForOperations - Operations that should show this field (optional)
|
|
19
|
+
* @param hideForOperations - Operations that should hide this field (optional)
|
|
20
|
+
*/
|
|
21
|
+
export declare function createIncludeInterpretationsField(resourceName: string, showForOperations?: string[], hideForOperations?: string[]): INodeProperties;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.languageOptions = void 0;
|
|
4
|
+
exports.createLanguageField = createLanguageField;
|
|
5
|
+
exports.createIncludeInterpretationsField = createIncludeInterpretationsField;
|
|
6
|
+
/**
|
|
7
|
+
* Language options for API responses
|
|
8
|
+
*/
|
|
9
|
+
exports.languageOptions = [
|
|
10
|
+
{ name: "English", value: "en" },
|
|
11
|
+
{ name: "Russian", value: "ru" },
|
|
12
|
+
{ name: "German", value: "de" },
|
|
13
|
+
{ name: "Spanish", value: "es" },
|
|
14
|
+
{ name: "French", value: "fr" },
|
|
15
|
+
{ name: "Italian", value: "it" },
|
|
16
|
+
{ name: "Portuguese", value: "pt" },
|
|
17
|
+
{ name: "Chinese", value: "zh" },
|
|
18
|
+
{ name: "Japanese", value: "ja" },
|
|
19
|
+
{ name: "Korean", value: "ko" },
|
|
20
|
+
];
|
|
21
|
+
/**
|
|
22
|
+
* Creates a language selection field
|
|
23
|
+
*
|
|
24
|
+
* @param resourceName - The resource value to show this field for
|
|
25
|
+
* @param showForOperations - Operations that should show this field (optional)
|
|
26
|
+
* @param hideForOperations - Operations that should hide this field (optional)
|
|
27
|
+
*/
|
|
28
|
+
function createLanguageField(resourceName, showForOperations, hideForOperations) {
|
|
29
|
+
const baseDisplayOptions = {
|
|
30
|
+
show: {
|
|
31
|
+
resource: [resourceName],
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
if (showForOperations && showForOperations.length > 0) {
|
|
35
|
+
baseDisplayOptions.show.operation = showForOperations;
|
|
36
|
+
}
|
|
37
|
+
if (hideForOperations && hideForOperations.length > 0) {
|
|
38
|
+
baseDisplayOptions.hide = {
|
|
39
|
+
operation: hideForOperations,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
displayName: "Language",
|
|
44
|
+
name: "language",
|
|
45
|
+
type: "options",
|
|
46
|
+
displayOptions: baseDisplayOptions,
|
|
47
|
+
options: exports.languageOptions,
|
|
48
|
+
default: "en",
|
|
49
|
+
description: "Language for response text and interpretations",
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Creates an include interpretations toggle field
|
|
54
|
+
*
|
|
55
|
+
* @param resourceName - The resource value to show this field for
|
|
56
|
+
* @param showForOperations - Operations that should show this field (optional)
|
|
57
|
+
* @param hideForOperations - Operations that should hide this field (optional)
|
|
58
|
+
*/
|
|
59
|
+
function createIncludeInterpretationsField(resourceName, showForOperations, hideForOperations) {
|
|
60
|
+
const baseDisplayOptions = {
|
|
61
|
+
show: {
|
|
62
|
+
resource: [resourceName],
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
if (showForOperations && showForOperations.length > 0) {
|
|
66
|
+
baseDisplayOptions.show.operation = showForOperations;
|
|
67
|
+
}
|
|
68
|
+
if (hideForOperations && hideForOperations.length > 0) {
|
|
69
|
+
baseDisplayOptions.hide = {
|
|
70
|
+
operation: hideForOperations,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
displayName: "Include Interpretations",
|
|
75
|
+
name: "includeInterpretations",
|
|
76
|
+
type: "boolean",
|
|
77
|
+
displayOptions: baseDisplayOptions,
|
|
78
|
+
default: true,
|
|
79
|
+
description: "Whether to include textual interpretations in the response",
|
|
80
|
+
};
|
|
81
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { INodeProperties } from "n8n-workflow";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a name field for numerology calculations
|
|
4
|
+
*
|
|
5
|
+
* @param resourceName - The resource value to show this field for
|
|
6
|
+
* @param showForOperations - Operations that should show this field (optional)
|
|
7
|
+
* @param hideForOperations - Operations that should hide this field (optional)
|
|
8
|
+
*/
|
|
9
|
+
export declare function createNameField(resourceName: string, showForOperations?: string[], hideForOperations?: string[]): INodeProperties;
|
|
10
|
+
/**
|
|
11
|
+
* Creates a second subject name field for compatibility operations
|
|
12
|
+
*
|
|
13
|
+
* @param resourceName - The resource value to show this field for
|
|
14
|
+
* @param showForOperations - Operations that should show this field (optional)
|
|
15
|
+
*/
|
|
16
|
+
export declare function createSecondSubjectNameField(resourceName: string, showForOperations?: string[]): INodeProperties;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createNameField = createNameField;
|
|
4
|
+
exports.createSecondSubjectNameField = createSecondSubjectNameField;
|
|
5
|
+
/**
|
|
6
|
+
* Creates a name field for numerology calculations
|
|
7
|
+
*
|
|
8
|
+
* @param resourceName - The resource value to show this field for
|
|
9
|
+
* @param showForOperations - Operations that should show this field (optional)
|
|
10
|
+
* @param hideForOperations - Operations that should hide this field (optional)
|
|
11
|
+
*/
|
|
12
|
+
function createNameField(resourceName, showForOperations, hideForOperations) {
|
|
13
|
+
const baseDisplayOptions = {
|
|
14
|
+
show: {
|
|
15
|
+
resource: [resourceName],
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
if (showForOperations && showForOperations.length > 0) {
|
|
19
|
+
baseDisplayOptions.show.operation = showForOperations;
|
|
20
|
+
}
|
|
21
|
+
if (hideForOperations && hideForOperations.length > 0) {
|
|
22
|
+
baseDisplayOptions.hide = {
|
|
23
|
+
operation: hideForOperations,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
displayName: "Full Name",
|
|
28
|
+
name: "subjectName",
|
|
29
|
+
type: "string",
|
|
30
|
+
displayOptions: baseDisplayOptions,
|
|
31
|
+
default: "",
|
|
32
|
+
placeholder: "e.g. John Doe",
|
|
33
|
+
description: "Full name for numerology calculations (required for name-based numbers)",
|
|
34
|
+
required: true,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Creates a second subject name field for compatibility operations
|
|
39
|
+
*
|
|
40
|
+
* @param resourceName - The resource value to show this field for
|
|
41
|
+
* @param showForOperations - Operations that should show this field (optional)
|
|
42
|
+
*/
|
|
43
|
+
function createSecondSubjectNameField(resourceName, showForOperations) {
|
|
44
|
+
const displayOptions = {
|
|
45
|
+
show: {
|
|
46
|
+
resource: [resourceName],
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
if (showForOperations && showForOperations.length > 0) {
|
|
50
|
+
displayOptions.show.operation = showForOperations;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
displayName: "Second Person Name",
|
|
54
|
+
name: "subject2Name",
|
|
55
|
+
type: "string",
|
|
56
|
+
displayOptions,
|
|
57
|
+
default: "",
|
|
58
|
+
placeholder: "e.g. Jane Smith",
|
|
59
|
+
description: "Full name for the second person (required for compatibility)",
|
|
60
|
+
required: true,
|
|
61
|
+
};
|
|
62
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astro-api/n8n-nodes-astrology",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "n8n community node for Astrology API - professional astrological calculations, charts, horoscopes, and interpretations",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|