@segment/warehouse-destinations 1.12.0 → 1.13.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.
@@ -1,2 +1,3 @@
1
1
  export interface Settings {
2
+ warehouseId: string;
2
3
  }
@@ -1,4 +1,4 @@
1
1
  import type { WarehouseDestinationDefinition } from '@segment/actions-core';
2
- import { Settings } from '../snowflake/generated-types';
2
+ import { Settings } from './generated-types';
3
3
  declare const destination: WarehouseDestinationDefinition<Settings>;
4
4
  export default destination;
@@ -1,11 +1,79 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ const actions_core_1 = require("@segment/actions-core");
7
+ const sendCustomEvent_1 = __importDefault(require("./sendCustomEvent"));
8
+ const journeys_default_fields_1 = __importDefault(require("./sendCustomEvent/journeys-default-fields"));
9
+ const audience_default_fields_1 = __importDefault(require("./sendCustomEvent/audience-default-fields"));
3
10
  const destination = {
4
11
  name: 'Databricks',
5
12
  slug: 'databricks',
6
13
  mode: 'warehouse',
7
- settings: {},
8
- actions: {}
14
+ settings: {
15
+ warehouseId: {
16
+ label: 'Warehouse ID',
17
+ description: 'The ID of the existing Databricks warehouse instance to use.',
18
+ type: 'string',
19
+ required: true
20
+ }
21
+ },
22
+ presets: [
23
+ {
24
+ name: 'Linked Audience Entity Added',
25
+ partnerAction: 'sendCustomEvent',
26
+ mapping: {
27
+ ...(0, actions_core_1.defaultValues)(sendCustomEvent_1.default.fields),
28
+ ...(0, actions_core_1.defaultValues)(audience_default_fields_1.default)
29
+ },
30
+ type: 'specificEvent',
31
+ eventSlug: 'warehouse_entity_added_track'
32
+ },
33
+ {
34
+ name: 'Linked Audience Associated Entity Removed',
35
+ partnerAction: 'sendCustomEvent',
36
+ mapping: {
37
+ ...(0, actions_core_1.defaultValues)(sendCustomEvent_1.default.fields),
38
+ ...(0, actions_core_1.defaultValues)(audience_default_fields_1.default)
39
+ },
40
+ type: 'specificEvent',
41
+ eventSlug: 'warehouse_entity_removed_track'
42
+ },
43
+ {
44
+ name: 'Linked Audience Profile Entered',
45
+ partnerAction: 'sendCustomEvent',
46
+ mapping: {
47
+ ...(0, actions_core_1.defaultValues)(sendCustomEvent_1.default.fields),
48
+ ...(0, actions_core_1.defaultValues)(audience_default_fields_1.default)
49
+ },
50
+ type: 'specificEvent',
51
+ eventSlug: 'warehouse_audience_entered_track'
52
+ },
53
+ {
54
+ name: 'Linked Audience Profile Exited',
55
+ partnerAction: 'sendCustomEvent',
56
+ mapping: {
57
+ ...(0, actions_core_1.defaultValues)(sendCustomEvent_1.default.fields),
58
+ ...(0, actions_core_1.defaultValues)(audience_default_fields_1.default)
59
+ },
60
+ type: 'specificEvent',
61
+ eventSlug: 'warehouse_audience_exited_track'
62
+ },
63
+ {
64
+ name: 'Journeys Step Entered',
65
+ partnerAction: 'sendCustomEvent',
66
+ mapping: {
67
+ ...(0, actions_core_1.defaultValues)(sendCustomEvent_1.default.fields),
68
+ ...(0, actions_core_1.defaultValues)(journeys_default_fields_1.default)
69
+ },
70
+ type: 'specificEvent',
71
+ eventSlug: 'journeys_step_entered_track'
72
+ }
73
+ ],
74
+ actions: {
75
+ sendCustomEvent: sendCustomEvent_1.default
76
+ }
9
77
  };
10
78
  exports.default = destination;
