@thegraphitelab/n8n-nodes-servicetitan 0.14.0 → 0.14.1
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 +6 -5
- package/dist/nodes/ServiceTitan/v1/ServiceTitanTriggerV1.node.js +5 -2
- package/dist/nodes/ServiceTitan/v1/ServiceTitanTriggerV1.node.js.map +1 -1
- package/dist/nodes/ServiceTitan/v1/ServiceTitanV1.node.js +5 -2
- package/dist/nodes/ServiceTitan/v1/ServiceTitanV1.node.js.map +1 -1
- package/dist/nodes/ServiceTitan/v1/descriptions/node.description.js +5 -2
- package/dist/nodes/ServiceTitan/v1/descriptions/node.description.js.map +1 -1
- package/dist/nodes/ServiceTitan/v1/descriptions/trigger.description.js +5 -2
- package/dist/nodes/ServiceTitan/v1/descriptions/trigger.description.js.map +1 -1
- package/dist/nodes/ServiceTitan/v1/manifest.d.ts +1 -1
- package/dist/nodes/ServiceTitan/v1/manifest.js.map +1 -1
- package/dist/nodes/ServiceTitan/v1/transport/config.d.ts +1 -1
- package/dist/nodes/ServiceTitan/v1/transport/config.js +4 -0
- package/dist/nodes/ServiceTitan/v1/transport/config.js.map +1 -1
- package/dist/nodes/ServiceTitan/v1/transport/index.d.ts +1 -1
- package/dist/nodes/ServiceTitan/v1/transport/index.js +5 -2
- package/dist/nodes/ServiceTitan/v1/transport/index.js.map +1 -1
- package/dist/package.json +4 -1
- package/package.json +4 -1
- package/dist/nodes/core/factories/read/export.d.ts +0 -6
- package/dist/nodes/core/factories/read/export.js +0 -26
- package/dist/nodes/core/factories/read/export.js.map +0 -1
- package/dist/nodes/core/factories/read/filters.d.ts +0 -2
- package/dist/nodes/core/factories/read/filters.js +0 -14
- package/dist/nodes/core/factories/read/filters.js.map +0 -1
- package/dist/nodes/core/factories/read/get.d.ts +0 -7
- package/dist/nodes/core/factories/read/get.js +0 -41
- package/dist/nodes/core/factories/read/get.js.map +0 -1
- package/dist/nodes/core/factories/read/getArray.d.ts +0 -7
- package/dist/nodes/core/factories/read/getArray.js +0 -30
- package/dist/nodes/core/factories/read/getArray.js.map +0 -1
- package/dist/nodes/core/factories/read/getMany.d.ts +0 -7
- package/dist/nodes/core/factories/read/getMany.js +0 -33
- package/dist/nodes/core/factories/read/getMany.js.map +0 -1
- package/dist/nodes/core/factories/read/properties.d.ts +0 -17
- package/dist/nodes/core/factories/read/properties.js +0 -123
- package/dist/nodes/core/factories/read/properties.js.map +0 -1
- package/dist/nodes/core/factories/read/read.d.ts +0 -18
- package/dist/nodes/core/factories/read/read.js +0 -21
- package/dist/nodes/core/factories/read/read.js.map +0 -1
- package/dist/nodes/core/factories/router.d.ts +0 -5
- package/dist/nodes/core/factories/router.js +0 -31
- package/dist/nodes/core/factories/router.js.map +0 -1
- package/dist/nodes/core/factories/write/action.d.ts +0 -7
- package/dist/nodes/core/factories/write/action.js +0 -22
- package/dist/nodes/core/factories/write/action.js.map +0 -1
- package/dist/nodes/core/factories/write/delete.d.ts +0 -7
- package/dist/nodes/core/factories/write/delete.js +0 -33
- package/dist/nodes/core/factories/write/delete.js.map +0 -1
- package/dist/nodes/core/factories/write/poll.d.ts +0 -11
- package/dist/nodes/core/factories/write/poll.js +0 -206
- package/dist/nodes/core/factories/write/poll.js.map +0 -1
- package/dist/nodes/core/factories/write/utils.d.ts +0 -6
- package/dist/nodes/core/factories/write/utils.js +0 -65
- package/dist/nodes/core/factories/write/utils.js.map +0 -1
- package/dist/nodes/core/factories/write/write.d.ts +0 -7
- package/dist/nodes/core/factories/write/write.js +0 -217
- package/dist/nodes/core/factories/write/write.js.map +0 -1
- package/dist/nodes/core/helpers/array.d.ts +0 -1
- package/dist/nodes/core/helpers/array.js +0 -7
- package/dist/nodes/core/helpers/array.js.map +0 -1
- package/dist/nodes/core/helpers/customFields.d.ts +0 -13
- package/dist/nodes/core/helpers/customFields.js +0 -36
- package/dist/nodes/core/helpers/customFields.js.map +0 -1
- package/dist/nodes/core/helpers/reduce.d.ts +0 -5
- package/dist/nodes/core/helpers/reduce.js +0 -20
- package/dist/nodes/core/helpers/reduce.js.map +0 -1
- package/dist/nodes/core/helpers/string.d.ts +0 -2
- package/dist/nodes/core/helpers/string.js +0 -21
- package/dist/nodes/core/helpers/string.js.map +0 -1
- package/dist/nodes/core/manifest/getDescription.d.ts +0 -5
- package/dist/nodes/core/manifest/getDescription.js +0 -92
- package/dist/nodes/core/manifest/getDescription.js.map +0 -1
- package/dist/nodes/core/manifest/getExecute.d.ts +0 -6
- package/dist/nodes/core/manifest/getExecute.js +0 -89
- package/dist/nodes/core/manifest/getExecute.js.map +0 -1
- package/dist/nodes/core/manifest/getPoll.d.ts +0 -4
- package/dist/nodes/core/manifest/getPoll.js +0 -40
- package/dist/nodes/core/manifest/getPoll.js.map +0 -1
- package/dist/nodes/core/manifest/types.d.ts +0 -23
- package/dist/nodes/core/manifest/types.js +0 -3
- package/dist/nodes/core/manifest/types.js.map +0 -1
- package/dist/nodes/core/transport/constructRequest.d.ts +0 -2
- package/dist/nodes/core/transport/constructRequest.js +0 -21
- package/dist/nodes/core/transport/constructRequest.js.map +0 -1
- package/dist/nodes/core/transport/createTransport.d.ts +0 -21
- package/dist/nodes/core/transport/createTransport.js +0 -56
- package/dist/nodes/core/transport/createTransport.js.map +0 -1
- package/dist/nodes/core/types/separate.d.ts +0 -68
- package/dist/nodes/core/types/separate.js +0 -3
- package/dist/nodes/core/types/separate.js.map +0 -1
- package/dist/nodes/core/types/shared/dialect.d.ts +0 -16
- package/dist/nodes/core/types/shared/dialect.js +0 -3
- package/dist/nodes/core/types/shared/dialect.js.map +0 -1
- package/dist/nodes/core/types/shared/operation.d.ts +0 -76
- package/dist/nodes/core/types/shared/operation.js +0 -5
- package/dist/nodes/core/types/shared/operation.js.map +0 -1
- package/dist/nodes/core/types/shared/resource.d.ts +0 -19
- package/dist/nodes/core/types/shared/resource.js +0 -5
- package/dist/nodes/core/types/shared/resource.js.map +0 -1
- package/dist/nodes/core/types/shared/selection.d.ts +0 -9
- package/dist/nodes/core/types/shared/selection.js +0 -5
- package/dist/nodes/core/types/shared/selection.js.map +0 -1
- package/dist/nodes/core/types/shared/sourced.d.ts +0 -7
- package/dist/nodes/core/types/shared/sourced.js +0 -3
- package/dist/nodes/core/types/shared/sourced.js.map +0 -1
- package/dist/nodes/core/types/shared/trigger.d.ts +0 -21
- package/dist/nodes/core/types/shared/trigger.js +0 -5
- package/dist/nodes/core/types/shared/trigger.js.map +0 -1
package/README.md
CHANGED
|
@@ -67,13 +67,14 @@ Polling-based with `modifiedOnOrAfter` cursor and a boundary-id dedup set to avo
|
|
|
67
67
|
|
|
68
68
|
## Architecture
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
Manifest-driven. The shared engine lives in **[`@thegraphitelab/n8n-nodes-core`](../n8n-nodes-core/)** (a runtime dependency, pulled in automatically when n8n installs this package); this package supplies only ServiceTitan's specifics:
|
|
71
71
|
|
|
72
|
-
- `
|
|
73
|
-
- `
|
|
74
|
-
- `
|
|
72
|
+
- `nodes/ServiceTitan/v1/generated/manifests.ts` — the **generated** manifest: every resource/operation and trigger, each described declaratively by a `shape`. Build output from `n8n-codegen` — do not hand-edit.
|
|
73
|
+
- `nodes/ServiceTitan/v1/transport/config.ts` — the `TransportConfig` the engine reads: credential key, base URL, pagination/cursor rules, and `pathContext` (maps the credential's `tenantId` into the `{tenant}` path placeholder).
|
|
74
|
+
- `nodes/ServiceTitan/v1/*.node.ts` + `descriptions/` — the action and trigger node wrappers, which call the engine's `router` / `pollRouter` and `getActionProperties` / `getTriggerProperties`.
|
|
75
|
+
- `credentials/` — the ServiceTitan API credential.
|
|
75
76
|
|
|
76
|
-
|
|
77
|
+
The engine compiles the manifest into n8n operations, poll triggers, property descriptions, and the authenticated HTTP transport. Adding or refreshing coverage is a codegen regenerate + rebuild (see the [repo root README](../../README.md#how-the-nodes-are-generated)), not a hand-edit.
|
|
77
78
|
|
|
78
79
|
## Custom fields behavior
|
|
79
80
|
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ServiceTitanTriggerV1 = void 0;
|
|
4
|
-
|
|
4
|
+
/* eslint-disable @n8n/community-nodes/no-restricted-imports --
|
|
5
|
+
* This is the best solution to share core functionality across integrations
|
|
6
|
+
*/
|
|
7
|
+
const n8n_nodes_core_1 = require("@thegraphitelab/n8n-nodes-core");
|
|
5
8
|
const trigger_description_1 = require("./descriptions/trigger.description");
|
|
6
9
|
const methods_1 = require("./methods/methods");
|
|
7
10
|
const transport_1 = require("./transport");
|
|
@@ -17,7 +20,7 @@ class ServiceTitanTriggerV1 {
|
|
|
17
20
|
this.methods = methods_1.serviceTitanMethods;
|
|
18
21
|
}
|
|
19
22
|
async poll() {
|
|
20
|
-
return (0,
|
|
23
|
+
return (0, n8n_nodes_core_1.pollRouter)(this, manifest_1.serviceTitanV1Manifest, transport_1.serviceTitanTransport);
|
|
21
24
|
}
|
|
22
25
|
}
|
|
23
26
|
exports.ServiceTitanTriggerV1 = ServiceTitanTriggerV1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceTitanTriggerV1.node.js","sourceRoot":"","sources":["../../../../nodes/ServiceTitan/v1/ServiceTitanTriggerV1.node.ts"],"names":[],"mappings":";;;AAOA,
|
|
1
|
+
{"version":3,"file":"ServiceTitanTriggerV1.node.js","sourceRoot":"","sources":["../../../../nodes/ServiceTitan/v1/ServiceTitanTriggerV1.node.ts"],"names":[],"mappings":";;;AAOA;;GAEG;AACH,mEAA4D;AAC5D,4EAAwE;AACxE,+CAAwD;AACxD,2CAAoD;AACpD,yCAAoD;AAEpD;;0FAE0F;AAC1F,MAAa,qBAAqB;IAC9B,WAAW,CAAuB;IAElC,OAAO,CAAC;IAER,YAAY,eAAyC;QACjD,IAAI,CAAC,WAAW,GAAG,EAAE,GAAG,eAAe,EAAE,GAAG,wCAAkB,EAAE,CAAC;QACjE,IAAI,CAAC,OAAO,GAAG,6BAAmB,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,IAAI;QACN,OAAO,IAAA,2BAAU,EAAC,IAAI,EAAE,iCAAsB,EAAE,iCAAqB,CAAC,CAAC;IAC3E,CAAC;CACJ;AAbD,sDAaC"}
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ServiceTitanV1 = void 0;
|
|
4
4
|
const node_description_1 = require("./descriptions/node.description");
|
|
5
|
-
|
|
5
|
+
/* eslint-disable @n8n/community-nodes/no-restricted-imports --
|
|
6
|
+
* This is the best solution to share core functionality across integrations
|
|
7
|
+
*/
|
|
8
|
+
const n8n_nodes_core_1 = require("@thegraphitelab/n8n-nodes-core");
|
|
6
9
|
const transport_1 = require("./transport");
|
|
7
10
|
const manifest_1 = require("./manifest");
|
|
8
11
|
/* eslint-disable @n8n/community-nodes/icon-validation --
|
|
@@ -14,7 +17,7 @@ class ServiceTitanV1 {
|
|
|
14
17
|
this.description = { ...baseDescription, ...node_description_1.description };
|
|
15
18
|
}
|
|
16
19
|
async execute() {
|
|
17
|
-
return await (0,
|
|
20
|
+
return await (0, n8n_nodes_core_1.router)(this, manifest_1.serviceTitanV1Manifest, transport_1.serviceTitanTransport);
|
|
18
21
|
}
|
|
19
22
|
}
|
|
20
23
|
exports.ServiceTitanV1 = ServiceTitanV1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServiceTitanV1.node.js","sourceRoot":"","sources":["../../../../nodes/ServiceTitan/v1/ServiceTitanV1.node.ts"],"names":[],"mappings":";;;AAOA,sEAA8D;AAC9D,
|
|
1
|
+
{"version":3,"file":"ServiceTitanV1.node.js","sourceRoot":"","sources":["../../../../nodes/ServiceTitan/v1/ServiceTitanV1.node.ts"],"names":[],"mappings":";;;AAOA,sEAA8D;AAC9D;;GAEG;AACH,mEAAwD;AACxD,2CAAoD;AACpD,yCAAoD;AACpD;;0FAE0F;AAC1F,MAAa,cAAc;IACvB,WAAW,CAAuB;IAClC,YAAY,eAAyC;QACjD,IAAI,CAAC,WAAW,GAAG,EAAE,GAAG,eAAe,EAAE,GAAG,8BAAW,EAAE,CAAC;IAC9D,CAAC;IAED,KAAK,CAAC,OAAO;QACT,OAAO,MAAM,IAAA,uBAAM,EACf,IAAI,EACJ,iCAAsB,EACtB,iCAAqB,CACxB,CAAC;IACN,CAAC;CACJ;AAbD,wCAaC"}
|
|
@@ -3,7 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.description = void 0;
|
|
4
4
|
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
|
|
5
5
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
-
|
|
6
|
+
/* eslint-disable @n8n/community-nodes/no-restricted-imports --
|
|
7
|
+
* This is the best solution to share core functionality across integrations
|
|
8
|
+
*/
|
|
9
|
+
const n8n_nodes_core_1 = require("@thegraphitelab/n8n-nodes-core");
|
|
7
10
|
const transport_1 = require("../transport");
|
|
8
11
|
const manifest_1 = require("../manifest");
|
|
9
12
|
exports.description = {
|
|
@@ -36,6 +39,6 @@ exports.description = {
|
|
|
36
39
|
Accept: "application/json",
|
|
37
40
|
},
|
|
38
41
|
},
|
|
39
|
-
properties: (0,
|
|
42
|
+
properties: (0, n8n_nodes_core_1.getActionProperties)(manifest_1.serviceTitanV1Manifest, transport_1.serviceTitanTransport, "customer"),
|
|
40
43
|
};
|
|
41
44
|
//# sourceMappingURL=node.description.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.description.js","sourceRoot":"","sources":["../../../../../nodes/ServiceTitan/v1/descriptions/node.description.ts"],"names":[],"mappings":";;;AAAA,oEAAoE;AACpE,+CAAyE;AAEzE,
|
|
1
|
+
{"version":3,"file":"node.description.js","sourceRoot":"","sources":["../../../../../nodes/ServiceTitan/v1/descriptions/node.description.ts"],"names":[],"mappings":";;;AAAA,oEAAoE;AACpE,+CAAyE;AAEzE;;GAEG;AACH,mEAAqE;AACrE,4CAAqD;AACrD,0CAAqD;AAExC,QAAA,WAAW,GAAyB;IAC7C,WAAW,EAAE,cAAc;IAC3B,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE;QACF,KAAK,EAAE,uBAAuB;QAC9B,IAAI,EAAE,4BAA4B;KACrC;IACD,KAAK,EAAE,CAAC,WAAW,CAAC;IACpB,OAAO,EAAE,CAAC;IACV,QAAQ,EACJ,iFAAiF;IACrF,WAAW,EAAE,oCAAoC;IACjD,QAAQ,EAAE;QACN,IAAI,EAAE,cAAc;KACvB;IACD,YAAY,EAAE,IAAI;IAClB,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;IAClC,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;IACnC,WAAW,EAAE;QACT;YACI,IAAI,EAAE,iBAAiB;YACvB,QAAQ,EAAE,IAAI;SACjB;KACJ;IACD,eAAe,EAAE;QACb,OAAO,EACH,oHAAoH;QACxH,OAAO,EAAE;YACL,cAAc,EAAE,kBAAkB;YAClC,MAAM,EAAE,kBAAkB;SAC7B;KACJ;IACD,UAAU,EAAE,IAAA,oCAAmB,EAC3B,iCAAsB,EACtB,iCAAqB,EACrB,UAAU,CACb;CACJ,CAAC"}
|
|
@@ -3,7 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.triggerDescription = void 0;
|
|
4
4
|
/* eslint-disable n8n-nodes-base/node-filename-against-convention */
|
|
5
5
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
-
|
|
6
|
+
/* eslint-disable @n8n/community-nodes/no-restricted-imports --
|
|
7
|
+
* This is the best solution to share core functionality across integrations
|
|
8
|
+
*/
|
|
9
|
+
const n8n_nodes_core_1 = require("@thegraphitelab/n8n-nodes-core");
|
|
7
10
|
const transport_1 = require("../transport");
|
|
8
11
|
const manifest_1 = require("../manifest");
|
|
9
12
|
exports.triggerDescription = {
|
|
@@ -30,6 +33,6 @@ exports.triggerDescription = {
|
|
|
30
33
|
required: true,
|
|
31
34
|
},
|
|
32
35
|
],
|
|
33
|
-
properties: (0,
|
|
36
|
+
properties: (0, n8n_nodes_core_1.getTriggerProperties)(manifest_1.serviceTitanV1Manifest, transport_1.serviceTitanTransport, "customer"),
|
|
34
37
|
};
|
|
35
38
|
//# sourceMappingURL=trigger.description.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger.description.js","sourceRoot":"","sources":["../../../../../nodes/ServiceTitan/v1/descriptions/trigger.description.ts"],"names":[],"mappings":";;;AAAA,oEAAoE;AACpE,+CAAyE;AACzE,
|
|
1
|
+
{"version":3,"file":"trigger.description.js","sourceRoot":"","sources":["../../../../../nodes/ServiceTitan/v1/descriptions/trigger.description.ts"],"names":[],"mappings":";;;AAAA,oEAAoE;AACpE,+CAAyE;AACzE;;GAEG;AACH,mEAAsE;AACtE,4CAAqD;AACrD,0CAAqD;AAExC,QAAA,kBAAkB,GAAyB;IACpD,WAAW,EAAE,sBAAsB;IACnC,IAAI,EAAE,qBAAqB;IAC3B,IAAI,EAAE;QACF,KAAK,EAAE,uBAAuB;QAC9B,IAAI,EAAE,4BAA4B;KACrC;IACD,KAAK,EAAE,CAAC,SAAS,CAAC;IAClB,OAAO,EAAE,CAAC;IACV,WAAW,EACP,sEAAsE;IAC1E,QAAQ,EACJ,iFAAiF;IACrF,QAAQ,EAAE;QACN,IAAI,EAAE,sBAAsB;KAC/B;IACD,OAAO,EAAE,IAAI;IACb,YAAY,EAAE,IAAI;IAClB,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;IACnC,WAAW,EAAE;QACT;YACI,IAAI,EAAE,iBAAiB;YACvB,QAAQ,EAAE,IAAI;SACjB;KACJ;IACD,UAAU,EAAE,IAAA,qCAAoB,EAC5B,iCAAsB,EACtB,iCAAqB,EACrB,UAAU,CACb;CACJ,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { IntegrationManifest } from "
|
|
1
|
+
import type { IntegrationManifest } from "@thegraphitelab/n8n-nodes-core";
|
|
2
2
|
export declare const serviceTitanV1Manifest: IntegrationManifest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../../nodes/ServiceTitan/v1/manifest.ts"],"names":[],"mappings":";;;AAAA,2EAA2E;AAC3E,6EAA6E;AAC7E,iEAAiE;AACjE,qDAAkD;
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../../nodes/ServiceTitan/v1/manifest.ts"],"names":[],"mappings":";;;AAAA,2EAA2E;AAC3E,6EAA6E;AAC7E,iEAAiE;AACjE,qDAAkD;AAMrC,QAAA,sBAAsB,GAAG,qBAAgC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { TransportConfig } from "
|
|
1
|
+
import type { TransportConfig } from "@thegraphitelab/n8n-nodes-core";
|
|
2
2
|
export declare const serviceTitanTransportConfig: TransportConfig;
|
|
@@ -5,6 +5,10 @@ const ServiceTitanApi_credentials_1 = require("../../../../credentials/ServiceTi
|
|
|
5
5
|
// The ServiceTitan business logic the generic transport reads.
|
|
6
6
|
exports.serviceTitanTransportConfig = {
|
|
7
7
|
credentialKey: "serviceTitanApi",
|
|
8
|
+
// Fills the `{tenant}` placeholder in generated paths from the credential.
|
|
9
|
+
pathContext: (credentials) => ({
|
|
10
|
+
tenant: String(credentials.tenantId),
|
|
11
|
+
}),
|
|
8
12
|
baseUrl: (credentials) => `https://${(0, ServiceTitanApi_credentials_1.getApiHost)(credentials.environment ?? "integration")}`,
|
|
9
13
|
itemsOf: (response) => {
|
|
10
14
|
const data = response.data;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../../nodes/ServiceTitan/v1/transport/config.ts"],"names":[],"mappings":";;;AACA,qGAAiF;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../../nodes/ServiceTitan/v1/transport/config.ts"],"names":[],"mappings":";;;AACA,qGAAiF;AAOjF,+DAA+D;AAClD,QAAA,2BAA2B,GAAoB;IACxD,aAAa,EAAE,iBAAiB;IAChC,2EAA2E;IAC3E,WAAW,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAC3B,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC;KACvC,CAAC;IACF,OAAO,EAAE,CAAC,WAAW,EAAE,EAAE,CACrB,WAAW,IAAA,wCAAU,EAAE,WAAW,CAAC,WAAsB,IAAI,aAAa,CAAC,EAAE;IACjF,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE;QAClB,MAAM,IAAI,GAAI,QAAwC,CAAC,IAAI,CAAC;QAC5D,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3C,CAAC;IACD,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAE,QAAkC,CAAC,OAAO,CAAC;IAC3E,SAAS,EAAE,MAAM;IACjB,QAAQ,EAAE,EAAE;IACZ,WAAW,EAAE,MAAM;IACnB,UAAU,EAAE,CAAC,QAAQ,EAAE,EAAE,CACpB,QAAsC,CAAC,YAAY;IACxD,mBAAmB,EAAE,CAAC;CACzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const serviceTitanTransport: import("
|
|
1
|
+
export declare const serviceTitanTransport: import("@thegraphitelab/n8n-nodes-core/dist/transport/createTransport").Transport;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.serviceTitanTransport = void 0;
|
|
4
|
-
|
|
4
|
+
/* eslint-disable @n8n/community-nodes/no-restricted-imports --
|
|
5
|
+
* This is the best solution to share core functionality across integrations
|
|
6
|
+
*/
|
|
7
|
+
const n8n_nodes_core_1 = require("@thegraphitelab/n8n-nodes-core");
|
|
5
8
|
const config_1 = require("./config");
|
|
6
9
|
// The ServiceTitan transport: the generic engine bound to ST's config. Factories
|
|
7
10
|
// and node methods consume this injected Transport (no per-call `this` wrappers).
|
|
8
|
-
exports.serviceTitanTransport = (0,
|
|
11
|
+
exports.serviceTitanTransport = (0, n8n_nodes_core_1.createTransport)(config_1.serviceTitanTransportConfig);
|
|
9
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/ServiceTitan/v1/transport/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/ServiceTitan/v1/transport/index.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,mEAAiE;AACjE,qCAAuD;AAEvD,iFAAiF;AACjF,kFAAkF;AACrE,QAAA,qBAAqB,GAAG,IAAA,gCAAe,EAChD,oCAA2B,CAC9B,CAAC"}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thegraphitelab/n8n-nodes-servicetitan",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "n8n custom node for ServiceTitan — TGL internal use.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node-package",
|
|
@@ -49,6 +49,9 @@
|
|
|
49
49
|
"dist/nodes/ServiceTitan/ServiceTitanTrigger.node.js"
|
|
50
50
|
]
|
|
51
51
|
},
|
|
52
|
+
"dependencies": {
|
|
53
|
+
"@thegraphitelab/n8n-nodes-core": "workspace:^"
|
|
54
|
+
},
|
|
52
55
|
"devDependencies": {
|
|
53
56
|
"@eslint/js": "^9.29.0",
|
|
54
57
|
"vitest": "^4.1.9",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thegraphitelab/n8n-nodes-servicetitan",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "n8n custom node for ServiceTitan — TGL internal use.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node-package",
|
|
@@ -41,6 +41,9 @@
|
|
|
41
41
|
"dist/nodes/ServiceTitan/ServiceTitanTrigger.node.js"
|
|
42
42
|
]
|
|
43
43
|
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@thegraphitelab/n8n-nodes-core": "^0.1.0"
|
|
46
|
+
},
|
|
44
47
|
"devDependencies": {
|
|
45
48
|
"@eslint/js": "^9.29.0",
|
|
46
49
|
"vitest": "^4.1.9",
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { IExecuteFunctions } from "n8n-workflow";
|
|
2
|
-
import type { Transport } from "../../transport/createTransport";
|
|
3
|
-
export declare function getExportOperationContent(transport: Transport, resource: string, operation: string, pathTemplate: string): {
|
|
4
|
-
description: import("n8n-workflow").INodeProperties[];
|
|
5
|
-
execute: (outerThis: IExecuteFunctions, index: number) => Promise<import("n8n-workflow").NodeExecutionWithMetadata[]>;
|
|
6
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getExportOperationContent = getExportOperationContent;
|
|
4
|
-
const utils_1 = require("../write/utils");
|
|
5
|
-
const read_1 = require("./read");
|
|
6
|
-
function constructExportExecute(transport, pathTemplate) {
|
|
7
|
-
return async function execute(outerThis, index) {
|
|
8
|
-
const url = await (0, utils_1.buildUrl)(pathTemplate, [], outerThis, index);
|
|
9
|
-
const from = outerThis.getNodeParameter("from", index, "");
|
|
10
|
-
const includeRecentChanges = outerThis.getNodeParameter("includeRecentChanges", index, false);
|
|
11
|
-
const qs = { includeRecentChanges };
|
|
12
|
-
if (from)
|
|
13
|
-
qs.from = from;
|
|
14
|
-
const items = await transport.requestExport(outerThis, "GET", url, qs);
|
|
15
|
-
return outerThis.helpers.constructExecutionMetaData(outerThis.helpers.returnJsonArray(items), { itemData: { item: index } });
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
function getExportOperationContent(transport, resource, operation, pathTemplate) {
|
|
19
|
-
return (0, read_1.getOperationContext)({
|
|
20
|
-
resource,
|
|
21
|
-
operation,
|
|
22
|
-
descriptionOptions: { exportControls: true },
|
|
23
|
-
constructExecute: () => constructExportExecute(transport, pathTemplate),
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=export.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"export.js","sourceRoot":"","sources":["../../../../../nodes/core/factories/read/export.ts"],"names":[],"mappings":";;AA4BA,8DAYC;AAtCD,0CAA0C;AAC1C,iCAA6C;AAE7C,SAAS,sBAAsB,CAAC,SAAoB,EAAE,YAAoB;IACtE,OAAO,KAAK,UAAU,OAAO,CAAC,SAA4B,EAAE,KAAa;QACrE,MAAM,GAAG,GAAG,MAAM,IAAA,gBAAQ,EAAC,YAAY,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;QAE/D,MAAM,IAAI,GAAG,SAAS,CAAC,gBAAgB,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAW,CAAC;QACrE,MAAM,oBAAoB,GAAG,SAAS,CAAC,gBAAgB,CACnD,sBAAsB,EACtB,KAAK,EACL,KAAK,CACG,CAAC;QAEb,MAAM,EAAE,GAAgB,EAAE,oBAAoB,EAAE,CAAC;QACjD,IAAI,IAAI;YAAE,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC;QAEzB,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,aAAa,CAAC,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QAEvE,OAAO,SAAS,CAAC,OAAO,CAAC,0BAA0B,CAC/C,SAAS,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,EACxC,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,CAChC,CAAC;IACN,CAAC,CAAC;AACN,CAAC;AAED,SAAgB,yBAAyB,CACrC,SAAoB,EACpB,QAAgB,EAChB,SAAiB,EACjB,YAAoB;IAEpB,OAAO,IAAA,0BAAmB,EAAC;QACvB,QAAQ;QACR,SAAS;QACT,kBAAkB,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE;QAC5C,gBAAgB,EAAE,GAAG,EAAE,CAAC,sBAAsB,CAAC,SAAS,EAAE,YAAY,CAAC;KAC1E,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.constructFilterQs = constructFilterQs;
|
|
4
|
-
// Truthy filter values from the "filters" collection -> query string object.
|
|
5
|
-
function constructFilterQs(outerThis, index) {
|
|
6
|
-
const filterValues = outerThis.getNodeParameter("filters", index, {});
|
|
7
|
-
return Object.entries(filterValues)
|
|
8
|
-
.filter(([, value]) => Boolean(value))
|
|
9
|
-
.reduce((qs, [key, value]) => {
|
|
10
|
-
qs[key] = value;
|
|
11
|
-
return qs;
|
|
12
|
-
}, {});
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=filters.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../nodes/core/factories/read/filters.ts"],"names":[],"mappings":";;AAGA,8CAeC;AAhBD,6EAA6E;AAC7E,SAAgB,iBAAiB,CAC7B,SAA4B,EAC5B,KAAa;IAEb,MAAM,YAAY,GAAG,SAAS,CAAC,gBAAgB,CAC3C,SAAS,EACT,KAAK,EACL,EAAE,CACU,CAAC;IACjB,OAAO,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC;SAC9B,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;SACrC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACzB,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAChB,OAAO,EAAE,CAAC;IACd,CAAC,EAAE,EAAiB,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { IExecuteFunctions } from "n8n-workflow";
|
|
2
|
-
import type { Transport } from "../../transport/createTransport";
|
|
3
|
-
import { Descriptor, QueryParamDescriptor } from "../../types/separate";
|
|
4
|
-
export declare function getResourceOperationContent<T>(transport: Transport, descriptors: Descriptor[], inputs: QueryParamDescriptor[], resource: string, operation: string, pathTemplate: string): {
|
|
5
|
-
description: import("n8n-workflow").INodeProperties[];
|
|
6
|
-
execute: (outerThis: IExecuteFunctions, index: number) => Promise<import("n8n-workflow").NodeExecutionWithMetadata[]>;
|
|
7
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getResourceOperationContent = getResourceOperationContent;
|
|
4
|
-
const utils_1 = require("../write/utils");
|
|
5
|
-
const read_1 = require("./read");
|
|
6
|
-
// Required values come from top-level params; optional ones from the
|
|
7
|
-
// "additionalFields" collection. Empty/undefined values are dropped.
|
|
8
|
-
function constructQueryQs(outerThis, index, queryParams) {
|
|
9
|
-
const qs = {};
|
|
10
|
-
for (const q of queryParams.filter((p) => p.required)) {
|
|
11
|
-
const value = outerThis.getNodeParameter(q.name, index);
|
|
12
|
-
if (value !== undefined && value !== "")
|
|
13
|
-
qs[q.name] = value;
|
|
14
|
-
}
|
|
15
|
-
const additional = outerThis.getNodeParameter("additionalFields", index, {});
|
|
16
|
-
Object.assign(qs, additional);
|
|
17
|
-
return qs;
|
|
18
|
-
}
|
|
19
|
-
function returnExecutionData(outerThis, index, response) {
|
|
20
|
-
const executionData = outerThis.helpers.constructExecutionMetaData(outerThis.helpers.returnJsonArray(response), { itemData: { item: index } });
|
|
21
|
-
return executionData;
|
|
22
|
-
}
|
|
23
|
-
function constructExecute(transport, descriptors, queryParams, pathTemplate) {
|
|
24
|
-
return async function execute(outerThis, index) {
|
|
25
|
-
const url = await (0, utils_1.buildUrl)(pathTemplate, descriptors, outerThis, index);
|
|
26
|
-
const qs = constructQueryQs(outerThis, index, queryParams);
|
|
27
|
-
const responseData = await transport.request(outerThis, "GET", url, qs);
|
|
28
|
-
return returnExecutionData(outerThis, index, responseData);
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
function getResourceOperationContent(transport, descriptors, inputs, resource, operation, pathTemplate) {
|
|
32
|
-
const opContext = {
|
|
33
|
-
resource,
|
|
34
|
-
operation,
|
|
35
|
-
descriptors,
|
|
36
|
-
inputs,
|
|
37
|
-
constructExecute: () => constructExecute(transport, descriptors, inputs, pathTemplate),
|
|
38
|
-
};
|
|
39
|
-
return (0, read_1.getOperationContext)(opContext);
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=get.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../../nodes/core/factories/read/get.ts"],"names":[],"mappings":";;AA4DA,kEAiBC;AA1ED,0CAA0C;AAC1C,iCAA+D;AAE/D,qEAAqE;AACrE,qEAAqE;AACrE,SAAS,gBAAgB,CACrB,SAA4B,EAC5B,KAAa,EACb,WAAmC;IAEnC,MAAM,EAAE,GAAgB,EAAE,CAAC;IAC3B,KAAK,MAAM,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpD,MAAM,KAAK,GAAG,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC,IA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YAAoB;IAEpB,MAAM,SAAS,GAAqB;QAChC,QAAQ;QACR,SAAS;QACT,WAAW;QACX,MAAM;QACN,gBAAgB,EAAE,GAAG,EAAE,CACnB,gBAAgB,CAAI,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,CAAC;KACxE,CAAC;IACF,OAAO,IAAA,0BAAmB,EAAC,SAAS,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { IExecuteFunctions } from "n8n-workflow";
|
|
2
|
-
import type { Transport } from "../../transport/createTransport";
|
|
3
|
-
import { Descriptor, QueryParamDescriptor } from "../../types/separate";
|
|
4
|
-
export declare function getArrayListOperationContent(transport: Transport, descriptors: Descriptor[], filters: QueryParamDescriptor[], resource: string, operation: string, pathTemplate: string): {
|
|
5
|
-
description: import("n8n-workflow").INodeProperties[];
|
|
6
|
-
execute: (outerThis: IExecuteFunctions, index: number) => Promise<import("n8n-workflow").NodeExecutionWithMetadata[]>;
|
|
7
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getArrayListOperationContent = getArrayListOperationContent;
|
|
4
|
-
const utils_1 = require("../write/utils");
|
|
5
|
-
const filters_1 = require("./filters");
|
|
6
|
-
const read_1 = require("./read");
|
|
7
|
-
// A GET whose 200 body is a bare JSON array (no { data[] } envelope). One
|
|
8
|
-
// request, return the rows. Paginated bare-array endpoints return page 1 only
|
|
9
|
-
// (a bare array carries no hasMore signal) — same cap as the export feed.
|
|
10
|
-
function constructArrayListExecute(transport, descriptors, pathTemplate) {
|
|
11
|
-
return async function execute(outerThis, index) {
|
|
12
|
-
const url = await (0, utils_1.buildUrl)(pathTemplate, descriptors, outerThis, index);
|
|
13
|
-
const qs = (0, filters_1.constructFilterQs)(outerThis, index);
|
|
14
|
-
const items = await transport.request(outerThis, "GET", url, qs);
|
|
15
|
-
const rows = Array.isArray(items) ? items : [];
|
|
16
|
-
return outerThis.helpers.constructExecutionMetaData(outerThis.helpers.returnJsonArray(rows), { itemData: { item: index } });
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
function getArrayListOperationContent(transport, descriptors, filters, resource, operation, pathTemplate) {
|
|
20
|
-
const opContext = {
|
|
21
|
-
resource,
|
|
22
|
-
operation,
|
|
23
|
-
descriptors,
|
|
24
|
-
filters,
|
|
25
|
-
descriptionOptions: { getManyControls: false },
|
|
26
|
-
constructExecute: () => constructArrayListExecute(transport, descriptors, pathTemplate),
|
|
27
|
-
};
|
|
28
|
-
return (0, read_1.getOperationContext)(opContext);
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=getArray.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getArray.js","sourceRoot":"","sources":["../../../../../nodes/core/factories/read/getArray.ts"],"names":[],"mappings":";;AAiCA,oEAkBC;AAhDD,0CAA0C;AAC1C,uCAA8C;AAC9C,iCAA+D;AAE/D,0EAA0E;AAC1E,8EAA8E;AAC9E,0EAA0E;AAC1E,SAAS,yBAAyB,CAC9B,SAAoB,EACpB,WAAyB,EACzB,YAAoB;IAEpB,OAAO,KAAK,UAAU,OAAO,CAAC,SAA4B,EAAE,KAAa;QACrE,MAAM,GAAG,GAAG,MAAM,IAAA,gBAAQ,EAAC,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;QACxE,MAAM,EAAE,GAAG,IAAA,2BAAiB,EAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAC/C,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,OAAO,CACjC,SAAS,EACT,KAAK,EACL,GAAG,EACH,EAAE,CACL,CAAC;QACF,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAE/C,OAAO,SAAS,CAAC,OAAO,CAAC,0BAA0B,CAC/C,SAAS,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,EACvC,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,CAChC,CAAC;IACN,CAAC,CAAC;AACN,CAAC;AAED,SAAgB,4BAA4B,CACxC,SAAoB,EACpB,WAAyB,EACzB,OAA+B,EAC/B,QAAgB,EAChB,SAAiB,EACjB,YAAoB;IAEpB,MAAM,SAAS,GAAqB;QAChC,QAAQ;QACR,SAAS;QACT,WAAW;QACX,OAAO;QACP,kBAAkB,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE;QAC9C,gBAAgB,EAAE,GAAG,EAAE,CACnB,yBAAyB,CAAC,SAAS,EAAE,WAAW,EAAE,YAAY,CAAC;KACtE,CAAC;IACF,OAAO,IAAA,0BAAmB,EAAC,SAAS,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { IExecuteFunctions } from "n8n-workflow";
|
|
2
|
-
import type { Transport } from "../../transport/createTransport";
|
|
3
|
-
import { Descriptor, QueryParamDescriptor } from "../../types/separate";
|
|
4
|
-
export declare function getListOperationContent(transport: Transport, descriptors: Descriptor[], filters: QueryParamDescriptor[], resource: string, operation: string, pathTemplate: string): {
|
|
5
|
-
description: import("n8n-workflow").INodeProperties[];
|
|
6
|
-
execute: (outerThis: IExecuteFunctions, index: number) => Promise<import("n8n-workflow").NodeExecutionWithMetadata[]>;
|
|
7
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getListOperationContent = getListOperationContent;
|
|
4
|
-
const utils_1 = require("../write/utils");
|
|
5
|
-
const filters_1 = require("./filters");
|
|
6
|
-
const read_1 = require("./read");
|
|
7
|
-
async function executeGetManyRequest(transport, outerThis, index, url) {
|
|
8
|
-
const qs = (0, filters_1.constructFilterQs)(outerThis, index);
|
|
9
|
-
const returnAll = outerThis.getNodeParameter("returnAll", index, false);
|
|
10
|
-
if (returnAll) {
|
|
11
|
-
return await transport.requestAllItems(outerThis, "GET", url, qs);
|
|
12
|
-
}
|
|
13
|
-
const limit = outerThis.getNodeParameter("limit", index, 50);
|
|
14
|
-
return await transport.requestUpTo(outerThis, "GET", url, limit, qs);
|
|
15
|
-
}
|
|
16
|
-
function constructListExecute(transport, descriptors, pathTemplate) {
|
|
17
|
-
return async function execute(outerThis, index) {
|
|
18
|
-
const url = await (0, utils_1.buildUrl)(pathTemplate, descriptors, outerThis, index);
|
|
19
|
-
const items = await executeGetManyRequest(transport, outerThis, index, url);
|
|
20
|
-
return outerThis.helpers.constructExecutionMetaData(outerThis.helpers.returnJsonArray(items), { itemData: { item: index } });
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
function getListOperationContent(transport, descriptors, filters, resource, operation, pathTemplate) {
|
|
24
|
-
const opContext = {
|
|
25
|
-
resource,
|
|
26
|
-
operation,
|
|
27
|
-
descriptors,
|
|
28
|
-
filters,
|
|
29
|
-
constructExecute: () => constructListExecute(transport, descriptors, pathTemplate),
|
|
30
|
-
};
|
|
31
|
-
return (0, read_1.getOperationContext)(opContext);
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=getMany.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getMany.js","sourceRoot":"","sources":["../../../../../nodes/core/factories/read/getMany.ts"],"names":[],"mappings":";;AAiDA,0DAiBC;AA/DD,0CAA0C;AAC1C,uCAA8C;AAC9C,iCAA+D;AAE/D,KAAK,UAAU,qBAAqB,CAChC,SAAoB,EACpB,SAA4B,EAC5B,KAAa,EACb,GAAW;IAEX,MAAM,EAAE,GAAgB,IAAA,2BAAiB,EAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAE5D,MAAM,SAAS,GAAG,SAAS,CAAC,gBAAgB,CACxC,WAAW,EACX,KAAK,EACL,KAAK,CACG,CAAC;IAEb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
|
-
import { INodeProperties } from "n8n-workflow";
|
|
2
|
-
import { QueryParamDescriptor } from "../../types/separate";
|
|
3
|
-
type Show = {
|
|
4
|
-
resource: string[];
|
|
5
|
-
operation: string[];
|
|
6
|
-
};
|
|
7
|
-
export declare function wrapWithFiltersCollection(props: INodeProperties[], show: Show): INodeProperties;
|
|
8
|
-
interface IQueryParamsToProps {
|
|
9
|
-
filters: QueryParamDescriptor[];
|
|
10
|
-
inputs: QueryParamDescriptor[];
|
|
11
|
-
resource: string;
|
|
12
|
-
operation: string;
|
|
13
|
-
getManyControls?: boolean;
|
|
14
|
-
exportControls?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export declare function queryParamsToProps({ filters, inputs, resource, operation, getManyControls, exportControls, }: IQueryParamsToProps): INodeProperties[];
|
|
17
|
-
export {};
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Required query params -> required top-level fields; optional ones -> an
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.wrapWithFiltersCollection = wrapWithFiltersCollection;
|
|
5
|
-
exports.queryParamsToProps = queryParamsToProps;
|
|
6
|
-
const reduce_1 = require("../../helpers/reduce");
|
|
7
|
-
function defaultQueryParam(param) {
|
|
8
|
-
if (param.type === "boolean")
|
|
9
|
-
return false;
|
|
10
|
-
if (param.type === "number")
|
|
11
|
-
return 0;
|
|
12
|
-
return "";
|
|
13
|
-
}
|
|
14
|
-
function removeDisplayOptions(props) {
|
|
15
|
-
return props.map((prop) => {
|
|
16
|
-
delete prop.displayOptions;
|
|
17
|
-
return prop;
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
// The "Filters" collection property, gated to one resource+operation.
|
|
21
|
-
function wrapWithFiltersCollection(props, show) {
|
|
22
|
-
return {
|
|
23
|
-
displayName: "Filters",
|
|
24
|
-
name: "filters",
|
|
25
|
-
type: "collection",
|
|
26
|
-
placeholder: "Add Filter",
|
|
27
|
-
default: {},
|
|
28
|
-
displayOptions: {
|
|
29
|
-
show,
|
|
30
|
-
},
|
|
31
|
-
options: removeDisplayOptions(props),
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
function wrapWithAdditionalFields(optionalPropsUnwrapped, show) {
|
|
35
|
-
return {
|
|
36
|
-
displayName: "Additional Fields",
|
|
37
|
-
name: "additionalFields",
|
|
38
|
-
type: "collection",
|
|
39
|
-
placeholder: "Add Field",
|
|
40
|
-
default: {},
|
|
41
|
-
displayOptions: { show },
|
|
42
|
-
options: removeDisplayOptions(optionalPropsUnwrapped),
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
function queryParamToProp(q, show) {
|
|
46
|
-
return {
|
|
47
|
-
displayName: q.displayName,
|
|
48
|
-
name: q.name,
|
|
49
|
-
type: q.type,
|
|
50
|
-
required: q.required,
|
|
51
|
-
default: defaultQueryParam(q),
|
|
52
|
-
displayOptions: show ? { show } : undefined,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function deriveExportProps(show) {
|
|
56
|
-
return [
|
|
57
|
-
{
|
|
58
|
-
displayName: "From",
|
|
59
|
-
name: "from",
|
|
60
|
-
type: "string",
|
|
61
|
-
default: "",
|
|
62
|
-
description: "Continuation token from a previous run; leave empty to start from the beginning of the feed",
|
|
63
|
-
displayOptions: { show },
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
displayName: "Include Recent Changes",
|
|
67
|
-
name: "includeRecentChanges",
|
|
68
|
-
type: "boolean",
|
|
69
|
-
default: false,
|
|
70
|
-
description: "Whether to include recent changes that may not yet be fully processed",
|
|
71
|
-
displayOptions: { show },
|
|
72
|
-
},
|
|
73
|
-
];
|
|
74
|
-
}
|
|
75
|
-
function deriveGetManyProps(show) {
|
|
76
|
-
return [
|
|
77
|
-
{
|
|
78
|
-
displayName: "Return All",
|
|
79
|
-
name: "returnAll",
|
|
80
|
-
type: "boolean",
|
|
81
|
-
default: false,
|
|
82
|
-
description: "Whether to return all results or only up to a given limit",
|
|
83
|
-
displayOptions: { show },
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
displayName: "Limit",
|
|
87
|
-
name: "limit",
|
|
88
|
-
type: "number",
|
|
89
|
-
default: 50,
|
|
90
|
-
typeOptions: { minValue: 1 },
|
|
91
|
-
description: "Max number of results to return",
|
|
92
|
-
displayOptions: { show: { ...show, returnAll: [false] } },
|
|
93
|
-
},
|
|
94
|
-
];
|
|
95
|
-
}
|
|
96
|
-
function getFilterItems(filters, show, getManyControls) {
|
|
97
|
-
const props = filters.map((q) => queryParamToProp(q, show));
|
|
98
|
-
if (!getManyControls)
|
|
99
|
-
return [wrapWithFiltersCollection(props, show)];
|
|
100
|
-
return [
|
|
101
|
-
...deriveGetManyProps(show),
|
|
102
|
-
wrapWithFiltersCollection(props, show),
|
|
103
|
-
];
|
|
104
|
-
}
|
|
105
|
-
function getInputs(queryParams, show) {
|
|
106
|
-
const { trueGroup: required, falseGroup: optional } = (0, reduce_1.split)(queryParams, (q) => Boolean(q.required));
|
|
107
|
-
const requiredProps = required.map((q) => queryParamToProp(q, show));
|
|
108
|
-
if (optional.length === 0)
|
|
109
|
-
return requiredProps;
|
|
110
|
-
const optionalProps = wrapWithAdditionalFields(optional.map((q) => queryParamToProp(q)), show);
|
|
111
|
-
return [...requiredProps, optionalProps];
|
|
112
|
-
}
|
|
113
|
-
function queryParamsToProps({ filters, inputs, resource, operation, getManyControls = true, exportControls = false, }) {
|
|
114
|
-
const show = { resource: [resource], operation: [operation] };
|
|
115
|
-
const filterProps = filters.length > 0
|
|
116
|
-
? getFilterItems(filters, show, getManyControls)
|
|
117
|
-
: [];
|
|
118
|
-
const inputProps = inputs.length > 0 ? getInputs(inputs, show) : [];
|
|
119
|
-
if (!exportControls)
|
|
120
|
-
return [...filterProps, ...inputProps];
|
|
121
|
-
return [...deriveExportProps(show), ...filterProps, ...inputProps];
|
|
122
|
-
}
|
|
123
|
-
//# sourceMappingURL=properties.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../../../nodes/core/factories/read/properties.ts"],"names":[],"mappings":";AAAA,0EAA0E;;AAsB1E,8DAeC;AAmHD,gDAkBC;AAtKD,iDAA6C;AAI7C,SAAS,iBAAiB,CAAC,KAA2B;IAClD,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAC3C,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,CAAC,CAAC;IACtC,OAAO,EAAE,CAAC;AACd,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAwB;IAClD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;QAC3B,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC,CAAC;AACP,CAAC;AAED,sEAAsE;AACtE,SAAgB,yBAAyB,CACrC,KAAwB,EACxB,IAAU;IAEV,OAAO;QACH,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,YAAY;QACzB,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACZ,IAAI;SACP;QACD,OAAO,EAAE,oBAAoB,CAAC,KAAK,CAAC;KACvC,CAAC;AACN,CAAC;AACD,SAAS,wBAAwB,CAC7B,sBAAyC,EACzC,IAAU;IAEV,OAAO;QACH,WAAW,EAAE,mBAAmB;QAChC,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,WAAW;QACxB,OAAO,EAAE,EAAE;QACX,cAAc,EAAE,EAAE,IAAI,EAAE;QACxB,OAAO,EAAE,oBAAoB,CAAC,sBAAsB,CAAC;KACxD,CAAC;AACN,CAAC;AAED,SAAS,gBAAgB,CACrB,CAAuB,EACvB,IAAW;IAEX,OAAO;QACH,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,IAAI,EAA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