@segment/action-destinations 3.177.0 → 3.178.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/dist/destinations/acoustic/Utility/eventprocessing.js +10 -1
- package/dist/destinations/acoustic/Utility/eventprocessing.js.map +1 -1
- package/dist/destinations/acoustic/Utility/tablemaintutilities.js +17 -34
- package/dist/destinations/acoustic/Utility/tablemaintutilities.js.map +1 -1
- package/dist/destinations/acoustic/generated-types.d.ts +1 -0
- package/dist/destinations/acoustic/index.js +18 -8
- package/dist/destinations/acoustic/index.js.map +1 -1
- package/dist/destinations/acoustic/receiveEvents/index.js +3 -3
- package/dist/destinations/acoustic/receiveEvents/index.js.map +1 -1
- package/dist/destinations/devrev/createRevUser/generated-types.d.ts +8 -0
- package/dist/destinations/devrev/createRevUser/generated-types.js +3 -0
- package/dist/destinations/devrev/createRevUser/generated-types.js.map +1 -0
- package/dist/destinations/devrev/createRevUser/index.d.ts +5 -0
- package/dist/destinations/devrev/createRevUser/index.js +171 -0
- package/dist/destinations/devrev/createRevUser/index.js.map +1 -0
- package/dist/destinations/devrev/createWork/generated-types.d.ts +9 -0
- package/dist/destinations/devrev/createWork/generated-types.js +3 -0
- package/dist/destinations/devrev/createWork/generated-types.js.map +1 -0
- package/dist/destinations/devrev/createWork/index.d.ts +5 -0
- package/dist/destinations/devrev/createWork/index.js +146 -0
- package/dist/destinations/devrev/createWork/index.js.map +1 -0
- package/dist/destinations/devrev/generated-types.d.ts +4 -0
- package/dist/destinations/devrev/generated-types.js +3 -0
- package/dist/destinations/devrev/generated-types.js.map +1 -0
- package/dist/destinations/devrev/index.d.ts +4 -0
- package/dist/destinations/devrev/index.js +47 -0
- package/dist/destinations/devrev/index.js.map +1 -0
- package/dist/destinations/devrev/mocks/index.d.ts +144 -0
- package/dist/destinations/devrev/mocks/index.js +145 -0
- package/dist/destinations/devrev/mocks/index.js.map +1 -0
- package/dist/destinations/devrev/utils/constants.d.ts +15 -0
- package/dist/destinations/devrev/utils/constants.js +19 -0
- package/dist/destinations/devrev/utils/constants.js.map +1 -0
- package/dist/destinations/devrev/utils/helpers.d.ts +14 -0
- package/dist/destinations/devrev/utils/helpers.js +56 -0
- package/dist/destinations/devrev/utils/helpers.js.map +1 -0
- package/dist/destinations/devrev/utils/index.d.ts +3 -0
- package/dist/destinations/devrev/utils/index.js +16 -0
- package/dist/destinations/devrev/utils/index.js.map +1 -0
- package/dist/destinations/devrev/utils/types.d.ts +105 -0
- package/dist/destinations/devrev/utils/types.js +3 -0
- package/dist/destinations/devrev/utils/types.js.map +1 -0
- package/dist/destinations/hubspot/api/index.d.ts +16 -0
- package/dist/destinations/hubspot/api/index.js +55 -0
- package/dist/destinations/hubspot/api/index.js.map +1 -0
- package/dist/destinations/hubspot/errors.d.ts +2 -0
- package/dist/destinations/hubspot/errors.js +3 -1
- package/dist/destinations/hubspot/errors.js.map +1 -1
- package/dist/destinations/hubspot/sendCustomBehavioralEvent/index.js +2 -2
- package/dist/destinations/hubspot/sendCustomBehavioralEvent/index.js.map +1 -1
- package/dist/destinations/hubspot/upsertCompany/index.js +13 -68
- package/dist/destinations/hubspot/upsertCompany/index.js.map +1 -1
- package/dist/destinations/hubspot/upsertContact/index.js +2 -2
- package/dist/destinations/hubspot/upsertContact/index.js.map +1 -1
- package/dist/destinations/hubspot/upsertCustomObjectRecord/generated-types.d.ts +4 -0
- package/dist/destinations/hubspot/upsertCustomObjectRecord/index.js +47 -8
- package/dist/destinations/hubspot/upsertCustomObjectRecord/index.js.map +1 -1
- package/dist/destinations/hubspot/utils.d.ts +47 -0
- package/dist/destinations/hubspot/utils.js +43 -0
- package/dist/destinations/hubspot/utils.js.map +1 -0
- package/dist/destinations/index.js +1 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/voucherify/upsertCustomer/generated-types.d.ts +13 -13
- package/dist/destinations/voucherify/upsertCustomer/index.js +18 -5
- package/dist/destinations/voucherify/upsertCustomer/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/destinations/hubspot/helperFunctions.d.ts +0 -7
- package/dist/destinations/hubspot/helperFunctions.js +0 -27
- package/dist/destinations/hubspot/helperFunctions.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/devrev/createWork/index.ts"],"names":[],"mappings":";;AAKA,oCAA+F;AAG/F,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,yBAAyB;IACtC,mBAAmB,EAAE,6CAA6C;IAClE,MAAM,EAAE;QACN,MAAM,EAAE;YACN,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,wCAAwC;YACrD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,IAAI;SACd;QACD,KAAK,EAAE;YACL,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,kCAAkC;YAC/C,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,yBAAyB,EAAE;oBAC9C,IAAI,EAAE,EAAE,OAAO,EAAE,yBAAyB,EAAE;oBAC5C,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;iBAC7B;aACF;SACF;QACD,WAAW,EAAE;YACX,KAAK,EAAE,kBAAkB;YACzB,WAAW,EAAE,wCAAwC;YACrD,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,0BAA0B,EAAE;SACjD;QACD,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;YACd,WAAW,EAAE,sDAAsD;YACnE,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,OAAO;YACf,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;SAC3C;QACD,QAAQ,EAAE;YACR,KAAK,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AED,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAChC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAA;QACxE,MAAM,GAAG,GAAG,GAAG,qBAAa,GAAG,sBAAc,CAAC,WAAW,EAAE,CAAA;QAC3D,MAAM,OAAO,GAAmB;YAC9B,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,eAAe,EAAE,MAAM;gBACvB,KAAK;gBACL,IAAI,EAAE,WAAW;gBACjB,QAAQ,EAAE,CAAC,QAAQ,CAAC;gBACpB,IAAI;gBACJ,QAAQ;aACT;SACF,CAAA;QAED,OAAO,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;IAC9B,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/devrev/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,47 @@
|
|
|
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 createWork_1 = __importDefault(require("./createWork"));
|
|
7
|
+
const createRevUser_1 = __importDefault(require("./createRevUser"));
|
|
8
|
+
const utils_1 = require("./utils");
|
|
9
|
+
const destination = {
|
|
10
|
+
name: 'DevRev',
|
|
11
|
+
slug: 'actions-devrev',
|
|
12
|
+
mode: 'cloud',
|
|
13
|
+
description: 'Send Segment events via Cloud Mode to DevRev to create work items and RevUsers',
|
|
14
|
+
extendRequest: ({ settings }) => {
|
|
15
|
+
return {
|
|
16
|
+
headers: { Authorization: `${settings.apiKey}` }
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
authentication: {
|
|
20
|
+
scheme: 'custom',
|
|
21
|
+
fields: {
|
|
22
|
+
apiKey: {
|
|
23
|
+
label: 'DevRev API Key',
|
|
24
|
+
description: 'Your DevRev API Key, generated from the setting page in your DevRev organization.',
|
|
25
|
+
type: 'password',
|
|
26
|
+
required: true
|
|
27
|
+
},
|
|
28
|
+
blacklistedDomains: {
|
|
29
|
+
label: 'Blacklisted Domains',
|
|
30
|
+
description: 'A comma separated list of email domains to blacklist from being used to search for/create Accounts.',
|
|
31
|
+
type: 'string',
|
|
32
|
+
required: false,
|
|
33
|
+
default: 'gmail.com,hotmail.com,outlook.com,yahoo.com,aol.com,icloud.com,me.com,msn.com'
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
testAuthentication: (request) => {
|
|
37
|
+
const url = `${utils_1.devrevApiRoot}${utils_1.devrevApiPaths.authTest}`;
|
|
38
|
+
return request(url);
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
actions: {
|
|
42
|
+
createWork: createWork_1.default,
|
|
43
|
+
createRevUser: createRevUser_1.default
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.default = destination;
|
|
47
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/devrev/index.ts"],"names":[],"mappings":";;;;;AAGA,8DAAqC;AAErC,oEAA2C;AAC3C,mCAAuD;AAEvD,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,OAAO;IACb,WAAW,EAAE,gFAAgF;IAC7F,aAAa,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC9B,OAAO;YACL,OAAO,EAAE,EAAE,aAAa,EAAE,GAAG,QAAQ,CAAC,MAAM,EAAE,EAAE;SACjD,CAAA;IACH,CAAC;IACD,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,MAAM,EAAE;gBACN,KAAK,EAAE,gBAAgB;gBACvB,WAAW,EAAE,mFAAmF;gBAChG,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE,IAAI;aACf;YACD,kBAAkB,EAAE;gBAClB,KAAK,EAAE,qBAAqB;gBAC5B,WAAW,EACT,qGAAqG;gBACvG,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE,+EAA+E;aACzF;SACF;QACD,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE;YAI9B,MAAM,GAAG,GAAG,GAAG,qBAAa,GAAG,sBAAc,CAAC,QAAQ,EAAE,CAAA;YACxD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAA;QACrB,CAAC;KACF;IACD,OAAO,EAAE;QACP,UAAU,EAAV,oBAAU;QACV,aAAa,EAAb,uBAAa;KACd;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { SegmentEvent } from '@segment/actions-core';
|
|
2
|
+
import * as types from '../utils/types';
|
|
3
|
+
interface revUserCreateBody {
|
|
4
|
+
email: string;
|
|
5
|
+
full_name: string;
|
|
6
|
+
org_id: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const accountId = "test-account-id";
|
|
9
|
+
export declare const accountName = "test-account-name";
|
|
10
|
+
export declare const newerCreateDate = "2023-06-02T09:17:21.681Z";
|
|
11
|
+
export declare const olderCreateDate = "2023-04-05T20:14:54.646Z";
|
|
12
|
+
export declare const email = "test-user@test.com";
|
|
13
|
+
export declare const domain: string;
|
|
14
|
+
export declare const testUserId = "test-user-id";
|
|
15
|
+
export declare const testUserFullName = "test-user-full-name";
|
|
16
|
+
export declare const testDescription = "test-description";
|
|
17
|
+
export declare const testEventName = "test-event-name";
|
|
18
|
+
export declare const testEventPayload: Partial<SegmentEvent>;
|
|
19
|
+
export declare const event: SegmentEvent;
|
|
20
|
+
export declare const partId = "test-part-id";
|
|
21
|
+
export declare const assignTo = "test-devuser-id";
|
|
22
|
+
export declare const testDisplayName = "test-user";
|
|
23
|
+
export declare const testTag: {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
};
|
|
27
|
+
export declare const testAccountDomain: {
|
|
28
|
+
id: string;
|
|
29
|
+
display_name: string;
|
|
30
|
+
domains: string[];
|
|
31
|
+
state: string;
|
|
32
|
+
};
|
|
33
|
+
export declare const testRevOrgDefaultNewer: {
|
|
34
|
+
id: string;
|
|
35
|
+
account: {
|
|
36
|
+
id: string;
|
|
37
|
+
display_name: string;
|
|
38
|
+
domains: string[];
|
|
39
|
+
state: string;
|
|
40
|
+
};
|
|
41
|
+
created_date: string;
|
|
42
|
+
display_name: string;
|
|
43
|
+
external_ref_issuer: string;
|
|
44
|
+
state: string;
|
|
45
|
+
};
|
|
46
|
+
export declare const testRevOrgNotDefaultOlder: {
|
|
47
|
+
id: string;
|
|
48
|
+
account: {
|
|
49
|
+
id: string;
|
|
50
|
+
display_name: string;
|
|
51
|
+
domains: string[];
|
|
52
|
+
state: string;
|
|
53
|
+
};
|
|
54
|
+
created_date: string;
|
|
55
|
+
display_name: string;
|
|
56
|
+
external_ref_issuer: string;
|
|
57
|
+
state: string;
|
|
58
|
+
};
|
|
59
|
+
export declare const testRevUserNewer: {
|
|
60
|
+
id: string;
|
|
61
|
+
created_date: string;
|
|
62
|
+
display_name: string;
|
|
63
|
+
email: string;
|
|
64
|
+
rev_org: {
|
|
65
|
+
id: string;
|
|
66
|
+
account: {
|
|
67
|
+
id: string;
|
|
68
|
+
display_name: string;
|
|
69
|
+
domains: string[];
|
|
70
|
+
state: string;
|
|
71
|
+
};
|
|
72
|
+
created_date: string;
|
|
73
|
+
display_name: string;
|
|
74
|
+
external_ref_issuer: string;
|
|
75
|
+
state: string;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export declare const testRevUserOlder: {
|
|
79
|
+
id: string;
|
|
80
|
+
display_name: string;
|
|
81
|
+
email: string;
|
|
82
|
+
rev_org: {
|
|
83
|
+
id: string;
|
|
84
|
+
account: {
|
|
85
|
+
id: string;
|
|
86
|
+
display_name: string;
|
|
87
|
+
domains: string[];
|
|
88
|
+
state: string;
|
|
89
|
+
};
|
|
90
|
+
created_date: string;
|
|
91
|
+
display_name: string;
|
|
92
|
+
external_ref_issuer: string;
|
|
93
|
+
state: string;
|
|
94
|
+
};
|
|
95
|
+
created_date: string;
|
|
96
|
+
};
|
|
97
|
+
export declare const tagsResponse: types.TagsResponse;
|
|
98
|
+
export declare const accountsListResponse: types.AccountListResponse;
|
|
99
|
+
export declare const revorgsListResponse: types.RevOrgListResponse;
|
|
100
|
+
export declare const revUsersListResponse: types.RevUserListResponse;
|
|
101
|
+
export declare const revUsersCreateResponse: (_: never, body: revUserCreateBody) => Promise<{
|
|
102
|
+
rev_user: {
|
|
103
|
+
id: string;
|
|
104
|
+
created_date: string;
|
|
105
|
+
display_name: string;
|
|
106
|
+
email: string;
|
|
107
|
+
rev_org: {
|
|
108
|
+
id: string;
|
|
109
|
+
display_name: string;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
}>;
|
|
113
|
+
export declare const accountCreateResponse: (_: never, body: types.CreateAccountBody) => Promise<{
|
|
114
|
+
account: {
|
|
115
|
+
id: string;
|
|
116
|
+
created_date: string;
|
|
117
|
+
display_name: string;
|
|
118
|
+
domains: string[] | undefined;
|
|
119
|
+
tags: {
|
|
120
|
+
id: string;
|
|
121
|
+
}[] | undefined;
|
|
122
|
+
state: string;
|
|
123
|
+
external_refs: string[];
|
|
124
|
+
};
|
|
125
|
+
}>;
|
|
126
|
+
export declare const timelineEntriesCreateResponse: {
|
|
127
|
+
data: {
|
|
128
|
+
timeline_entry: {
|
|
129
|
+
id: string;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
export declare const devUserSelfResponse: {
|
|
134
|
+
data: {
|
|
135
|
+
dev_user: {
|
|
136
|
+
id: string;
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
export declare const settings: {
|
|
141
|
+
apiKey: string;
|
|
142
|
+
blacklistedDomains: string;
|
|
143
|
+
};
|
|
144
|
+
export {};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.settings = exports.devUserSelfResponse = exports.timelineEntriesCreateResponse = exports.accountCreateResponse = exports.revUsersCreateResponse = exports.revUsersListResponse = exports.revorgsListResponse = exports.accountsListResponse = exports.tagsResponse = exports.testRevUserOlder = exports.testRevUserNewer = exports.testRevOrgNotDefaultOlder = exports.testRevOrgDefaultNewer = exports.testAccountDomain = exports.testTag = exports.testDisplayName = exports.assignTo = exports.partId = exports.event = exports.testEventPayload = exports.testEventName = exports.testDescription = exports.testUserFullName = exports.testUserId = exports.domain = exports.email = exports.olderCreateDate = exports.newerCreateDate = exports.accountName = exports.accountId = void 0;
|
|
4
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
5
|
+
exports.accountId = 'test-account-id';
|
|
6
|
+
exports.accountName = 'test-account-name';
|
|
7
|
+
exports.newerCreateDate = '2023-06-02T09:17:21.681Z';
|
|
8
|
+
exports.olderCreateDate = '2023-04-05T20:14:54.646Z';
|
|
9
|
+
exports.email = 'test-user@test.com';
|
|
10
|
+
exports.domain = exports.email.split('@')[1];
|
|
11
|
+
exports.testUserId = 'test-user-id';
|
|
12
|
+
exports.testUserFullName = 'test-user-full-name';
|
|
13
|
+
exports.testDescription = 'test-description';
|
|
14
|
+
exports.testEventName = 'test-event-name';
|
|
15
|
+
exports.testEventPayload = {
|
|
16
|
+
type: 'track',
|
|
17
|
+
userId: exports.testUserId,
|
|
18
|
+
event: exports.testEventName,
|
|
19
|
+
timestamp: exports.newerCreateDate,
|
|
20
|
+
properties: {
|
|
21
|
+
description: exports.testDescription,
|
|
22
|
+
email: exports.email,
|
|
23
|
+
name: exports.testUserFullName
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
exports.event = actions_core_1.createTestEvent(exports.testEventPayload);
|
|
27
|
+
exports.partId = 'test-part-id';
|
|
28
|
+
exports.assignTo = 'test-devuser-id';
|
|
29
|
+
exports.testDisplayName = 'test-user';
|
|
30
|
+
exports.testTag = {
|
|
31
|
+
id: 'test-tag-id',
|
|
32
|
+
name: 'test-tag-name'
|
|
33
|
+
};
|
|
34
|
+
exports.testAccountDomain = {
|
|
35
|
+
id: exports.accountId,
|
|
36
|
+
display_name: exports.accountName,
|
|
37
|
+
domains: [exports.domain],
|
|
38
|
+
state: 'active'
|
|
39
|
+
};
|
|
40
|
+
exports.testRevOrgDefaultNewer = {
|
|
41
|
+
"id": "newer-but-default-revo",
|
|
42
|
+
"account": exports.testAccountDomain,
|
|
43
|
+
"created_date": exports.newerCreateDate,
|
|
44
|
+
"display_name": "newer but default revo",
|
|
45
|
+
"external_ref_issuer": "devrev:platform:revorg:account",
|
|
46
|
+
"state": "active",
|
|
47
|
+
};
|
|
48
|
+
exports.testRevOrgNotDefaultOlder = {
|
|
49
|
+
"id": "older-but-not-default-revo",
|
|
50
|
+
"account": exports.testAccountDomain,
|
|
51
|
+
"created_date": exports.olderCreateDate,
|
|
52
|
+
"display_name": "older but not default revo",
|
|
53
|
+
"external_ref_issuer": "devrev:platform",
|
|
54
|
+
"state": "active",
|
|
55
|
+
};
|
|
56
|
+
exports.testRevUserNewer = {
|
|
57
|
+
id: 'rev-user-newer',
|
|
58
|
+
created_date: exports.newerCreateDate,
|
|
59
|
+
display_name: exports.testUserFullName,
|
|
60
|
+
email: exports.email,
|
|
61
|
+
rev_org: exports.testRevOrgDefaultNewer
|
|
62
|
+
};
|
|
63
|
+
exports.testRevUserOlder = {
|
|
64
|
+
id: 'rev-user-older',
|
|
65
|
+
display_name: exports.testUserFullName,
|
|
66
|
+
email: exports.email,
|
|
67
|
+
rev_org: exports.testRevOrgNotDefaultOlder,
|
|
68
|
+
created_date: exports.olderCreateDate
|
|
69
|
+
};
|
|
70
|
+
exports.tagsResponse = {
|
|
71
|
+
data: {
|
|
72
|
+
next_cursor: '',
|
|
73
|
+
tags: [exports.testTag]
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
exports.accountsListResponse = {
|
|
77
|
+
data: {
|
|
78
|
+
next_cursor: '',
|
|
79
|
+
accounts: [exports.testAccountDomain]
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
exports.revorgsListResponse = {
|
|
83
|
+
data: {
|
|
84
|
+
rev_orgs: [
|
|
85
|
+
exports.testRevOrgDefaultNewer,
|
|
86
|
+
exports.testRevOrgNotDefaultOlder,
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
exports.revUsersListResponse = {
|
|
91
|
+
data: {
|
|
92
|
+
rev_users: [
|
|
93
|
+
exports.testRevUserNewer,
|
|
94
|
+
exports.testRevUserOlder
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
const revUsersCreateResponse = async (_, body) => {
|
|
99
|
+
return {
|
|
100
|
+
rev_user: {
|
|
101
|
+
id: exports.testRevUserNewer.id,
|
|
102
|
+
created_date: exports.newerCreateDate,
|
|
103
|
+
display_name: body.full_name,
|
|
104
|
+
email: body.email,
|
|
105
|
+
rev_org: {
|
|
106
|
+
id: body.org_id,
|
|
107
|
+
display_name: 'test-org'
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
exports.revUsersCreateResponse = revUsersCreateResponse;
|
|
113
|
+
const accountCreateResponse = async (_, body) => {
|
|
114
|
+
return {
|
|
115
|
+
account: {
|
|
116
|
+
id: exports.accountId,
|
|
117
|
+
created_date: exports.newerCreateDate,
|
|
118
|
+
display_name: body.display_name,
|
|
119
|
+
domains: body.domains,
|
|
120
|
+
tags: body.tags,
|
|
121
|
+
state: 'active',
|
|
122
|
+
external_refs: body.external_refs
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
exports.accountCreateResponse = accountCreateResponse;
|
|
127
|
+
exports.timelineEntriesCreateResponse = {
|
|
128
|
+
data: {
|
|
129
|
+
timeline_entry: {
|
|
130
|
+
id: 'test-timeline-entry-id',
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
exports.devUserSelfResponse = {
|
|
135
|
+
data: {
|
|
136
|
+
dev_user: {
|
|
137
|
+
id: 'test-dev-user-id'
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
exports.settings = {
|
|
142
|
+
apiKey: 'blank',
|
|
143
|
+
blacklistedDomains: '',
|
|
144
|
+
};
|
|
145
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/devrev/mocks/index.ts"],"names":[],"mappings":";;;AAAA,wDAAqE;AASxD,QAAA,SAAS,GAAG,iBAAiB,CAAA;AAC7B,QAAA,WAAW,GAAG,mBAAmB,CAAA;AAEjC,QAAA,eAAe,GAAG,0BAA0B,CAAA;AAC5C,QAAA,eAAe,GAAG,0BAA0B,CAAA;AAC5C,QAAA,KAAK,GAAG,oBAAoB,CAAA;AAE5B,QAAA,MAAM,GAAG,aAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;AAE5B,QAAA,UAAU,GAAG,cAAc,CAAA;AAC3B,QAAA,gBAAgB,GAAG,qBAAqB,CAAA;AACxC,QAAA,eAAe,GAAG,kBAAkB,CAAA;AACpC,QAAA,aAAa,GAAG,iBAAiB,CAAA;AAEjC,QAAA,gBAAgB,GAA0B;IACrD,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,kBAAU;IAClB,KAAK,EAAE,qBAAa;IACpB,SAAS,EAAE,uBAAe;IAC1B,UAAU,EAAE;QACV,WAAW,EAAE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YjC;AAEY,QAAA,6BAA6B,GAAG;IAC3C,IAAI,EAAE;QACJ,cAAc,EAAE;YACd,EAAE,EAAE,wBAAwB;SAC7B;KACF;CACF,CAAA;AAGY,QAAA,mBAAmB,GAAG;IACjC,IAAI,EAAE;QACJ,QAAQ,EAAE;YACR,EAAE,EAAE,kBAAkB;SACvB;KACF;CACF,CAAA;AAEY,QAAA,QAAQ,GAAG;IACtB,MAAM,EAAE,OAAO;IACf,kBAAkB,EAAE,EAAE;CACvB,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const devrevApiPaths: {
|
|
2
|
+
authTest: string;
|
|
3
|
+
devUserSelf: string;
|
|
4
|
+
devUsersList: string;
|
|
5
|
+
revUsersList: string;
|
|
6
|
+
revOrgsList: string;
|
|
7
|
+
partsList: string;
|
|
8
|
+
tagsList: string;
|
|
9
|
+
accountsList: string;
|
|
10
|
+
worksCreate: string;
|
|
11
|
+
accountCreate: string;
|
|
12
|
+
revUsersCreate: string;
|
|
13
|
+
timelineEntriesCreate: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const devrevApiRoot = "https://api.devrev.ai";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.devrevApiRoot = exports.devrevApiPaths = void 0;
|
|
4
|
+
exports.devrevApiPaths = {
|
|
5
|
+
authTest: '/dev-users.self',
|
|
6
|
+
devUserSelf: '/dev-users.self',
|
|
7
|
+
devUsersList: '/dev-users.list',
|
|
8
|
+
revUsersList: '/internal/rev-users.list',
|
|
9
|
+
revOrgsList: '/internal/rev-orgs.list',
|
|
10
|
+
partsList: '/parts.list',
|
|
11
|
+
tagsList: '/tags.list',
|
|
12
|
+
accountsList: '/internal/accounts.list',
|
|
13
|
+
worksCreate: '/internal/works.create',
|
|
14
|
+
accountCreate: '/internal/accounts.create',
|
|
15
|
+
revUsersCreate: '/internal/rev-users.create',
|
|
16
|
+
timelineEntriesCreate: '/timeline-entries.create'
|
|
17
|
+
};
|
|
18
|
+
exports.devrevApiRoot = 'https://api.devrev.ai';
|
|
19
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/destinations/devrev/utils/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG;IAC5B,QAAQ,EAAE,iBAAiB;IAC3B,WAAW,EAAE,iBAAiB;IAE9B,YAAY,EAAE,iBAAiB;IAC/B,YAAY,EAAE,0BAA0B;IACxC,WAAW,EAAE,yBAAyB;IACtC,SAAS,EAAE,aAAa;IACxB,QAAQ,EAAE,YAAY;IACtB,YAAY,EAAE,yBAAyB;IAEvC,WAAW,EAAE,wBAAwB;IACrC,aAAa,EAAE,2BAA2B;IAC1C,cAAc,EAAE,4BAA4B;IAC5C,qBAAqB,EAAE,0BAA0B;CAClD,CAAA;AAEY,QAAA,aAAa,GAAG,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Settings } from '../generated-types';
|
|
2
|
+
export declare const parseJwt: (token: string) => any;
|
|
3
|
+
export declare const getDevOrgId: (settings: Settings) => any;
|
|
4
|
+
export declare const getDevUserId: (settings: Settings) => string;
|
|
5
|
+
export declare const isBlacklisted: (settings: Settings, domain: string) => boolean;
|
|
6
|
+
export declare const getDomain: (settings: Settings, email: string) => string;
|
|
7
|
+
export declare const isOlderThen: (firstDate: string, secondDate: string) => boolean;
|
|
8
|
+
interface getNameInterface {
|
|
9
|
+
firstName?: string;
|
|
10
|
+
lastName?: string;
|
|
11
|
+
fullName?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const getName: (payload: getNameInterface) => string;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getName = exports.isOlderThen = exports.getDomain = exports.isBlacklisted = exports.getDevUserId = exports.getDevOrgId = exports.parseJwt = void 0;
|
|
4
|
+
const parseJwt = (token) => {
|
|
5
|
+
return JSON.parse(Buffer.from(token.split('.')[1], 'base64').toString());
|
|
6
|
+
};
|
|
7
|
+
exports.parseJwt = parseJwt;
|
|
8
|
+
const getDevOrgId = (settings) => {
|
|
9
|
+
const { apiKey } = settings;
|
|
10
|
+
const parsed = exports.parseJwt(apiKey);
|
|
11
|
+
const orgId = parsed['http://devrev.ai/devo_don'];
|
|
12
|
+
return orgId;
|
|
13
|
+
};
|
|
14
|
+
exports.getDevOrgId = getDevOrgId;
|
|
15
|
+
const getDevUserId = (settings) => {
|
|
16
|
+
const { apiKey } = settings;
|
|
17
|
+
const parsed = exports.parseJwt(apiKey);
|
|
18
|
+
const orgId = parsed['http://devrev.ai/devo_don'];
|
|
19
|
+
const userId = `${orgId}:devu/${parsed['']}`;
|
|
20
|
+
return userId;
|
|
21
|
+
};
|
|
22
|
+
exports.getDevUserId = getDevUserId;
|
|
23
|
+
const isBlacklisted = (settings, domain) => {
|
|
24
|
+
const blacklistedDomains = settings.blacklistedDomains?.split(',');
|
|
25
|
+
if (!blacklistedDomains)
|
|
26
|
+
return false;
|
|
27
|
+
return blacklistedDomains.includes(domain);
|
|
28
|
+
};
|
|
29
|
+
exports.isBlacklisted = isBlacklisted;
|
|
30
|
+
const getDomain = (settings, email) => {
|
|
31
|
+
const domain = email.split('@')[1];
|
|
32
|
+
if (exports.isBlacklisted(settings, domain))
|
|
33
|
+
return email;
|
|
34
|
+
return domain;
|
|
35
|
+
};
|
|
36
|
+
exports.getDomain = getDomain;
|
|
37
|
+
const isOlderThen = (firstDate, secondDate) => {
|
|
38
|
+
const first = new Date(firstDate);
|
|
39
|
+
const second = new Date(secondDate);
|
|
40
|
+
return first < second;
|
|
41
|
+
};
|
|
42
|
+
exports.isOlderThen = isOlderThen;
|
|
43
|
+
const getName = (payload) => {
|
|
44
|
+
const { firstName, lastName, fullName } = payload;
|
|
45
|
+
if (fullName)
|
|
46
|
+
return fullName;
|
|
47
|
+
if (firstName && lastName)
|
|
48
|
+
return `${firstName} ${lastName}`;
|
|
49
|
+
if (firstName)
|
|
50
|
+
return firstName;
|
|
51
|
+
if (lastName)
|
|
52
|
+
return lastName;
|
|
53
|
+
return '';
|
|
54
|
+
};
|
|
55
|
+
exports.getName = getName;
|
|
56
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../src/destinations/devrev/utils/helpers.ts"],"names":[],"mappings":";;;AAEO,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAE,EAAE;IACxC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAA;AAC1E,CAAC,CAAA;AAFY,QAAA,QAAQ,YAEpB;AAEM,MAAM,WAAW,GAAG,CAAC,QAAkB,EAAE,EAAE;IAChD,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAA;IAC3B,MAAM,MAAM,GAAG,gBAAQ,CAAC,MAAM,CAAC,CAAA;IAC/B,MAAM,KAAK,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAA;IACjD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AALY,QAAA,WAAW,eAKvB;AAEM,MAAM,YAAY,GAAG,CAAC,QAAkB,EAAE,EAAE;IACjD,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAA;IAC3B,MAAM,MAAM,GAAG,gBAAQ,CAAC,MAAM,CAAC,CAAA;IAC/B,MAAM,KAAK,GAAG,MAAM,CAAC,2BAA2B,CAAC,CAAA;IACjD,MAAM,MAAM,GAAG,GAAG,KAAK,SAAS,MAAM,CAAC,EAAE,CAAC,EAAE,CAAA;IAC5C,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AO,QAAQ,CAAA;IAC7B,OAAO,EAAE,CAAA;AACX,CAAC,CAAA;AAPY,QAAA,OAAO,WAOnB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./constants"), exports);
|
|
14
|
+
__exportStar(require("./types"), exports);
|
|
15
|
+
__exportStar(require("./helpers"), exports);
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/devrev/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAA2B;AAC3B,0CAAuB;AACvB,4CAAyB"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
export interface IdFragment {
|
|
2
|
+
id: string;
|
|
3
|
+
display_name: string;
|
|
4
|
+
}
|
|
5
|
+
export interface Tag {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
}
|
|
9
|
+
export interface Part {
|
|
10
|
+
type: string;
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
}
|
|
14
|
+
export interface PartListResponse {
|
|
15
|
+
data: {
|
|
16
|
+
next_cursor: string;
|
|
17
|
+
parts: Part[];
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface TagsResponse {
|
|
21
|
+
data: {
|
|
22
|
+
next_cursor: string;
|
|
23
|
+
tags: Tag[];
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export interface Account extends IdFragment {
|
|
27
|
+
domains?: string[];
|
|
28
|
+
schema_fragment_ids?: string[];
|
|
29
|
+
state?: string;
|
|
30
|
+
created_date?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface RevOrg extends IdFragment {
|
|
33
|
+
id: string;
|
|
34
|
+
account: IdFragment;
|
|
35
|
+
display_name: string;
|
|
36
|
+
state: string;
|
|
37
|
+
created_date: string;
|
|
38
|
+
external_ref_issuer?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface RevUser extends IdFragment {
|
|
41
|
+
created_date: string;
|
|
42
|
+
rev_org: IdFragment;
|
|
43
|
+
email: string;
|
|
44
|
+
}
|
|
45
|
+
export interface DevUser extends IdFragment {
|
|
46
|
+
full_name: string;
|
|
47
|
+
email: string;
|
|
48
|
+
id: string;
|
|
49
|
+
}
|
|
50
|
+
export interface DevUserListResponse {
|
|
51
|
+
data: {
|
|
52
|
+
next_cursor?: string;
|
|
53
|
+
dev_users: DevUser[];
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export interface RevUserListResponse {
|
|
57
|
+
data: {
|
|
58
|
+
next_cursor?: string;
|
|
59
|
+
rev_users: RevUser[];
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
export interface RevOrgListResponse {
|
|
63
|
+
data: {
|
|
64
|
+
next_cursor?: string;
|
|
65
|
+
rev_orgs: RevOrg[];
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export interface AccountListResponse {
|
|
69
|
+
data: {
|
|
70
|
+
next_cursor?: string;
|
|
71
|
+
accounts: Account[];
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export interface RevUserGet {
|
|
75
|
+
data: {
|
|
76
|
+
rev_user: RevUser;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export interface RevOrgGet {
|
|
80
|
+
data: {
|
|
81
|
+
rev_org: RevOrg;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export interface AccountGet {
|
|
85
|
+
data: {
|
|
86
|
+
account: Account;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
export interface Comment {
|
|
90
|
+
id: string;
|
|
91
|
+
body: string;
|
|
92
|
+
}
|
|
93
|
+
export interface TimelineResponse {
|
|
94
|
+
data: {
|
|
95
|
+
timeline_entry: Comment;
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
export interface CreateAccountBody {
|
|
99
|
+
display_name: string;
|
|
100
|
+
domains?: string[];
|
|
101
|
+
tags?: {
|
|
102
|
+
id: string;
|
|
103
|
+
}[];
|
|
104
|
+
external_refs: string[];
|
|
105
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/destinations/devrev/utils/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RequestClient } from '@segment/actions-core';
|
|
2
|
+
import { SearchResponse, UpsertRecordResponse } from '../utils';
|
|
3
|
+
export declare class Hubspot {
|
|
4
|
+
request: RequestClient;
|
|
5
|
+
objectType: string;
|
|
6
|
+
constructor(request: RequestClient, objectType: string);
|
|
7
|
+
search(searchFields: {
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}, responseProperties: string[], responseSortBy: string[]): Promise<import("@segment/actions-core").ModifiedResponse<SearchResponse>>;
|
|
10
|
+
create(properties: {
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
}): Promise<import("@segment/actions-core").ModifiedResponse<UpsertRecordResponse>>;
|
|
13
|
+
update(uniqueIdentifier: string, properties: {
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
}, idProperty?: string): Promise<import("@segment/actions-core").ModifiedResponse<UpsertRecordResponse>>;
|
|
16
|
+
}
|