n8n-nodes-segment 1.0.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/LICENSE +46 -0
- package/README.md +419 -0
- package/dist/credentials/SegmentApi.credentials.d.ts +10 -0
- package/dist/credentials/SegmentApi.credentials.d.ts.map +1 -0
- package/dist/credentials/SegmentApi.credentials.js +88 -0
- package/dist/credentials/SegmentApi.credentials.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/nodes/Segment/Segment.node.d.ts +6 -0
- package/dist/nodes/Segment/Segment.node.d.ts.map +1 -0
- package/dist/nodes/Segment/Segment.node.js +283 -0
- package/dist/nodes/Segment/Segment.node.js.map +1 -0
- package/dist/nodes/Segment/SegmentTrigger.node.d.ts +6 -0
- package/dist/nodes/Segment/SegmentTrigger.node.d.ts.map +1 -0
- package/dist/nodes/Segment/SegmentTrigger.node.js +257 -0
- package/dist/nodes/Segment/SegmentTrigger.node.js.map +1 -0
- package/dist/nodes/Segment/actions/audiences/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/audiences/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/audiences/index.js +304 -0
- package/dist/nodes/Segment/actions/audiences/index.js.map +1 -0
- package/dist/nodes/Segment/actions/auditTrail/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/auditTrail/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/auditTrail/index.js +192 -0
- package/dist/nodes/Segment/actions/auditTrail/index.js.map +1 -0
- package/dist/nodes/Segment/actions/catalog/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/catalog/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/catalog/index.js +144 -0
- package/dist/nodes/Segment/actions/catalog/index.js.map +1 -0
- package/dist/nodes/Segment/actions/computedTraits/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/computedTraits/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/computedTraits/index.js +257 -0
- package/dist/nodes/Segment/actions/computedTraits/index.js.map +1 -0
- package/dist/nodes/Segment/actions/destinations/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/destinations/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/destinations/index.js +297 -0
- package/dist/nodes/Segment/actions/destinations/index.js.map +1 -0
- package/dist/nodes/Segment/actions/functions/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/functions/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/functions/index.js +389 -0
- package/dist/nodes/Segment/actions/functions/index.js.map +1 -0
- package/dist/nodes/Segment/actions/labels/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/labels/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/labels/index.js +221 -0
- package/dist/nodes/Segment/actions/labels/index.js.map +1 -0
- package/dist/nodes/Segment/actions/regulations/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/regulations/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/regulations/index.js +322 -0
- package/dist/nodes/Segment/actions/regulations/index.js.map +1 -0
- package/dist/nodes/Segment/actions/sources/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/sources/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/sources/index.js +371 -0
- package/dist/nodes/Segment/actions/sources/index.js.map +1 -0
- package/dist/nodes/Segment/actions/spaces/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/spaces/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/spaces/index.js +328 -0
- package/dist/nodes/Segment/actions/spaces/index.js.map +1 -0
- package/dist/nodes/Segment/actions/track/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/track/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/track/index.js +499 -0
- package/dist/nodes/Segment/actions/track/index.js.map +1 -0
- package/dist/nodes/Segment/actions/trackingPlans/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/trackingPlans/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/trackingPlans/index.js +340 -0
- package/dist/nodes/Segment/actions/trackingPlans/index.js.map +1 -0
- package/dist/nodes/Segment/actions/transformations/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/transformations/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/transformations/index.js +280 -0
- package/dist/nodes/Segment/actions/transformations/index.js.map +1 -0
- package/dist/nodes/Segment/actions/users/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/users/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/users/index.js +233 -0
- package/dist/nodes/Segment/actions/users/index.js.map +1 -0
- package/dist/nodes/Segment/actions/warehouses/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/warehouses/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/warehouses/index.js +313 -0
- package/dist/nodes/Segment/actions/warehouses/index.js.map +1 -0
- package/dist/nodes/Segment/actions/workspace/index.d.ts +5 -0
- package/dist/nodes/Segment/actions/workspace/index.d.ts.map +1 -0
- package/dist/nodes/Segment/actions/workspace/index.js +100 -0
- package/dist/nodes/Segment/actions/workspace/index.js.map +1 -0
- package/dist/nodes/Segment/constants/index.d.ts +23 -0
- package/dist/nodes/Segment/constants/index.d.ts.map +1 -0
- package/dist/nodes/Segment/constants/index.js +720 -0
- package/dist/nodes/Segment/constants/index.js.map +1 -0
- package/dist/nodes/Segment/segment.svg +6 -0
- package/dist/nodes/Segment/transport/index.d.ts +35 -0
- package/dist/nodes/Segment/transport/index.d.ts.map +1 -0
- package/dist/nodes/Segment/transport/index.js +127 -0
- package/dist/nodes/Segment/transport/index.js.map +1 -0
- package/dist/nodes/Segment/utils/index.d.ts +67 -0
- package/dist/nodes/Segment/utils/index.d.ts.map +1 -0
- package/dist/nodes/Segment/utils/index.js +216 -0
- package/dist/nodes/Segment/utils/index.js.map +1 -0
- package/package.json +73 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) Velocity BPA, LLC
|
|
4
|
+
* Licensed under the Business Source License 1.1
|
|
5
|
+
* Commercial use requires a separate commercial license.
|
|
6
|
+
* See LICENSE file for details.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.workspaceFields = exports.workspaceOperations = void 0;
|
|
10
|
+
exports.executeWorkspace = executeWorkspace;
|
|
11
|
+
const transport_1 = require("../../transport");
|
|
12
|
+
exports.workspaceOperations = [
|
|
13
|
+
{
|
|
14
|
+
displayName: 'Operation',
|
|
15
|
+
name: 'operation',
|
|
16
|
+
type: 'options',
|
|
17
|
+
noDataExpression: true,
|
|
18
|
+
displayOptions: {
|
|
19
|
+
show: {
|
|
20
|
+
resource: ['workspace'],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
options: [
|
|
24
|
+
{
|
|
25
|
+
name: 'Get',
|
|
26
|
+
value: 'get',
|
|
27
|
+
description: 'Get current workspace info',
|
|
28
|
+
action: 'Get workspace info',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'Get Many',
|
|
32
|
+
value: 'getAll',
|
|
33
|
+
description: 'List accessible workspaces',
|
|
34
|
+
action: 'List workspaces',
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
default: 'get',
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
exports.workspaceFields = [
|
|
41
|
+
// Pagination for getAll
|
|
42
|
+
{
|
|
43
|
+
displayName: 'Return All',
|
|
44
|
+
name: 'returnAll',
|
|
45
|
+
type: 'boolean',
|
|
46
|
+
default: false,
|
|
47
|
+
description: 'Whether to return all results or only up to a given limit',
|
|
48
|
+
displayOptions: {
|
|
49
|
+
show: {
|
|
50
|
+
resource: ['workspace'],
|
|
51
|
+
operation: ['getAll'],
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
displayName: 'Limit',
|
|
57
|
+
name: 'limit',
|
|
58
|
+
type: 'number',
|
|
59
|
+
default: 50,
|
|
60
|
+
description: 'Max number of results to return',
|
|
61
|
+
typeOptions: {
|
|
62
|
+
minValue: 1,
|
|
63
|
+
maxValue: 200,
|
|
64
|
+
},
|
|
65
|
+
displayOptions: {
|
|
66
|
+
show: {
|
|
67
|
+
resource: ['workspace'],
|
|
68
|
+
operation: ['getAll'],
|
|
69
|
+
returnAll: [false],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
async function executeWorkspace(index) {
|
|
75
|
+
const operation = this.getNodeParameter('operation', index);
|
|
76
|
+
let response;
|
|
77
|
+
if (operation === 'get') {
|
|
78
|
+
const result = await transport_1.publicApiRequest.call(this, 'GET', '/workspace');
|
|
79
|
+
response = result.workspace;
|
|
80
|
+
}
|
|
81
|
+
else if (operation === 'getAll') {
|
|
82
|
+
const returnAll = this.getNodeParameter('returnAll', index);
|
|
83
|
+
if (returnAll) {
|
|
84
|
+
response = await transport_1.publicApiRequestAllItems.call(this, 'GET', '/workspaces', 'workspaces');
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
const limit = this.getNodeParameter('limit', index);
|
|
88
|
+
const result = await transport_1.publicApiRequest.call(this, 'GET', '/workspaces', {}, { count: limit });
|
|
89
|
+
response = result.workspaces;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
throw new Error(`Unknown operation: ${operation}`);
|
|
94
|
+
}
|
|
95
|
+
const executionData = Array.isArray(response)
|
|
96
|
+
? response.map((item) => ({ json: item }))
|
|
97
|
+
: [{ json: response }];
|
|
98
|
+
return executionData;
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Segment/actions/workspace/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAqEH,4CAoCC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AAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { INodePropertyOptions } from 'n8n-workflow';
|
|
2
|
+
export declare const SEGMENT_REGIONS: INodePropertyOptions[];
|
|
3
|
+
export declare const RESOURCES: INodePropertyOptions[];
|
|
4
|
+
export declare const TRACK_OPERATIONS: INodePropertyOptions[];
|
|
5
|
+
export declare const SOURCE_OPERATIONS: INodePropertyOptions[];
|
|
6
|
+
export declare const DESTINATION_OPERATIONS: INodePropertyOptions[];
|
|
7
|
+
export declare const WAREHOUSE_OPERATIONS: INodePropertyOptions[];
|
|
8
|
+
export declare const TRACKING_PLAN_OPERATIONS: INodePropertyOptions[];
|
|
9
|
+
export declare const FUNCTION_OPERATIONS: INodePropertyOptions[];
|
|
10
|
+
export declare const SPACE_OPERATIONS: INodePropertyOptions[];
|
|
11
|
+
export declare const USER_OPERATIONS: INodePropertyOptions[];
|
|
12
|
+
export declare const REGULATION_OPERATIONS: INodePropertyOptions[];
|
|
13
|
+
export declare const CATALOG_OPERATIONS: INodePropertyOptions[];
|
|
14
|
+
export declare const TRANSFORMATION_OPERATIONS: INodePropertyOptions[];
|
|
15
|
+
export declare const COMPUTED_TRAIT_OPERATIONS: INodePropertyOptions[];
|
|
16
|
+
export declare const AUDIENCE_OPERATIONS: INodePropertyOptions[];
|
|
17
|
+
export declare const LABEL_OPERATIONS: INodePropertyOptions[];
|
|
18
|
+
export declare const AUDIT_TRAIL_OPERATIONS: INodePropertyOptions[];
|
|
19
|
+
export declare const WORKSPACE_OPERATIONS: INodePropertyOptions[];
|
|
20
|
+
export declare const FUNCTION_TYPES: INodePropertyOptions[];
|
|
21
|
+
export declare const REGULATION_TYPES: INodePropertyOptions[];
|
|
22
|
+
export declare const SUBJECT_TYPES: INodePropertyOptions[];
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../nodes/Segment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