@segment/action-destinations 3.110.1-alpha.3 → 3.110.1-alpha.9

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.
Files changed (40) hide show
  1. package/dist/destinations/amplitude/compact.d.ts +2 -0
  2. package/dist/destinations/amplitude/compact.js +7 -0
  3. package/dist/destinations/amplitude/compact.js.map +1 -0
  4. package/dist/destinations/hubspot/createCustomObjectRecord/generated-types.d.ts +6 -0
  5. package/dist/destinations/hubspot/createCustomObjectRecord/generated-types.js +3 -0
  6. package/dist/destinations/hubspot/createCustomObjectRecord/generated-types.js.map +1 -0
  7. package/dist/destinations/hubspot/createCustomObjectRecord/index.d.ts +5 -0
  8. package/dist/destinations/hubspot/createCustomObjectRecord/index.js +38 -0
  9. package/dist/destinations/hubspot/createCustomObjectRecord/index.js.map +1 -0
  10. package/dist/destinations/hubspot/generated-types.d.ts +2 -0
  11. package/dist/destinations/hubspot/generated-types.js +3 -0
  12. package/dist/destinations/hubspot/generated-types.js.map +1 -0
  13. package/dist/destinations/hubspot/index.d.ts +4 -0
  14. package/dist/destinations/hubspot/index.js +45 -0
  15. package/dist/destinations/hubspot/index.js.map +1 -0
  16. package/dist/destinations/hubspot/properties.d.ts +1 -0
  17. package/dist/destinations/hubspot/properties.js +5 -0
  18. package/dist/destinations/hubspot/properties.js.map +1 -0
  19. package/dist/destinations/hubspot/sendCustomBehavioralEvent/generated-types.d.ts +10 -0
  20. package/dist/destinations/hubspot/sendCustomBehavioralEvent/generated-types.js +3 -0
  21. package/dist/destinations/hubspot/sendCustomBehavioralEvent/generated-types.js.map +1 -0
  22. package/dist/destinations/hubspot/sendCustomBehavioralEvent/index.d.ts +5 -0
  23. package/dist/destinations/hubspot/sendCustomBehavioralEvent/index.js +69 -0
  24. package/dist/destinations/hubspot/sendCustomBehavioralEvent/index.js.map +1 -0
  25. package/dist/destinations/hubspot/testHelper.d.ts +7 -0
  26. package/dist/destinations/hubspot/testHelper.js +24 -0
  27. package/dist/destinations/hubspot/testHelper.js.map +1 -0
  28. package/dist/destinations/loops/createContact/generated-types.d.ts +3 -0
  29. package/dist/destinations/loops/createContact/generated-types.js +3 -0
  30. package/dist/destinations/loops/createContact/generated-types.js.map +1 -0
  31. package/dist/destinations/loops/createContact/index.d.ts +5 -0
  32. package/dist/destinations/loops/createContact/index.js +33 -0
  33. package/dist/destinations/loops/createContact/index.js.map +1 -0
  34. package/dist/destinations/loops/generated-types.d.ts +3 -0
  35. package/dist/destinations/loops/generated-types.js +3 -0
  36. package/dist/destinations/loops/generated-types.js.map +1 -0
  37. package/dist/destinations/loops/index.d.ts +4 -0
  38. package/dist/destinations/loops/index.js +35 -0
  39. package/dist/destinations/loops/index.js.map +1 -0
  40. package/package.json +4 -4
