@segment/warehouse-destinations 1.0.1-staging-dbf70accf.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 ADDED
@@ -0,0 +1,18 @@
1
+ # `warehouse-destinations`
2
+
3
+ **For Segment Use Only**
4
+
5
+ Used to define warehouse destinations and their associated actions.
6
+
7
+ The perform block will never be called in these actions, they are only used to create definitions.
8
+
9
+ We do not need to register warehouse desitnations and return a manifest because the warehouse destination package is exclusively used by the CLI to push warehouse destination definitions to the Segment platform.
10
+
11
+ ## Usage
12
+
13
+ ```
14
+ const warehouseDestinations = require('warehouse-destinations');
15
+
16
+ const warehouseDefinitions = await warehouse.getDefinitions(actionsPath)
17
+ // returns a list of warehouse definitions that can be registered on the Segment platform.
18
+ ```
@@ -0,0 +1,2 @@
1
+ import type { WarehouseDestinationDefinition } from '@segment/actions-core';
2
+ export declare const getDefinitions: (dirPath: string) => Promise<WarehouseDestinationDefinition[]>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getDefinitions = void 0;
7
+ const globby_1 = require("globby");
8
+ const path_1 = __importDefault(require("path"));
9
+ const getDefinitions = async (dirPath) => {
10
+ const destPath = path_1.default.join(dirPath, 'src/destinations/*');
11
+ const warehouseDestDirs = await (0, globby_1.globby)(destPath, {
12
+ expandDirectories: false,
13
+ onlyDirectories: true,
14
+ gitignore: false,
15
+ ignore: ['node_modules']
16
+ });
17
+ const definitions = warehouseDestDirs.map((dir) => {
18
+ const destination = require(dir).default;
19
+ return destination;
20
+ });
21
+ return definitions;
22
+ };
23
+ exports.getDefinitions = getDefinitions;
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/destinations/index.ts"],"names":[],"mappings":";;;;;;AAAA,mCAA+B;AAC/B,gDAAuB;AAUhB,MAAM,cAAc,GAAG,KAAK,EAAE,OAAe,EAA6C,EAAE;IACjG,MAAM,QAAQ,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAA;IACzD,MAAM,iBAAiB,GAAG,MAAM,IAAA,eAAM,EAAC,QAAQ,EAAE;QAC/C,iBAAiB,EAAE,KAAK;QACxB,eAAe,EAAE,IAAI;QACrB,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE,CAAC,cAAc,CAAC;KACzB,CAAC,CAAA;IAEF,MAAM,WAAW,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QAEhD,MAAM,WAAW,GAAmC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAA;QACxE,OAAO,WAAW,CAAA;IACpB,CAAC,CAAC,CAAA;IAEF,OAAO,WAAW,CAAA;AACpB,CAAC,CAAA;AAhBY,QAAA,cAAc,kBAgB1B"}
@@ -0,0 +1,3 @@
1
+ export interface Settings {
2
+ warehouseId: string;
3
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/snowflake/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { WarehouseDestinationDefinition } from '@segment/actions-core';
2
+ import type { Settings } from './generated-types';
3
+ declare const destination: WarehouseDestinationDefinition<Settings>;
4
+ export default destination;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const sendCustomEvent_1 = __importDefault(require("./sendCustomEvent"));
7
+ const destination = {
8
+ name: 'Snowflake',
9
+ slug: 'snowflake',
10
+ mode: 'warehouse',
11
+ settings: {
12
+ warehouseId: {
13
+ label: 'Warehouse ID',
14
+ description: 'The ID of the existing Snowflake warehouse instance to use.',
15
+ type: 'string',
16
+ required: true
17
+ }
18
+ },
19
+ actions: {
20
+ sendCustomEvent: sendCustomEvent_1.default
21
+ }
22
+ };
23
+ exports.default = destination;
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/snowflake/index.ts"],"names":[],"mappings":";;;;;AAGA,wEAA+C;AAE/C,MAAM,WAAW,GAA6C;IAC5D,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,WAAW;IAEjB,QAAQ,EAAE;QACR,WAAW,EAAE;YACX,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,6DAA6D;YAC1E,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;KACF;IAED,OAAO,EAAE;QACP,eAAe,EAAf,yBAAe;KAChB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -0,0 +1,9 @@
1
+ export interface Payload {
2
+ timestamp: string;
3
+ messageId: string;
4
+ event: string;
5
+ type: string;
6
+ properties: {
7
+ [k: string]: unknown;
8
+ };
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=generated-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/snowflake/sendCustomEvent/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import type { ActionDefinition } from '@segment/actions-core';
2
+ import type { Settings } from '../generated-types';
3
+ import type { Payload } from './generated-types';
4
+ declare const action: ActionDefinition<Settings, Payload>;
5
+ export default action;
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const action = {
4
+ title: 'Send Custom Event',
5
+ description: 'Record custom events in Snowflake',
6
+ fields: {
7
+ timestamp: {
8
+ label: 'Timestamp',
9
+ description: 'Timestamp of the event',
10
+ type: 'string',
11
+ required: true,
12
+ default: { '@path': '$.timestamp' }
13
+ },
14
+ messageId: {
15
+ label: 'Message ID',
16
+ description: 'Name of column for the unique identifier for the message.',
17
+ type: 'string',
18
+ required: true,
19
+ default: { '@path': '$.messageId' },
20
+ readOnly: true
21
+ },
22
+ event: {
23
+ label: 'Table Name',
24
+ description: 'Name of the table. This will be the event name.',
25
+ type: 'string',
26
+ required: true,
27
+ default: { '@path': '$.event' },
28
+ readOnly: true
29
+ },
30
+ type: {
31
+ label: 'Event Type',
32
+ description: 'The type of event',
33
+ type: 'string',
34
+ required: true,
35
+ default: { '@path': '$.type' },
36
+ readOnly: true
37
+ },
38
+ properties: {
39
+ label: 'Columns',
40
+ description: `Additional columns to write to Snowflake.`,
41
+ type: 'object',
42
+ defaultObjectUI: 'keyvalue',
43
+ required: true,
44
+ additionalProperties: true,
45
+ default: {
46
+ entityContext: {
47
+ '@json': {
48
+ mode: 'encode',
49
+ value: {
50
+ '@path': '$.properties.data_graph_entity_context'
51
+ }
52
+ }
53
+ },
54
+ userId: {
55
+ label: 'User ID',
56
+ description: 'Unique ID for the user.',
57
+ type: 'string',
58
+ default: { '@path': '$.userId' }
59
+ },
60
+ audienceKey: {
61
+ label: 'Audience Key',
62
+ description: 'The Kky of the audience.',
63
+ type: 'string',
64
+ default: { '@path': '$.properties.audience_key' }
65
+ },
66
+ personasComputationKey: {
67
+ label: 'Personas Computation Key',
68
+ description: 'Computation key set by Segment Personas.',
69
+ type: 'string',
70
+ default: { '@path': '$.context.personas.computation_key' }
71
+ },
72
+ personasComputationId: {
73
+ label: 'Personas Computation ID',
74
+ description: 'Computation ID set by Segment Personas.',
75
+ type: 'string',
76
+ default: { '@path': '$.context.personas.computation_id' }
77
+ },
78
+ personasComputationRunId: {
79
+ label: 'Personas Computation Run ID',
80
+ description: 'Unique ID for this run, set by Segment Personas.',
81
+ type: 'string',
82
+ default: { '@path': '$.context.personas.computation_run_id' }
83
+ },
84
+ personasActivationId: {
85
+ label: 'Personas Activation ID',
86
+ description: 'ID of the activation, set by Segment Personas.',
87
+ type: 'string',
88
+ default: { '@path': '$.context.personas.event_emitter_id' }
89
+ }
90
+ }
91
+ }
92
+ },
93
+ perform: () => {
94
+ return undefined;
95
+ }
96
+ };
97
+ exports.default = action;
98
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/snowflake/sendCustomEvent/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EAAE,mCAAmC;IAChD,MAAM,EAAE;QACN,SAAS,EAAE;YACT,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;SACpC;QACD,SAAS,EAAE;YACT,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,2DAA2D;YACxE,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE;YACnC,QAAQ,EAAE,IAAI;SACf;QACD,KAAK,EAAE;YACL,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,iDAAiD;YAC9D,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;YAC/B,QAAQ,EAAE,IAAI;SACf;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,mBAAmB;YAChC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE,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D;oBAC7D,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE,OAAO,EAAE,qCAAqC,EAAE;iBAC5D;aACF;SACF;KACF;IACD,OAAO,EAAE,GAAG,EAAE;QACZ,OAAO,SAAS,CAAA;IAClB,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './destinations';
2
+ export { WarehouseDestinationDefinition } from '@segment/actions-core';
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./destinations"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B"}
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@segment/warehouse-destinations",
3
+ "version": "1.0.1-staging-dbf70accf.0",
4
+ "description": "Definitions for warehouse destinations. Only used for definitions - should not be imported for anything other than types.",
5
+ "publishConfig": {
6
+ "access": "public",
7
+ "registry": "https://registry.npmjs.org"
8
+ },
9
+ "scripts": {
10
+ "build": "yarn tsc -b tsconfig.build.json",
11
+ "clean": "tsc -b tsconfig.build.json --clean",
12
+ "postclean": "rm -rf dist",
13
+ "prepublishOnly": "yarn build",
14
+ "typecheck": "tsc -p tsconfig.build.json --noEmit"
15
+ },
16
+ "main": "dist/index.js",
17
+ "types": "dist/index.d.ts",
18
+ "files": [
19
+ "dist",
20
+ "package.json"
21
+ ],
22
+ "engines": {
23
+ "node": "^18.17 || ^22.13"
24
+ },
25
+ "engineStrict": true,
26
+ "license": "MIT",
27
+ "dependencies": {
28
+ "@segment/actions-core": "^3.152.0",
29
+ "globby": "^14.1.0"
30
+ },
31
+ "gitHead": "43ffaddf8f9856a98b6ce05047f67ed235d7d560"
32
+ }