n8n-nodes-vh3ai 0.4.0 → 0.5.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/README.md CHANGED
@@ -1,19 +1,21 @@
1
1
  # n8n-nodes-vh3ai
2
2
 
3
- Community node for [n8n](https://n8n.io/) that integrates with the [VH3 AI](https://vh3.ai) field service management API.
3
+ Community node for [n8n](https://n8n.io/) that integrates with the [VH3 AI](https://vh3.ai) field service management platform.
4
4
 
5
- This package provides two nodes:
5
+ This package provides two nodes that share a single credential type:
6
6
 
7
- - **VH3 AI** — BigChange proxy operations for jobs, contacts, resources, vehicles, and worksheets
8
- - **VH3 AI PRO** — AI-powered Field Service Intelligence (FSI) operations for enriched job feeds, operational reports, and email processing
7
+ - **VH3 AI** — operations against the BigChange-backed VH3 Connect API (jobs, contacts, engineers, vehicles, worksheets, invoices, quotes, notes, persons, job groups, stock, reference data).
8
+ - **VH3 AI PRO** — AI-powered Field Service Intelligence (FSI) operations: enriched job feed, search and investigation, agent chat (Connie), email triage and ingestion, sentinels, cases, weather, intelligence profiles, and more.
9
9
 
10
- Both nodes connect through the VH3 Connect gateway at `api.vh3connect.io`.
10
+ Both nodes are marked `usableAsTool: true` so they can be called directly by n8n AI agents.
11
+
12
+ ---
11
13
 
12
14
  ## Installation
13
15
 
14
16
  ### Self-hosted n8n
15
17
 
16
- Go to **Settings > Community Nodes**, click **Install**, and enter:
18
+ Go to **Settings → Community Nodes**, click **Install**, and enter:
17
19
 
18
20
  ```
19
21
  n8n-nodes-vh3ai
@@ -38,173 +40,157 @@ npm link n8n-nodes-vh3ai
38
40
  n8n start
39
41
  ```
40
42
 
43
+ ---
44
+
41
45
  ## Credentials
42
46
 
47
+ Both nodes use the **VH3 AI API** credential type:
48
+
43
49
  | Field | Description | Default |
44
50
  | ------------ | ----------------------------------------------------- | -------------------------------------------- |
45
51
  | API Key | Your VH3 API key (issued by VH3 AI) | — |
46
- | Company ID | Your tenant/company ID | — |
52
+ | Company ID | Your tenant / company ID | — |
47
53
  | Base URL | VH3 Connect gateway URL | `https://api.vh3connect.io` |
48
- | FSI Base URL | VH3 Field Service Intelligence API (Xano proxy) | `https://api.vh3connect.io/api:kP8T1CK7` |
54
+ | FSI Base URL | VH3 Field Service Intelligence API (Xano proxy) | `https://api.vh3connect.io/api:kP8T1CK7` |
49
55
 
50
- - **VH3 AI node**: authenticates via `X-API-KEY` header on every request.
51
- - **VH3 AI PRO node**: authenticates by injecting `company_id` and `api_key` as body/query parameters (no header auth). The Xano proxy handles the auth check server-side.
56
+ - **VH3 AI**: authenticates via `X-API-KEY` header on every request.
57
+ - **VH3 AI PRO**: injects `company_id` and `api_key` into the body or query string (no header auth). The Xano proxy validates server-side.
52
58
 
53
59
  ---
54
60
 
55
61
  ## VH3 AI — Resources & Operations
56
62
 
57
- ### Job
58
-
59
- | Operation | Description |
60
- | --------- | ----------- |
61
- | **Get Job** | Full details for a single job including worksheets, assigned engineer, and status history |
62
- | **List Jobs** | Search jobs with filters for status, date range, job type, contact, resource, and reference |
63
-
64
- ### Contact
65
-
66
- | Operation | Description |
67
- | --------- | ----------- |
68
- | **Get Contact** | Full details for a single contact (customer or site) |
69
- | **List Contacts** | Paginated list of contacts (sites/customers) with date filtering |
70
- | **List Contact Groups** | Retrieve all contact groups |
71
-
72
- ### Resource (Engineer)
73
-
74
- | Operation | Description |
75
- | --------- | ----------- |
76
- | **List Resources** | All engineers and technicians available for job assignments |
77
- | **List Resource Groups** | Retrieve all resource groups (teams) |
78
-
79
- ### Job Type
63
+ | Resource | Operations |
64
+ | --- | --- |
65
+ | **Job** | List Jobs · Get Job · Get Job by ID · Create Job · Edit Job · Cancel Job · Schedule Job · Start Job · Set Job Result · List Job Status History · Create / Delete / List Job Constraints · Create / List Job Stock |
66
+ | **Contact** | List Contacts · Get Contact · Create / Edit Contact · Stop / Unstop Contact · List Contact Groups · Get / Create / Update Contact Group |
67
+ | **Resource (Engineer)** | List Resources · Get Resource · Create / Update Resource · List Resource Groups · Get Resource Group |
68
+ | **Vehicle** | List Vehicles · Get / Create / Update Vehicle |
69
+ | **Worksheet** | List Worksheet Definitions · Get Worksheet · Get Worksheet Questions · List Worksheet Answers |
70
+ | **Worksheet Group** | List · Get |
71
+ | **Invoice** | List Invoices · Get Invoice · Create / Edit Invoice · Cancel Invoice · Mark Invoice Sent / Paid · List Invoice Line Items · Create / Delete Invoice Line Item |
72
+ | **Quote** | List Quotes · Get Quote · Create / Edit Quote · Mark Quote Sent / Accepted / Rejected · List Quote Line Items · Get / Create / Edit / Delete Quote Line Item |
73
+ | **Note** | List Notes · Get Note · Create / Edit Note · Create Progress Update · List Note Types |
74
+ | **Person** | List Persons · Get Person · Create / Edit Person |
75
+ | **Job Group** | List Job Groups · Get Job Group · Create / Edit Job Group · Mark Complete · Mark Financially Complete · List Status History |
76
+ | **Stock** | List Product Categories · List / Get / Create / Update Stock Details · List / Get / Create / Update Stock Item · List Stock Movements · List Stock Suppliers |
77
+ | **Reference Data** | List Department Codes · List Nominal Codes |
80
78
 
81
- | Operation | Description |
82
- | --------- | ----------- |
83
- | **List Job Types** | All job type definitions (installation, repair, maintenance, etc.) with custom field schemas |
79
+ ### Simplify switch
84
80
 
85
- ### Vehicle
81
+ Operations whose API endpoints support server-side response compaction expose a top-level **Simplify** boolean (Gmail-style, default ON). When ON, the node sends `compact=true` and the API returns LLM-optimised payloads (empty values stripped, nested structures flattened).
86
82
 
87
- | Operation | Description |
88
- | --------- | ----------- |
89
- | **List Vehicles** | All fleet vehicles including registration, make, model, and assignment details |
83
+ Currently surfaced on:
90
84
 
91
- ### Worksheet
85
+ - **Job** → List Jobs, Get Job by ID
86
+ - **Contact** → List Contacts, Get Contact
92
87
 
93
- | Operation | Description |
94
- | --------- | ----------- |
95
- | **List Worksheet Definitions** | All worksheet form templates and question schemas |
96
- | **List Worksheet Answers** | Completed worksheet answers for specific jobs (inspection data, safety checks, parts, signatures) |
88
+ Coverage will expand as the API team enables `compact` on more endpoints — see [`docs/vh3-compact-backlog.md`](docs/vh3-compact-backlog.md) for the backlog.
97
89
 
98
90
  ---
99
91
 
100
92
  ## VH3 AI PRO — Resources & Operations
101
93
 
102
- ### Agent
94
+ | Resource | Operations |
95
+ | --- | --- |
96
+ | **Account Report** | Generate Account Report (monthly account review for a contact) |
97
+ | **Agent** | Chat with Connie · Agent Search (NL search returning job objects) · Agent Ask (NL Q&A via the Weaviate Query Agent) |
98
+ | **Briefing** | Generate Briefing (engineer pre-visit briefing and call script) |
99
+ | **Cases** | Create / Get / Update / Search / List Cases · Transition Case (lifecycle status change) · Add Comment · List Activity · List / Add / Remove Case Items · Add / Remove Participants · List Cases for Item (reverse lookup by external item) |
100
+ | **Connie** | Chat · Voice Chat · Generate Summary (contact summary) · Search History · List Sessions · Get Session Messages |
101
+ | **Email** | Classify Email · Ingest Email · List Triage Categories |
102
+ | **Intelligence** | List Profiles (with **Profiled Only** filter, default ON) · Get Profile · Generate Profiles |
103
+ | **Investigate** | Run Investigation (multi-step hybrid investigation across vector + graph data) |
104
+ | **Job Feed** | List Job Feed · Get Enriched Job · Aggregate Jobs (metrics with grouping, time-axis control, period-over-period comparison) |
105
+ | **Pulse** | Get Pulse (cached business-health dashboard snapshot for the tenant) |
106
+ | **Report** | Generate Report (now accepts a `sections` parameter to scope the output) · List Report Sections |
107
+ | **Search** | Autocomplete · Search Outcomes · Search Intake · Search Intake (Basic) — non-enriched variant |
108
+ | **Sentinel** | Run Sentinels (all or single by ID) · List Sentinel Registry · Get Latest Results |
109
+ | **Weather** | Get Weather for Job · Get Weather for Site · Get Forecast · Get Historical |
103
110
 
104
- | Operation | Description |
105
- | --------- | ----------- |
106
- | **Chat with Connie** | AI-powered operations intelligence agent with multi-turn conversation and contextual tool use. Queries jobs, engineers, sites, and operational metrics from the knowledge graph. |
111
+ ### Agent operations
107
112
 
108
- All agent operations share the same interface:
113
+ The legacy **Chat with Connie** operation derives its endpoint dynamically from the operation value, which keeps the agent registry extensible. **Agent Search** and **Agent Ask** are explicit operations against the dedicated `/agent/search` and `/agent/ask` endpoints.
109
114
 
110
- - **Message** (required) — the user message to send to the agent
111
- - **Experimental Mode** (boolean, default off) — toggles between the production and experimental pipeline variant. When enabled, routes to `/{agent}/experimental/chat` instead of `/{agent}/chat`.
112
- - **Additional Fields** — session ID (for multi-turn), user ID, user name, user company name, customer summary, contact ID, current job reference
115
+ **Connie** has a dedicated resource for richer scenarios beyond chat: voice chat, contact summaries, conversation-history search, session listing, and per-session message retrieval.
113
116
 
114
- The agent handler derives the endpoint path dynamically from the operation value, so adding a new agent requires only one dropdown option — no handler code changes.
117
+ ### Email operations
115
118
 
116
- ### Email
119
+ **Classify Email** and **Ingest Email** both support an optional **Attachment Source** (None / From URL / From Binary Data):
117
120
 
118
- | Operation | Description |
119
- | --------- | ----------- |
120
- | **Classify Email** | Classify an incoming email using the AI triage pipeline. Returns category, urgency, sentiment, and routing decision using a configurable taxonomy. |
121
- | **Ingest Email** | Extract structured job data from an FM portal email and resolve entities. Parses email content, intelligently matches Customer/Site/JobType, classifies job type, evaluates confidence, and either auto-creates the job or queues it for review. |
121
+ - **From URL** — passes `{ filename, url, mimeType }` to the backend for server-side fetch.
122
+ - **From Binary Data** — reads the n8n binary buffer, base64-encodes it, sends `{ filename, contentBase64, mimeType }`.
123
+ - **None** — sends `attachments: []`.
122
124
 
123
- Both email operations support an optional **Attachment Source** (None / From URL / From Binary Data):
125
+ The Ingest Email operation also accepts **Preferred Type IDs** (comma-separated integers) for extraction weighting.
124
126
 
125
- - **From URL** — passes `{ filename, url, mimeType }` to the backend for server-side fetch
126
- - **From Binary Data** — reads n8n binary data, base64-encodes, sends `{ filename, contentBase64, mimeType }`
127
- - **None** — sends `attachments: []`
127
+ **List Triage Categories** returns the available triage categories used by Classify Email.
128
128
 
129
- The Ingest Email operation also accepts **Preferred Type IDs** (comma-separated integers) for extraction weighting.
129
+ ### Search operations
130
+
131
+ All four search operations return **one n8n item per result** — the upstream wrapper envelopes (`{ hits, count }` from semantic search and `{ results, query, count }` from autocomplete) are unwrapped at the node layer so downstream nodes can iterate naturally without an extra Split Out step.
130
132
 
131
- ### Job Feed
133
+ #### Autocomplete
132
134
 
133
- | Operation | Description |
134
- | --------- | ----------- |
135
- | **Aggregate Jobs** | Compute job metrics (count, completion rate, first-visit fix rate, avg delays) with grouping, time-axis control, and period-over-period comparison. |
136
- | **Get Enriched Job** | Single enriched job by ID with full FSI context. |
137
- | **List Job Feed** | AI-enriched job feed with filters for status, result, contact, resource, type, and category. Supports auto-pagination. |
135
+ - **Filter by Type** (multi-select) — constrain results to `customer`, `engineer`, `job`, and/or `site`. Default empty (returns all). Particularly useful when the node is being called as an AI agent tool — the agent can scope the search in a single call instead of post-processing mixed hits.
138
136
 
139
- ### Report
137
+ #### Search Outcomes / Search Intake / Search Intake (Basic)
140
138
 
141
- | Operation | Description |
142
- | --------- | ----------- |
143
- | **Generate Report** | Generate an operational report (daily, weekly, monthly) with optional AI narrative. |
144
- | **List Report Sections** | Available report section definitions. |
139
+ These three semantic search operations all support a **client-side date filter** applied after the API response:
145
140
 
146
- ### Search
141
+ - **Date From** / **Date To** — explicit ISO date bounds.
142
+ - **Max Age (Months)** — convenience int (defaults to 6) that's equivalent to "Date From = now − N months". Ignored if Date From is also set.
147
143
 
148
- | Operation | Description |
149
- | --------- | ----------- |
150
- | **Autocomplete** | Fast fuzzy search across customers, engineers, jobs, and sites. Ideal for type-ahead lookups. |
151
- | **Search Outcomes** | Search job outcome and diagnostic summaries using natural language. Supports filtering by type, category, resource, contact, and site. |
152
- | **Search Intake** | Search intake descriptions with enriched job context using natural language. Same filter options as Search Outcomes. |
144
+ The filter looks at `actualStartAt` first, then falls back through `actualEndAt`, `createdAt`, `created_at`, `plannedStartAt`, `scheduledAt`, and nested `job.*` variants. Items that don't expose any timestamp are kept rather than silently dropped.
153
145
 
154
- ### Sentinel
146
+ ### Intelligence — Profiled Only
155
147
 
156
- Proactive early-warning system — 12 deterministic checks that detect operational issues before they escalate. Pure database reads, zero LLM cost.
148
+ `List Profiles` exposes a **Profiled Only** boolean (default ON). When ON, the API filters out items whose `profile` is null — only types with a generated profile are returned. The filter runs server-side via `profiled_only=true` on `/intelligence/profiles/{company_id}`.
157
149
 
158
- | Operation | Description |
159
- | --------- | ----------- |
160
- | **Run All Sentinels** | Run all (or selected) sentinel checks for your tenant. Returns only triggered alerts — empty means all clear. |
161
- | **Run Single Sentinel** | Run a specific sentinel by ID (dropdown of all 12). |
162
- | **List Sentinel Registry** | List all sentinel definitions with thresholds, categories, and recommended run schedules. |
163
- | **Get Latest Results** | Retrieve cached results from the most recent sentinel run. |
150
+ ### Sentinels
164
151
 
165
- Available sentinels: Engineer Performance Slip, FVF Rate Drop, Workload Imbalance, Site Deterioration, Repeat Failure Escalation, New Problem Site, SLA Breach Cluster, Customer Risk Escalation, Customer Non-Complete Anomaly, Scheduling Accuracy Drift, Carryover Accumulation, Data Quality Alert.
152
+ The **Sentinel** resource runs proactive, deterministic checks (no LLM cost) against your tenant. The full set of available sentinels is exposed via **List Sentinel Registry**; common ones include Engineer Performance Slip, FVF Rate Drop, Workload Imbalance, Site Deterioration, Repeat Failure Escalation, New Problem Site, SLA Breach Cluster, Customer Risk Escalation, Customer Non-Complete Anomaly, Scheduling Accuracy Drift, Carryover Accumulation, and Data Quality Alert. Run Sentinels accepts either `all` or a specific Sentinel ID.
166
153
 
167
154
  ---
168
155
 
169
156
  ## Architecture & Patterns
170
157
 
171
- ### Parameter Casing Convention
158
+ ### Parameter casing
172
159
 
173
- The n8n UI uses **camelCase** field names (e.g. `emailBody`, `senderAddress`, `preferredTypeIds`). The handlers map these to **snake_case** API parameters (e.g. `email_body`, `sender_address`, `preferred_type_ids`) before sending to the Xano proxy, which forwards to FastAPI.
160
+ The n8n UI uses **camelCase** field names (e.g. `emailBody`, `senderAddress`, `preferredTypeIds`). The handlers map these to **snake_case** API parameters (`email_body`, `sender_address`, `preferred_type_ids`) before sending to the upstream API.
174
161
 
175
- ### FSI API Authentication
162
+ ### FSI API authentication
176
163
 
177
164
  The VH3 AI PRO node does **not** use the `X-API-KEY` header. Instead, `company_id` and `api_key` are injected directly:
165
+
178
166
  - **GET requests** — as query string parameters
179
- - **POST requests** — into the JSON body
167
+ - **POST / PATCH / DELETE requests** — into the JSON body
180
168
 
181
- This is handled by `vh3FsiGetRequest` and `vh3FsiPostRequest` in `GenericFunctions.ts`.
169
+ Handled by `vh3FsiGetRequest`, `vh3FsiPostRequest`, `vh3FsiPatchRequest`, and `vh3FsiDeleteRequest` in `nodes/Vh3AiPro/GenericFunctions.ts`.
182
170
 
183
- ### Attachment Handling
171
+ ### Attachment handling
184
172
 
185
- Both email operations share the `buildAttachments()` helper from `GenericFunctions.ts`:
173
+ Both email operations share `buildAttachments()` from `GenericFunctions.ts`:
186
174
 
187
- 1. Reads `attachmentSource` parameter from the n8n UI
188
- 2. For **URL mode**: constructs `{ filename, url, mimeType }` — no download on n8n side, backend fetches server-side
189
- 3. For **Binary mode**: reads binary data buffer, base64-encodes, constructs `{ filename, contentBase64, mimeType }`
190
- 4. Returns `[]` when no attachment is selected
175
+ 1. Reads `attachmentSource` from the n8n UI.
176
+ 2. **URL mode** — constructs `{ filename, url, mimeType }`. No download on the n8n side; the backend fetches server-side.
177
+ 3. **Binary mode** — reads the binary buffer, base64-encodes, constructs `{ filename, contentBase64, mimeType }`.
178
+ 4. Returns `[]` when no attachment is selected.
191
179
 
192
- The FastAPI `AttachmentInput` models on both endpoints accept `content_base64`, `url`, `mime_type`, and `filename` — either URL or base64 can be provided. File processing is a future scope item; the interface is ready.
180
+ ### Response normalisation
193
181
 
194
- ### Xano Proxy Input Types
182
+ - **VH3 AI (BigChange proxy)**: `extractItems()` automatically unwraps the three known envelope shapes (`{ response: { result: { items, pageItemCount } } }`, `{ result: { items, pageItemCount } }`, `{ items, pageItemCount }`) into a flat item array.
183
+ - **VH3 AI PRO (FSI search)**: semantic search and autocomplete responses are unwrapped to per-hit / per-result items at the node layer.
195
184
 
196
- List-type parameters (`attachments`, `preferred_type_ids`) must be defined as array types in Xano (e.g. `json[]?`, `int[]?`) — **not** `json`. Using plain `json` defaults unset inputs to `{}` (empty object) instead of `[]`/`null`, which causes FastAPI Pydantic validation failures.
185
+ ### Auto-pagination
197
186
 
198
- ---
187
+ List operations expose a **Return All** toggle. When ON, the node walks every page automatically (capped at 200 pages × the page size for safety).
199
188
 
200
- ## Features
189
+ ### AI tool compatibility
201
190
 
202
- - **Auto-pagination**: Toggle "Return All" to fetch every page automatically (capped at 20,000 items for safety)
203
- - **Rich filters**: Job listing supports status, date range, job type, contact, resource, and reference filters
204
- - **Enum dropdowns**: Job statuses, sort fields, and directions are presented as selectable options
205
- - **Response normalization**: Three BigChange envelope shapes are automatically unwrapped to flat item arrays
206
- - **AI tool compatible**: Both nodes are marked `usableAsTool` with rich descriptions for use with n8n AI agents
207
- - **Error context**: API errors include the endpoint that failed for easier debugging
191
+ Both nodes set `usableAsTool: true` with rich operation descriptions, so they can be exposed to n8n AI agents. The Filter by Type (autocomplete), Profiled Only (intelligence), and Simplify (compact) toggles were designed with the agent path in mind — they let an LLM constrain a tool call instead of post-processing mixed or oversized payloads.
192
+
193
+ ---
208
194
 
209
195
  ## Deployment & Hosting
210
196
 
@@ -215,12 +201,6 @@ VH3 operates n8n instances across two models:
215
201
  | **Managed Hosting** | VH3 deploys and hosts the n8n instance at `{customer}.n8n.vh3.ai`. Custom Docker image with VH3 nodes baked in, automated provisioning, backups, and updates. |
216
202
  | **BYOI (Bring Your Own Instance)** | Customer runs their own n8n (self-hosted or n8n Cloud), installs `n8n-nodes-vh3ai` via Community Nodes, and gives VH3 an API key for workflow support. |
217
203
 
218
- Both models use the same `n8nac` sync tooling (pull/edit/push/verify). Each instance gets its own subfolder under `workflows/`. Context switching between clients is handled by `scripts/n8n-switch.sh`.
219
-
220
- For details see:
221
- - [Developer Onboarding](docs/DEVELOPER-ONBOARDING.md) — setup, workflow sync, multi-instance access
222
- - [Managed Hosting Plan](docs/MANAGED-HOSTING-PLAN.md) — infrastructure, provisioning, backups, offboarding
223
-
224
204
  ---
225
205
 
226
206
  ## Compatibility
@@ -228,6 +208,10 @@ For details see:
228
208
  - n8n version: 1.0+
229
209
  - Node.js: 18.10+
230
210
 
211
+ ## Changelog
212
+
213
+ See [`CHANGELOG.md`](CHANGELOG.md) for release history.
214
+
231
215
  ## License
232
216
 
233
217
  MIT
@@ -6,6 +6,14 @@ import type { IExecuteFunctions, JsonObject } from 'n8n-workflow';
6
6
  * Shape B: { result: { items, pageItemCount } }
7
7
  * Shape C: { items, pageItemCount }
8
8
  */
9
+ /**
10
+ * Convert any date/datetime input (ISO 8601, locale string, Date object, epoch ms,
11
+ * or n8n dateTime field output like "2026-04-01 00:00:00") into the strict UTC
12
+ * format the VH3 API expects: YYYY-MM-DDTHH:MM:SSZ (no milliseconds).
13
+ *
14
+ * Returns undefined for empty/invalid input so callers can skip sending the field.
15
+ */
16
+ export declare function toUtcDateTime(value: unknown): string | undefined;
9
17
  export declare function extractItems(raw: JsonObject): {
10
18
  items: JsonObject[];
11
19
  pageItemCount: number;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toUtcDateTime = toUtcDateTime;
3
4
  exports.extractItems = extractItems;
4
5
  exports.vh3ListApiRequest = vh3ListApiRequest;
5
6
  exports.requireCompanyId = requireCompanyId;
@@ -16,6 +17,21 @@ const ENRICH_API_PREFIX = '/api:6q5N0phZ';
16
17
  * Shape B: { result: { items, pageItemCount } }
17
18
  * Shape C: { items, pageItemCount }
18
19
  */
20
+ /**
21
+ * Convert any date/datetime input (ISO 8601, locale string, Date object, epoch ms,
22
+ * or n8n dateTime field output like "2026-04-01 00:00:00") into the strict UTC
23
+ * format the VH3 API expects: YYYY-MM-DDTHH:MM:SSZ (no milliseconds).
24
+ *
25
+ * Returns undefined for empty/invalid input so callers can skip sending the field.
26
+ */
27
+ function toUtcDateTime(value) {
28
+ if (value === undefined || value === null || value === '')
29
+ return undefined;
30
+ const d = value instanceof Date ? value : new Date(value);
31
+ if (isNaN(d.getTime()))
32
+ return undefined;
33
+ return d.toISOString().replace(/\.\d{3}Z$/, 'Z');
34
+ }
19
35
  function extractItems(raw) {
20
36
  let result = raw;
21
37
  if (result.response && typeof result.response === 'object') {
@@ -1 +1 @@
1
- {"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../nodes/Vh3Ai/GenericFunctions.ts"],"names":[],"mappings":";;AAiBA,oCAeC;AAKD,8CAiCC;AAKD,4CAOC;AAKD,kDA2BC;AAKD,gDA2BC;AAOD,8DAuBC;AA3KD,+CAAgE;AAEhE,MAAM,eAAe,GAAG,eAAe,CAAC;AACxC,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAE1C;;;;;;GAMG;AACH,SAAgB,YAAY,CAAC,GAAe;IAC3C,IAAI,MAAM,GAAe,GAAG,CAAC;IAE7B,IAAI,MAAM,CAAC,QAAQ,IAAI,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC5D,MAAM,GAAG,MAAM,CAAC,QAAsB,CAAC;IACxC,CAAC;IACD,IAAI,MAAM,CAAC,MAAM,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QACxD,MAAM,GAAG,MAAM,CAAC,MAAoB,CAAC;IACtC,CAAC;IAED,MAAM,KAAK,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAiB,CAAC;IAChF,MAAM,aAAa,GAClB,OAAO,MAAM,CAAC,aAAa,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC;IAEhF,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;AACjC,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,iBAAiB,CAEtC,QA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