@@ -0,0 +1,2 @@
1
+ import { Payload as LogV2Payload } from './logEventV2/generated-types';
2
+ export default function compact(object: LogV2Payload['setOnce'] | LogV2Payload['setAlways'] | LogV2Payload['add']): boolean;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ function compact(object) {
4
+ return Object.keys(Object.fromEntries(Object.entries(object ?? {}).filter(([_, v]) => v !== ''))).length > 0;
5
+ }
6
+ exports.default = compact;
7
+ //# sourceMappingURL=compact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compact.js","sourceRoot":"","sources":["../../../src/destinations/amplitude/compact.ts"],"names":[],"mappings":";;AASA,SAAwB,OAAO,CAC7B,MAAiF;IAEjF,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAA;AAC9G,CAAC;AAJD,0BAIC"}
@@ -0,0 +1,6 @@
1
+ export interface Payload {
2
+ objectType: string;
3
+ properties: {
4
+ [k: string]: unknown;
5
+ };
6
+ }
@@ -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/hubspot/createCustomObjectRecord/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,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const actions_core_1 = require("@segment/actions-core");
4
+ const hubspotDefinedObjects = ['deals', 'tickets'];
5
+ const customObjectExpression = new RegExp('^[a-zA-Z0-9]+_[a-zA-Z][a-zA-Z0-9_-]+$');
6
+ const action = {
7
+ title: 'Create Custom Object',
8
+ description: 'Create a Custom Object in HubSpot',
9
+ fields: {
10
+ objectType: {
11
+ label: 'Object Type',
12
+ description: 'The CRM object schema to use for creating a record. This can be a standard object (i.e. tickets, deals) or ***fullyQualifiedName*** of a custom object. Schema for the Custom Objects must be predefined in HubSpot. More information on Custom Objects and *fullyQualifiedName* in [HubSpot documentation](https://developers.hubspot.com/docs/cms/data/crm-objects#getting-a-custom-object-type-s-details).',
13
+ type: 'string',
14
+ required: true
15
+ },
16
+ properties: {
17
+ label: 'Properties',
18
+ description: 'Properties to send to HubSpot. Please make sure to include the object’s required properties. Any custom properties must be predefined in HubSpot. More information in [HubSpot documentation](https://knowledge.hubspot.com/crm-setup/manage-your-properties#create-custom-properties).',
19
+ type: 'object',
20
+ required: true,
21
+ defaultObjectUI: 'keyvalue:only',
22
+ allowNull: false
23
+ }
24
+ },
25
+ perform: async (request, { payload }) => {
26
+ if (!customObjectExpression.test(payload.objectType) && !hubspotDefinedObjects.includes(payload.objectType)) {
27
+ throw new actions_core_1.IntegrationError('Custom Object is not in valid format. Please make sure that you are using either a valid format of object’s fullyQualifiedName (eg: p11223344_myobject) or a supported HubSpot defined object (i.e.: deals, tickets).', 'Custom Object is not in valid format', 400);
28
+ }
29
+ return request(`https://api.hubapi.com/crm/v3/objects/${payload.objectType}`, {
30
+ method: 'POST',
31
+ json: {
32
+ properties: { ...payload.properties }
33
+ }
34
+ });
35
+ }
36
+ };
37
+ exports.default = action;
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/hubspot/createCustomObjectRecord/index.ts"],"names":[],"mappings":";;AACA,wDAAwD;AAKxD,MAAM,qBAAqB,GAAa,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;AAK5D,MAAM,sBAAsB,GAAG,IAAI,MAAM,CAAC,uCAAuC,CAAC,CAAA;AAElF,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,sBAAsB;IAC7B,WAAW,EAAE,mCAAmC;IAChD,MAAM,EAAE;QACN,UAAU,EAAE;YACV,KAAK,EAAE,aAAa;YACpB,WAAW,EACT,+YAA+Y;YACjZ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,UAAU,EAAE;YACV,KAAK,EAAE,YAAY;YACnB,WAAW,EACT,yRAAyR;YAC3R,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,eAAe,EAAE,eAAe;YAChC,SAAS,EAAE,KAAK;SACjB;KACF;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAEtC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;YAC3G,MAAM,IAAI,+BAAgB,CACxB,uNAAuN,EACvN,sCAAsC,EACtC,GAAG,CACJ,CAAA;SACF;QAED,OAAO,OAAO,CAAC,yCAAyC,OAAO,CAAC,UAAU,EAAE,EAAE;YAC5E,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,UAAU,EAAE,EAAE,GAAG,OAAO,CAAC,UAAU,EAAE;aACtC;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,2 @@
1
+ export interface Settings {
2
+ }
@@ -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/hubspot/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { DestinationDefinition } from '@segment/actions-core';
2
+ import type { Settings } from './generated-types';
3
+ declare const destination: DestinationDefinition<Settings>;
4
+ export default destination;
@@ -0,0 +1,45 @@
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 sendCustomBehavioralEvent_1 = __importDefault(require("./sendCustomBehavioralEvent"));
7
+ const createCustomObjectRecord_1 = __importDefault(require("./createCustomObjectRecord"));
8
+ const properties_1 = require("./properties");
9
+ const destination = {
10
+ name: 'Hubspot Cloud Mode (Actions)',
11
+ slug: 'actions-hubspot-cloud',
12
+ mode: 'cloud',
13
+ authentication: {
14
+ scheme: 'oauth2',
15
+ fields: {},
16
+ testAuthentication: (request) => {
17
+ return request(`${properties_1.hubSpotBaseURL}/crm/v3/objects/contacts?limit=1`);
18
+ },
19
+ refreshAccessToken: async (request, { auth }) => {
20
+ const res = await request(`${properties_1.hubSpotBaseURL}/oauth/v1/token`, {
21
+ method: 'POST',
22
+ body: new URLSearchParams({
23
+ refresh_token: auth.refreshToken,
24
+ client_id: auth.clientId,
25
+ client_secret: auth.clientSecret,
26
+ grant_type: 'refresh_token'
27
+ })
28
+ });
29
+ return { accessToken: res.data?.access_token };
30
+ }
31
+ },
32
+ extendRequest({ auth }) {
33
+ return {
34
+ headers: {
35
+ authorization: `Bearer ${auth?.accessToken}`
36
+ }
37
+ };
38
+ },
39
+ actions: {
40
+ sendCustomBehavioralEvent: sendCustomBehavioralEvent_1.default,
41
+ createCustomObjectRecord: createCustomObjectRecord_1.default
42
+ }
43
+ };
44
+ exports.default = destination;
45
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/hubspot/index.ts"],"names":[],"mappings":";;;;;AAGA,4FAAmE;AACnE,0FAAiE;AACjE,6CAA6C;AAK7C,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,8BAA8B;IACpC,IAAI,EAAE,uBAAuB;IAC7B,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,EAAE;QACV,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE;YAE9B,OAAO,OAAO,CAAC,GAAG,2BAAc,kCAAkC,CAAC,CAAA;QACrE,CAAC;QACD,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YAE9C,MAAM,GAAG,GAAG,MAAM,OAAO,CAAuB,GAAG,2BAAc,iBAAiB,EAAE;gBAClF,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,IAAI,eAAe,CAAC;oBACxB,aAAa,EAAE,IAAI,CAAC,YAAY;oBAChC,SAAS,EAAE,IAAI,CAAC,QAAQ;oBACxB,aAAa,EAAE,IAAI,CAAC,YAAY;oBAChC,UAAU,EAAE,eAAe;iBAC5B,CAAC;aACH,CAAC,CAAA;YAEF,OAAO,EAAE,WAAW,EAAE,GAAG,CAAC,IAAI,EAAE,YAAY,EAAE,CAAA;QAChD,CAAC;KACF;IACD,aAAa,CAAC,EAAE,IAAI,EAAE;QACpB,OAAO;YACL,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,IAAI,EAAE,WAAW,EAAE;aAC7C;SACF,CAAA;IACH,CAAC;IAED,OAAO,EAAE;QACP,yBAAyB,EAAzB,mCAAyB;QACzB,wBAAwB,EAAxB,kCAAwB;KACzB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
@@ -0,0 +1 @@
1
+ export declare const hubSpotBaseURL = "https://api.hubapi.com";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hubSpotBaseURL = void 0;
4
+ exports.hubSpotBaseURL = 'https://api.hubapi.com';
5
+ //# sourceMappingURL=properties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../src/destinations/hubspot/properties.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG,wBAAwB,CAAA"}
@@ -0,0 +1,10 @@
1
+ export interface Payload {
2
+ eventName: string;
3
+ occurredAt?: string | number;
4
+ email?: string;
5
+ utk?: string;
6
+ objectId?: string;
7
+ properties?: {
8
+ [k: string]: unknown;
9
+ };
10
+ }
@@ -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/hubspot/sendCustomBehavioralEvent/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,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const properties_1 = require("../properties");
4
+ const action = {
5
+ title: 'Send Custom Behavioral Event',
6
+ description: 'Send a custom behavioral event to HubSpot.',
7
+ defaultSubscription: 'type = "track"',
8
+ fields: {
9
+ eventName: {
10
+ label: 'Event Name',
11
+ description: 'The internal event name assigned by HubSpot. This can be found in your HubSpot account. Events must be predefined in HubSpot. Learn how to find the internal name in [HubSpot’s documentation](https://knowledge.hubspot.com/analytics-tools/create-custom-behavioral-events).',
12
+ type: 'string',
13
+ required: true
14
+ },
15
+ occurredAt: {
16
+ label: 'Event Timestamp',
17
+ description: "The time when this event occurred. If this isn't set, the current time will be used.",
18
+ type: 'datetime',
19
+ default: {
20
+ '@path': '$.timestamp'
21
+ }
22
+ },
23
+ email: {
24
+ label: 'Email Address',
25
+ description: 'The email of the contact associated with this event. This is required if no user token or object ID is provided.',
26
+ type: 'string',
27
+ format: 'email',
28
+ default: {
29
+ '@if': {
30
+ exists: { '@path': '$.properties.email' },
31
+ then: { '@path': '$.properties.email' },
32
+ else: { '@path': '$.context.traits.email' }
33
+ }
34
+ }
35
+ },
36
+ utk: {
37
+ label: 'User Token',
38
+ description: 'The user token (utk) of the contact associated with this event. This is required if no email or object ID is provided.',
39
+ type: 'string'
40
+ },
41
+ objectId: {
42
+ label: 'Object ID',
43
+ description: 'The ID of the object associated with this event. This can be the HubSpot contact ID, company ID, or ID of any other object. This is required if no email or user token is provided.',
44
+ type: 'string'
45
+ },
46
+ properties: {
47
+ label: 'Event Properties',
48
+ description: 'Default or custom properties that describe the event. See more information in [HubSpot’s documentation](https://knowledge.hubspot.com/analytics-tools/create-custom-behavioral-events#add-and-manage-event-properties).',
49
+ type: 'object',
50
+ defaultObjectUI: 'keyvalue:only'
51
+ }
52
+ },
53
+ perform: (request, { payload }) => {
54
+ const event = {
55
+ eventName: payload.eventName,
56
+ occurredAt: payload.occurredAt,
57
+ utk: payload.utk,
58
+ email: payload.email,
59
+ objectId: payload.objectId,
60
+ properties: payload.properties
61
+ };
62
+ return request(`${properties_1.hubSpotBaseURL}/events/v3/send`, {
63
+ method: 'post',
64
+ json: event
65
+ });
66
+ }
67
+ };
68
+ exports.default = action;
69
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/hubspot/sendCustomBehavioralEvent/index.ts"],"names":[],"mappings":";;AAEA,8CAA8C;AAY9C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,8BAA8B;IACrC,WAAW,EAAE,4CAA4C;IACzD,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,SAAS,EAAE;YACT,KAAK,EAAE,YAAY;YACnB,WAAW,EACT,gRAAgR;YAClR,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,UAAU,EAAE;YACV,KAAK,EAAE,iBAAiB;YACxB,WAAW,EAAE,sFAAsF;YACnG,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,KAAK,EAAE;YACL,KAAK,EAAE,eAAe;YACtB,WAAW,EACT,kHAAkH;YACpH,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,OAAO;YACf,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;oBACzC,IAAI,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;oBACvC,IAAI,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE;iBAC5C;aACF;SACF;QACD,GAAG,EAAE;YACH,KAAK,EAAE,YAAY;YACnB,WAAW,EACT,wHAAwH;YAC1H,IAAI,EAAE,QAAQ;SACf;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,WAAW;YAClB,WAAW,EACT,qLAAqL;YACvL,IAAI,EAAE,QAAQ;SACf;QACD,UAAU,EAAE;YACV,KAAK,EAAE,kBAAkB;YACzB,WAAW,EACT,yNAAyN;YAC3N,IAAI,EAAE,QAAQ;YACd,eAAe,EAAE,eAAe;SACjC;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAChC,MAAM,KAAK,GAA0B;YACnC,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B,CAAA;QACD,OAAO,OAAO,CAAC,GAAG,2BAAc,iBAAiB,EAAE;YACjD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,KAAK;SACZ,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,7 @@
1
+ declare const generateValidHubSpotCustomObjectName: (seed: string) => {
2
+ objectType: string;
3
+ properties: {
4
+ testProperty: string;
5
+ };
6
+ };
7
+ export { generateValidHubSpotCustomObjectName };
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateValidHubSpotCustomObjectName = void 0;
4
+ const generateHash = (seed) => {
5
+ let i, chr, hash;
6
+ hash = 0;
7
+ if (seed.length === 0)
8
+ return hash;
9
+ for (i = 0; i < seed.length; i++) {
10
+ chr = seed.charCodeAt(i);
11
+ hash = (hash << 5) - hash + chr;
12
+ hash |= 0;
13
+ }
14
+ return Math.abs(hash);
15
+ };
16
+ const generateValidHubSpotCustomObjectName = (seed) => {
17
+ const hash = generateHash(seed);
18
+ return {
19
+ objectType: `p${hash}_Obj${hash}`,
20
+ properties: { testProperty: `testValue-${hash}` }
21
+ };
22
+ };
23
+ exports.generateValidHubSpotCustomObjectName = generateValidHubSpotCustomObjectName;
24
+ //# sourceMappingURL=testHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testHelper.js","sourceRoot":"","sources":["../../../src/destinations/hubspot/testHelper.ts"],"names":[],"mappings":";;;AAAA,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,EAAE;IACpC,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,CAAA;IAChB,IAAI,GAAG,CAAC,CAAA;IAER,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAA;IAClC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAChC,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;QACxB,IAAI,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,GAAG,GAAG,CAAA;QAC/B,IAAI,IAAI,CAAC,CAAA;KACV;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AACvB,CAAC,CAAA;AAED,MAAM,oCAAoC,GAAG,CAAC,IAAY,EAAE,EAAE;IAC5D,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,CAAA;IAC/B,OAAO;QACL,UAAU,EAAE,IAAI,IAAI,OAAO,IAAI,EAAE;QACjC,UAAU,EAAE,EAAE,YAAY,EAAE,aAAa,IAAI,EAAE,EAAE;KAClD,CAAA;AACH,CAAC,CAAA;AACQ,oFAAoC"}
@@ -0,0 +1,3 @@
1
+ export interface Payload {
2
+ email: 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/loops/createContact/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,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const action = {
4
+ title: 'Create a contact',
5
+ description: 'Create a contact in Loops',
6
+ defaultSubscription: 'type = "identify"',
7
+ fields: {
8
+ email: {
9
+ label: 'Contact Email',
10
+ description: 'Email address for the contact.',
11
+ type: 'string',
12
+ format: 'email',
13
+ required: true,
14
+ default: {
15
+ '@if': {
16
+ exists: { '@path': '$.traits.email' },
17
+ then: { '@path': '$.traits.email' },
18
+ else: { '@path': '$.email' }
19
+ }
20
+ }
21
+ }
22
+ },
23
+ perform: (request, { payload }) => {
24
+ return request('https://app.loops.so/api/v1/contacts/create', {
25
+ method: 'post',
26
+ json: {
27
+ email: payload.email
28
+ }
29
+ });
30
+ }
31
+ };
32
+ exports.default = action;
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/loops/createContact/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,2BAA2B;IACxC,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,KAAK,EAAE;YACL,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE,gCAAgC;YAC7C,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,OAAO;YACf,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;oBACrC,IAAI,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;oBACnC,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;iBAC7B;aACF;SACF;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAChC,OAAO,OAAO,CAAC,6CAA6C,EAAE;YAC5D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,KAAK,EAAE,OAAO,CAAC,KAAK;aACrB;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,3 @@
1
+ export interface Settings {
2
+ apiKey: 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/loops/generated-types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import type { DestinationDefinition } from '@segment/actions-core';
2
+ import type { Settings } from './generated-types';
3
+ declare const destination: DestinationDefinition<Settings>;
4
+ export default destination;
@@ -0,0 +1,35 @@
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 createContact_1 = __importDefault(require("./createContact"));
7
+ const destination = {
8
+ name: 'Loops (Actions)',
9
+ slug: 'actions-loops',
10
+ mode: 'cloud',
11
+ extendRequest: ({ settings }) => {
12
+ return {
13
+ headers: { Authorization: `Bearer ${settings.apiKey}`, 'Content-Type': 'application/json' }
14
+ };
15
+ },
16
+ authentication: {
17
+ scheme: 'custom',
18
+ fields: {
19
+ apiKey: {
20
+ label: 'API Key',
21
+ description: 'Your Loops API Key',
22
+ type: 'string',
23
+ required: true
24
+ }
25
+ },
26
+ testAuthentication: (request) => {
27
+ return request('https://app.loops.so/api/v1/api-key', { method: 'GET' });
28
+ }
29
+ },
30
+ actions: {
31
+ createContact: createContact_1.default
32
+ }
33
+ };
34
+ exports.default = destination;
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/loops/index.ts"],"names":[],"mappings":";;;;;AAGA,oEAA2C;AAE3C,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,eAAe;IACrB,IAAI,EAAE,OAAO;IAEb,aAAa,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC9B,OAAO;YACL,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,QAAQ,CAAC,MAAM,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;SAC5F,CAAA;IACH,CAAC;IAED,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,oBAAoB;gBACjC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE;YAC9B,OAAO,OAAO,CAAC,qCAAqC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAA;QAC1E,CAAC;KACF;IAED,OAAO,EAAE;QACP,aAAa,EAAb,uBAAa;KACd;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@segment/action-destinations",
3
3
  "description": "Destination Actions engine and definitions.",
4
- "version": "3.110.1-alpha.3",
4
+ "version": "3.110.1-alpha.9",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/segmentio/action-destinations",
@@ -38,8 +38,8 @@
38
38
  "dependencies": {
39
39
  "@amplitude/ua-parser-js": "^0.7.25",
40
40
  "@segment/a1-notation": "^2.1.4",
41
- "@segment/actions-core": "^3.36.1-alpha.4",
42
- "@segment/actions-shared": "^1.19.1-alpha.3",
41
+ "@segment/actions-core": "^3.35.0",
42
+ "@segment/actions-shared": "^1.18.0",
43
43
  "cheerio": "^1.0.0-rc.10",
44
44
  "dayjs": "^1.10.7",
45
45
  "escape-goat": "^3",
@@ -65,5 +65,5 @@
65
65
  "lcov"
66
66
  ]
67
67
  },
68
- "gitHead": "1f90b4c3badbe2d257907350dea3d3b9992dea6b"
68
+ "gitHead": "67b858eeb09b789e91fcebab08621fa4ae29cb9b"
69
69
  }