11
79
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/databricks/index.ts"],"names":[],"mappings":";;AAGA,MAAM,WAAW,GAA6C;IAC5D,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,WAAW;IAEjB,QAAQ,EAAE,EAAE;IAEZ,OAAO,EAAE,EAAE;CACZ,CAAA;AAED,kBAAe,WAAW,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/databricks/index.ts"],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B,CAAC;aACxC;YACD,IAAI,EAAE,eAAe;YACrB,SAAS,EAAE,iCAAiC;SAC7C;QACD;YACE,IAAI,EAAE,uBAAuB;YAC7B,aAAa,EAAE,iBAAiB;YAChC,OAAO,EAAE;gBACP,GAAG,IAAA,4BAAa,EAAC,yBAAe,CAAC,MAAM,CAAC;gBACxC,GAAG,IAAA,4BAAa,EAAC,iCAAqB,CAAC;aACxC;YACD,IAAI,EAAE,eAAe;YACrB,SAAS,EAAE,6BAA6B;SACzC;KACF;IAED,OAAO,EAAE;QACP,eAAe,EAAf,yBAAe;KAChB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -0,0 +1,42 @@
1
+ declare const _default: {
2
+ properties: {
3
+ label: string;
4
+ description: string;
5
+ type: string;
6
+ defaultObjectUI: string;
7
+ required: boolean;
8
+ additionalProperties: boolean;
9
+ default: {
10
+ entity_context: {
11
+ '@json': {
12
+ mode: string;
13
+ value: {
14
+ '@path': string;
15
+ };
16
+ };
17
+ };
18
+ user_id: {
19
+ '@path': string;
20
+ };
21
+ audience_key: {
22
+ '@path': string;
23
+ };
24
+ personas_computation_key: {
25
+ '@path': string;
26
+ };
27
+ personas_computation_id: {
28
+ '@path': string;
29
+ };
30
+ personas_computation_run_id: {
31
+ '@path': string;
32
+ };
33
+ personas_activation_id: {
34
+ '@path': string;
35
+ };
36
+ event_name: {
37
+ '@path': string;
38
+ };
39
+ };
40
+ };
41
+ };
42
+ export default _default;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ properties: {
5
+ label: 'Columns',
6
+ description: `Additional columns to write to Databricks.`,
7
+ type: 'object',
8
+ defaultObjectUI: 'keyvalue',
9
+ required: true,
10
+ additionalProperties: true,
11
+ default: {
12
+ entity_context: {
13
+ '@json': {
14
+ mode: 'encode',
15
+ value: {
16
+ '@path': '$.properties.data_graph_entity_context'
17
+ }
18
+ }
19
+ },
20
+ user_id: { '@path': '$.userId' },
21
+ audience_key: { '@path': '$.properties.audience_key' },
22
+ personas_computation_key: { '@path': '$.context.personas.computation_key' },
23
+ personas_computation_id: { '@path': '$.context.personas.computation_id' },
24
+ personas_computation_run_id: { '@path': '$.context.personas.computation_run_id' },
25
+ personas_activation_id: { '@path': '$.context.personas.event_emitter_id' },
26
+ event_name: { '@path': '$.event' }
27
+ }
28
+ }
29
+ };
30
+ //# sourceMappingURL=audience-default-fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audience-default-fields.js","sourceRoot":"","sources":["../../../../src/destinations/databricks/sendCustomEvent/audience-default-fields.ts"],"names":[],"mappings":";;AAAA,kBAAe;IAEb,UAAU,EAAE;QACV,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,4CAA4C;QACzD,IAAI,EAAE,QAAQ;QACd,eAAe,EAAE,UAAU;QAC3B,QAAQ,EAAE,IAAI;QACd,oBAAoB,EAAE,IAAI;QAC1B,OAAO,EAAE;YACP,cAAc,EAAE;gBACd,OAAO,EAAE;oBACP,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE;wBACL,OAAO,EAAE,wCAAwC;qBAClD;iBACF;aACF;YACD,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;YAChC,YAAY,EAAE,EAAE,OAAO,EAAE,2BAA2B,EAAE;YACtD,wBAAwB,EAAE,EAAE,OAAO,EAAE,oCAAoC,EAAE;YAC3E,uBAAuB,EAAE,EAAE,OAAO,EAAE,mCAAmC,EAAE;YACzE,2BAA2B,EAAE,EAAE,OAAO,EAAE,uCAAuC,EAAE;YACjF,sBAAsB,EAAE,EAAE,OAAO,EAAE,qCAAqC,EAAE;YAC1E,UAAU,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;SACnC;KACF;CACF,CAAA"}
@@ -0,0 +1,9 @@
1
+ export interface Payload {
2
+ event: string;
3
+ properties: {
4
+ [k: string]: unknown;
5
+ };
6
+ messageId: string;
7
+ type: string;
8
+ receivedAt: string | number;
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/databricks/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,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const action = {
4
+ title: 'Send Custom Event',
5
+ description: 'Record custom events in Databricks',
6
+ fields: {
7
+ event: {
8
+ label: 'Table Name',
9
+ description: 'The name of the table.',
10
+ type: 'string',
11
+ required: true,
12
+ default: { '@path': '$.event' },
13
+ unsafe_hidden: true
14
+ },
15
+ properties: {
16
+ label: 'Columns',
17
+ description: `Additional columns to write to Databricks.`,
18
+ type: 'object',
19
+ defaultObjectUI: 'keyvalue',
20
+ required: true,
21
+ additionalProperties: true,
22
+ default: {
23
+ user_id: { '@path': '$.userId' }
24
+ }
25
+ },
26
+ messageId: {
27
+ label: 'ID',
28
+ description: 'Name of column for the unique identifier for the message.',
29
+ type: 'string',
30
+ required: true,
31
+ default: { '@path': '$.messageId' },
32
+ readOnly: true
33
+ },
34
+ type: {
35
+ label: 'Event Type',
36
+ description: 'The type of event.',
37
+ type: 'string',
38
+ required: true,
39
+ default: { '@path': '$.type' },
40
+ readOnly: true,
41
+ unsafe_hidden: true
42
+ },
43
+ receivedAt: {
44
+ label: 'Received At',
45
+ description: 'Time when event was received.',
46
+ type: 'datetime',
47
+ required: true,
48
+ default: { '@path': '$.receivedAt' }
49
+ }
50
+ },
51
+ perform: () => {
52
+ return undefined;
53
+ }
54
+ };
55
+ exports.default = action;
56
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/databricks/sendCustomEvent/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EAAE,oCAAoC;IACjD,MAAM,EAAE;QACN,KAAK,EAAE;YACL,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;YAC/B,aAAa,EAAE,IAAI;SACpB;QAED,UAAU,EAAE;YACV,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,4CAA4C;YACzD,IAAI,EAAE,QAAQ;YACd,eAAe,EAAE,UAAU;YAC3B,QAAQ,EAAE,IAAI;YACd,oBAAoB,EAAE,IAAI;YAC1B,OAAO,EAAE;gBACP,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;aACjC;SACF;QAED,SAAS,EAAE;YACT,KAAK,EAAE,IAAI;YACX,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,IAAI,EAAE;YACJ,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,oBAAoB;YACjC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;YAC9B,QAAQ,EAAE,IAAI;YAGd,aAAa,EAAE,IAAI;SACpB;QACD,UAAU,EAAE;YACV,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;SACrC;KACF;IACD,OAAO,EAAE,GAAG,EAAE;QACZ,OAAO,SAAS,CAAA;IAClB,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,47 @@
1
+ declare const _default: {
2
+ properties: {
3
+ label: string;
4
+ description: string;
5
+ type: string;
6
+ defaultObjectUI: string;
7
+ required: boolean;
8
+ additionalProperties: boolean;
9
+ default: {
10
+ journey_metadata: {
11
+ '@json': {
12
+ mode: string;
13
+ value: {
14
+ '@path': string;
15
+ };
16
+ };
17
+ };
18
+ journey_context: {
19
+ '@json': {
20
+ mode: string;
21
+ value: {
22
+ '@path': string;
23
+ };
24
+ };
25
+ };
26
+ user_id: {
27
+ '@path': string;
28
+ };
29
+ personas_computation_key: {
30
+ '@path': string;
31
+ };
32
+ personas_computation_id: {
33
+ '@path': string;
34
+ };
35
+ personas_activation_id: {
36
+ '@path': string;
37
+ };
38
+ personas_computation_class: {
39
+ '@path': string;
40
+ };
41
+ event_name: {
42
+ '@path': string;
43
+ };
44
+ };
45
+ };
46
+ };
47
+ export default _default;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ properties: {
5
+ label: 'Columns',
6
+ description: `Additional columns to write to Databricks.`,
7
+ type: 'object',
8
+ defaultObjectUI: 'keyvalue',
9
+ required: true,
10
+ additionalProperties: true,
11
+ default: {
12
+ journey_metadata: {
13
+ '@json': {
14
+ mode: 'encode',
15
+ value: {
16
+ '@path': '$.properties.journey_metadata'
17
+ }
18
+ }
19
+ },
20
+ journey_context: {
21
+ '@json': {
22
+ mode: 'encode',
23
+ value: {
24
+ '@path': '$.properties.journey_context'
25
+ }
26
+ }
27
+ },
28
+ user_id: { '@path': '$.userId' },
29
+ personas_computation_key: { '@path': '$.context.personas.computation_key' },
30
+ personas_computation_id: { '@path': '$.context.personas.computation_id' },
31
+ personas_activation_id: { '@path': '$.context.personas.event_emitter_id' },
32
+ personas_computation_class: { '@path': '$.context.personas.computation_class' },
33
+ event_name: { '@path': '$.event' }
34
+ }
35
+ }
36
+ };
37
+ //# sourceMappingURL=journeys-default-fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"journeys-default-fields.js","sourceRoot":"","sources":["../../../../src/destinations/databricks/sendCustomEvent/journeys-default-fields.ts"],"names":[],"mappings":";;AAAA,kBAAe;IAEb,UAAU,EAAE;QACV,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,4CAA4C;QACzD,IAAI,EAAE,QAAQ;QACd,eAAe,EAAE,UAAU;QAC3B,QAAQ,EAAE,IAAI;QACd,oBAAoB,EAAE,IAAI;QAC1B,OAAO,EAAE;YACP,gBAAgB,EAAE;gBAChB,OAAO,EAAE;oBACP,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE;wBACL,OAAO,EAAE,+BAA+B;qBACzC;iBACF;aACF;YACD,eAAe,EAAE;gBACf,OAAO,EAAE;oBACP,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE;wBACL,OAAO,EAAE,8BAA8B;qBACxC;iBACF;aACF;YACD,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;YAChC,wBAAwB,EAAE,EAAE,OAAO,EAAE,oCAAoC,EAAE;YAC3E,uBAAuB,EAAE,EAAE,OAAO,EAAE,mCAAmC,EAAE;YACzE,sBAAsB,EAAE,EAAE,OAAO,EAAE,qCAAqC,EAAE;YAC1E,0BAA0B,EAAE,EAAE,OAAO,EAAE,sCAAsC,EAAE;YAC/E,UAAU,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;SACnC;KACF;CACF,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@segment/warehouse-destinations",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "description": "Definitions for warehouse destinations. Only used for definitions - should not be imported for anything other than types.",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -28,5 +28,5 @@
28
28
  "@segment/actions-core": "^3.160.0",
29
29
  "globby": "^14.1.0"
30
30
  },
31
- "gitHead": "a945135cc54a818a4ccdc3f1961c576d30087665"
31
+ "gitHead": "2de552cc84a807a6b6f32be9291fe7f705680a26"
32
32
  }