@segment/action-destinations 3.130.1-sf-regex-instanceURL.10 → 3.131.1-ga4-cloud.12
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/google-analytics-4/addPaymentInfo/generated-types.d.ts +3 -1
- package/dist/destinations/google-analytics-4/addPaymentInfo/index.js +10 -3
- package/dist/destinations/google-analytics-4/addPaymentInfo/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/addToCart/generated-types.d.ts +3 -1
- package/dist/destinations/google-analytics-4/addToCart/index.js +10 -3
- package/dist/destinations/google-analytics-4/addToCart/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/addToWishlist/generated-types.d.ts +3 -1
- package/dist/destinations/google-analytics-4/addToWishlist/index.js +10 -3
- package/dist/destinations/google-analytics-4/addToWishlist/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/beginCheckout/generated-types.d.ts +3 -1
- package/dist/destinations/google-analytics-4/beginCheckout/index.js +10 -3
- package/dist/destinations/google-analytics-4/beginCheckout/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/customEvent/generated-types.d.ts +3 -1
- package/dist/destinations/google-analytics-4/customEvent/index.js +10 -3
- package/dist/destinations/google-analytics-4/customEvent/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/ga4-functions.d.ts +3 -0
- package/dist/destinations/google-analytics-4/ga4-functions.js +31 -1
- package/dist/destinations/google-analytics-4/ga4-functions.js.map +1 -1
- package/dist/destinations/google-analytics-4/ga4-properties.d.ts +2 -0
- package/dist/destinations/google-analytics-4/ga4-properties.js +17 -3
- package/dist/destinations/google-analytics-4/ga4-properties.js.map +1 -1
- package/dist/destinations/google-analytics-4/ga4-types.d.ts +14 -0
- package/dist/destinations/google-analytics-4/ga4-types.js +6 -0
- package/dist/destinations/google-analytics-4/ga4-types.js.map +1 -1
- package/dist/destinations/google-analytics-4/generateLead/generated-types.d.ts +3 -1
- package/dist/destinations/google-analytics-4/generateLead/index.js +10 -3
- package/dist/destinations/google-analytics-4/generateLead/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/generated-types.d.ts +2 -1
- package/dist/destinations/google-analytics-4/index.js +15 -10
- package/dist/destinations/google-analytics-4/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/login/generated-types.d.ts +3 -1
- package/dist/destinations/google-analytics-4/login/index.js +10 -3
- package/dist/destinations/google-analytics-4/login/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/pageView/generated-types.d.ts +3 -1
- package/dist/destinations/google-analytics-4/pageView/index.js +10 -3
- package/dist/destinations/google-analytics-4/pageView/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/purchase/generated-types.d.ts +3 -1
- package/dist/destinations/google-analytics-4/purchase/index.js +10 -3
- package/dist/destinations/google-analytics-4/purchase/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/refund/generated-types.d.ts +3 -1
- package/dist/destinations/google-analytics-4/refund/index.js +10 -3
- package/dist/destinations/google-analytics-4/refund/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/removeFromCart/generated-types.d.ts +3 -1
- package/dist/destinations/google-analytics-4/removeFromCart/index.js +10 -3
- package/dist/destinations/google-analytics-4/removeFromCart/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/search/generated-types.d.ts +3 -1
- package/dist/destinations/google-analytics-4/search/index.js +10 -3
- package/dist/destinations/google-analytics-4/search/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/selectItem/generated-types.d.ts +3 -1
- package/dist/destinations/google-analytics-4/selectItem/index.js +10 -3
- package/dist/destinations/google-analytics-4/selectItem/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/selectPromotion/generated-types.d.ts +3 -1
- package/dist/destinations/google-analytics-4/selectPromotion/index.js +10 -3
- package/dist/destinations/google-analytics-4/selectPromotion/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/signUp/generated-types.d.ts +3 -1
- package/dist/destinations/google-analytics-4/signUp/index.js +10 -3
- package/dist/destinations/google-analytics-4/signUp/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewCart/generated-types.d.ts +3 -1
- package/dist/destinations/google-analytics-4/viewCart/index.js +10 -3
- package/dist/destinations/google-analytics-4/viewCart/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewItem/generated-types.d.ts +3 -1
- package/dist/destinations/google-analytics-4/viewItem/index.js +10 -3
- package/dist/destinations/google-analytics-4/viewItem/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewItemList/generated-types.d.ts +3 -1
- package/dist/destinations/google-analytics-4/viewItemList/index.js +10 -3
- package/dist/destinations/google-analytics-4/viewItemList/index.js.map +1 -1
- package/dist/destinations/google-analytics-4/viewPromotion/generated-types.d.ts +3 -1
- package/dist/destinations/google-analytics-4/viewPromotion/index.js +10 -3
- package/dist/destinations/google-analytics-4/viewPromotion/index.js.map +1 -1
- package/dist/destinations/ironclad/RecordAction/generated-types.d.ts +1 -1
- package/dist/destinations/ironclad/RecordAction/index.js +3 -4
- package/dist/destinations/ironclad/RecordAction/index.js.map +1 -1
- package/dist/destinations/ironclad/generated-types.d.ts +2 -2
- package/dist/destinations/ironclad/index.js +0 -3
- package/dist/destinations/ironclad/index.js.map +1 -1
- package/dist/destinations/qualtrics/addContactToXmd/index.js +7 -5
- package/dist/destinations/qualtrics/addContactToXmd/index.js.map +1 -1
- package/dist/destinations/qualtrics/dynamicFields.d.ts +5 -0
- package/dist/destinations/qualtrics/dynamicFields.js +39 -0
- package/dist/destinations/qualtrics/dynamicFields.js.map +1 -0
- package/dist/destinations/qualtrics/index.js +7 -3
- package/dist/destinations/qualtrics/index.js.map +1 -1
- package/dist/destinations/qualtrics/qualtricsApiClient.d.ts +41 -2
- package/dist/destinations/qualtrics/qualtricsApiClient.js +47 -4
- package/dist/destinations/qualtrics/qualtricsApiClient.js.map +1 -1
- package/dist/destinations/qualtrics/triggerXflowWorkflow/index.js +2 -2
- package/dist/destinations/qualtrics/triggerXflowWorkflow/index.js.map +1 -1
- package/dist/destinations/qualtrics/upsertContactTransaction/generated-types.d.ts +19 -0
- package/dist/destinations/qualtrics/upsertContactTransaction/generated-types.js +3 -0
- package/dist/destinations/qualtrics/upsertContactTransaction/generated-types.js.map +1 -0
- package/dist/destinations/qualtrics/upsertContactTransaction/index.d.ts +5 -0
- package/dist/destinations/qualtrics/upsertContactTransaction/index.js +186 -0
- package/dist/destinations/qualtrics/upsertContactTransaction/index.js.map +1 -0
- package/dist/destinations/qualtrics/utils.d.ts +5 -0
- package/dist/destinations/qualtrics/utils.js +57 -0
- package/dist/destinations/qualtrics/utils.js.map +1 -0
- package/dist/destinations/salesforce/sf-utils.js +1 -1
- package/dist/destinations/salesforce/sf-utils.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/selectPromotion/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/selectPromotion/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAOyB;AACzB,sDAgB0B;AAC1B,4CAAqF;AAIrF,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,4CAA4C;IACzD,mBAAmB,EAAE,gDAAgD;IACrE,MAAM,EAAE;QACN,gBAAgB,EAAE,EAAE,GAAG,iCAAgB,EAAE;QACzC,eAAe,EAAE,EAAE,GAAG,gCAAe,EAAE;QACvC,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,gBAAgB,EAAE,EAAE,GAAG,iCAAgB,EAAE;QACzC,aAAa,EAAE,EAAE,GAAG,8BAAa,EAAE;QACnC,aAAa,EAAE,EAAE,GAAG,8BAAa,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,uBAAuB,EAAE,E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,EAAE,EAAE;YAC3F,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc;SACrB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const ga4_functions_1 = require("../ga4-functions");
|
|
4
4
|
const ga4_properties_1 = require("../ga4-properties");
|
|
5
|
+
const ga4_types_1 = require("../ga4-types");
|
|
5
6
|
const action = {
|
|
6
7
|
title: 'Sign Up',
|
|
7
8
|
description: 'Send event when a user signs up to measure the popularity of each sign-up method',
|
|
8
9
|
defaultSubscription: 'type = "track" and event = "Signed Up"',
|
|
9
10
|
fields: {
|
|
11
|
+
data_stream_type: { ...ga4_properties_1.data_stream_type },
|
|
12
|
+
app_instance_id: { ...ga4_properties_1.app_instance_id },
|
|
10
13
|
client_id: { ...ga4_properties_1.client_id },
|
|
11
14
|
user_id: { ...ga4_properties_1.user_id },
|
|
12
15
|
timestamp_micros: { ...ga4_properties_1.timestamp_micros },
|
|
@@ -22,13 +25,17 @@ const action = {
|
|
|
22
25
|
engagement_time_msec: ga4_properties_1.engagement_time_msec,
|
|
23
26
|
params: ga4_properties_1.params
|
|
24
27
|
},
|
|
25
|
-
perform: (request, { payload, features }) => {
|
|
28
|
+
perform: (request, { payload, features, settings }) => {
|
|
29
|
+
const data_stream_type = payload.data_stream_type ?? ga4_types_1.DataStreamType.Web;
|
|
30
|
+
const stream_params = data_stream_type === ga4_types_1.DataStreamType.MobileApp
|
|
31
|
+
? ga4_functions_1.getMobileStreamParams(settings.apiSecret, settings.firebaseAppId, payload.app_instance_id)
|
|
32
|
+
: ga4_functions_1.getWebStreamParams(settings.apiSecret, settings.measurementId, payload.client_id);
|
|
26
33
|
if (features && features['actions-google-analytics-4-verify-params-feature']) {
|
|
27
34
|
ga4_functions_1.verifyParams(payload.params);
|
|
28
35
|
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
29
36
|
}
|
|
30
37
|
const request_object = {
|
|
31
|
-
|
|
38
|
+
...stream_params.identifier,
|
|
32
39
|
user_id: payload.user_id,
|
|
33
40
|
events: [
|
|
34
41
|
{
|
|
@@ -45,7 +52,7 @@ const action = {
|
|
|
45
52
|
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
46
53
|
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
47
54
|
}
|
|
48
|
-
return request(
|
|
55
|
+
return request(`https://www.google-analytics.com/mp/collect?${stream_params.search_params}`, {
|
|
49
56
|
method: 'POST',
|
|
50
57
|
json: request_object
|
|
51
58
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/signUp/index.ts"],"names":[],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/signUp/index.ts"],"names":[],"mappings":";;AAGA,oDAMyB;AACzB,sDAU0B;AAC1B,4CAA+D;AAE/D,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,kFAAkF;IAC/F,mBAAmB,EAAE,wCAAwC;IAC7D,MAAM,EAAE;QACN,gBAAgB,EAAE,EAAE,GAAG,iCAAgB,EAAE;QACzC,eAAe,EAAE,EAAE,GAAG,gCAAe,EAAE;QACvC,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,gBAAgB,EAAE,EAAE,GAAG,iCAAgB,EAAE;QACzC,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,8BAA8B;YAC3C,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,mBAAmB;aAC7B;SACF;QACD,eAAe,EAAE,gCAAe;QAChC,oBAAoB,EAAE,qCAAoB;QAC1C,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AAE,cAAc;SACrB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -3,11 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
4
|
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
|
+
const ga4_types_1 = require("../ga4-types");
|
|
6
7
|
const action = {
|
|
7
8
|
title: 'View Cart',
|
|
8
9
|
description: 'Send event when a user views their cart',
|
|
9
10
|
defaultSubscription: 'type = "track" and event = "Cart Viewed"',
|
|
10
11
|
fields: {
|
|
12
|
+
data_stream_type: { ...ga4_properties_1.data_stream_type },
|
|
13
|
+
app_instance_id: { ...ga4_properties_1.app_instance_id },
|
|
11
14
|
client_id: { ...ga4_properties_1.client_id },
|
|
12
15
|
user_id: { ...ga4_properties_1.user_id },
|
|
13
16
|
timestamp_micros: { ...ga4_properties_1.timestamp_micros },
|
|
@@ -21,7 +24,11 @@ const action = {
|
|
|
21
24
|
engagement_time_msec: ga4_properties_1.engagement_time_msec,
|
|
22
25
|
params: ga4_properties_1.params
|
|
23
26
|
},
|
|
24
|
-
perform: (request, { payload, features }) => {
|
|
27
|
+
perform: (request, { payload, features, settings }) => {
|
|
28
|
+
const data_stream_type = payload.data_stream_type ?? ga4_types_1.DataStreamType.Web;
|
|
29
|
+
const stream_params = data_stream_type === ga4_types_1.DataStreamType.MobileApp
|
|
30
|
+
? ga4_functions_1.getMobileStreamParams(settings.apiSecret, settings.firebaseAppId, payload.app_instance_id)
|
|
31
|
+
: ga4_functions_1.getWebStreamParams(settings.apiSecret, settings.measurementId, payload.client_id);
|
|
25
32
|
if (payload.currency) {
|
|
26
33
|
ga4_functions_1.verifyCurrency(payload.currency);
|
|
27
34
|
}
|
|
@@ -48,7 +55,7 @@ const action = {
|
|
|
48
55
|
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
49
56
|
}
|
|
50
57
|
const request_object = {
|
|
51
|
-
|
|
58
|
+
...stream_params.identifier,
|
|
52
59
|
user_id: payload.user_id,
|
|
53
60
|
events: [
|
|
54
61
|
{
|
|
@@ -67,7 +74,7 @@ const action = {
|
|
|
67
74
|
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
68
75
|
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
69
76
|
}
|
|
70
|
-
return request(
|
|
77
|
+
return request(`https://www.google-analytics.com/mp/collect?${stream_params.search_params}`, {
|
|
71
78
|
method: 'POST',
|
|
72
79
|
json: request_object
|
|
73
80
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewCart/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewCart/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAOyB;AACzB,sDAa0B;AAC1B,4CAA4E;AAI5E,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,yCAAyC;IACtD,mBAAmB,EAAE,0CAA0C;IAC/D,MAAM,EAAE;QACN,gBAAgB,EAAE,EAAE,GAAG,iCAAgB,EAAE;QACzC,eAAe,EAAE,EAAE,GAAG,gCAAe,EAAE;QACvC,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,gBAAgB,EAAE,EAAE,GAAG,iCAAgB,EAAE;QACzC,QAAQ,EAAE,EAAE,GAAG,yBAAQ,EAAE;QACzB,KAAK,EAAE,EAAE,GAAG,sBAAK,EAAE;QACnB,KAAK,EAAE;YACL,GAAG,qCAAoB;YACvB,QAAQ,EAAE,IAAI;SACf;QACD,eAAe,EAAE,gCAAe;QAChC,o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esModule", { value: true });
|
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
4
|
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
|
+
const ga4_types_1 = require("../ga4-types");
|
|
6
7
|
const action = {
|
|
7
8
|
title: 'View Item',
|
|
8
9
|
description: 'Send event when a user views an item',
|
|
9
10
|
defaultSubscription: 'type = "track" and event = "Product Viewed"',
|
|
10
11
|
fields: {
|
|
12
|
+
data_stream_type: { ...ga4_properties_1.data_stream_type },
|
|
13
|
+
app_instance_id: { ...ga4_properties_1.app_instance_id },
|
|
11
14
|
client_id: { ...ga4_properties_1.client_id },
|
|
12
15
|
user_id: { ...ga4_properties_1.user_id },
|
|
13
16
|
timestamp_micros: { ...ga4_properties_1.timestamp_micros },
|
|
@@ -21,7 +24,11 @@ const action = {
|
|
|
21
24
|
engagement_time_msec: ga4_properties_1.engagement_time_msec,
|
|
22
25
|
params: ga4_properties_1.params
|
|
23
26
|
},
|
|
24
|
-
perform: (request, { payload, features }) => {
|
|
27
|
+
perform: (request, { payload, features, settings }) => {
|
|
28
|
+
const data_stream_type = payload.data_stream_type ?? ga4_types_1.DataStreamType.Web;
|
|
29
|
+
const stream_params = data_stream_type === ga4_types_1.DataStreamType.MobileApp
|
|
30
|
+
? ga4_functions_1.getMobileStreamParams(settings.apiSecret, settings.firebaseAppId, payload.app_instance_id)
|
|
31
|
+
: ga4_functions_1.getWebStreamParams(settings.apiSecret, settings.measurementId, payload.client_id);
|
|
25
32
|
if (payload.currency) {
|
|
26
33
|
ga4_functions_1.verifyCurrency(payload.currency);
|
|
27
34
|
}
|
|
@@ -42,7 +49,7 @@ const action = {
|
|
|
42
49
|
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
43
50
|
}
|
|
44
51
|
const request_object = {
|
|
45
|
-
|
|
52
|
+
...stream_params.identifier,
|
|
46
53
|
user_id: payload.user_id,
|
|
47
54
|
events: [
|
|
48
55
|
{
|
|
@@ -61,7 +68,7 @@ const action = {
|
|
|
61
68
|
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
62
69
|
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
63
70
|
}
|
|
64
|
-
return request(
|
|
71
|
+
return request(`https://www.google-analytics.com/mp/collect?${stream_params.search_params}`, {
|
|
65
72
|
method: 'POST',
|
|
66
73
|
json: request_object
|
|
67
74
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewItem/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewItem/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAOyB;AACzB,sDAa0B;AAC1B,4CAA4E;AAI5E,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,sCAAsC;IACnD,mBAAmB,EAAE,8CAA8C;IACnE,MAAM,EAAE;QACN,gBAAgB,EAAE,EAAE,GAAG,iCAAgB,EAAE;QACzC,eAAe,EAAE,EAAE,GAAG,gCAAe,EAAE;QACvC,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,gBAAgB,EAAE,EAAE,GAAG,iCAAgB,EAAE;QACzC,QAAQ,EAAE,EAAE,GAAG,yBAAQ,EAAE;QACzB,KAAK,EAAE,EAAE,GAAG,sBAAK,EAAE;QACnB,KAAK,EAAE;YACL,GAAG,sCAAqB;YACxB,QAAQ,EAAE,IAAI;SACf;QACD,eAAe,EAAE,gCAAe;QAChC,oBAAoB,EAAE,qCAAoB;QAC1C,MAAM,EAAE,uBAAM;KACf;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ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;oBACE,IAAI,EAAE,WAAW;oBACjB,MAAM,EAAE;wBACN,QAAQ,EAAE,OAAO,CAAC,QAAQ;wBAC1B,KAAK,EAAE,WAAW;wBAClB,KAAK,EAAE,OAAO,CAAC,KAAK;wBACpB,oBAAoB,EAAE,OAAO,CAAC,oBAAoB;wBAClD,GAAG,OAAO,CAAC,MAAM;qBAClB;iBACF;aACF;YACD,GAAG,qCAAoB,CAAC,OAAO,CAAC,eAAe,CAAC;SACjD,CAAA;QAED,IAAI,QAAQ,IAAI,QAAQ,CAAC,0CAA0C,CAAC,EAAE;YACpE,cAAc,CAAC,gBAAgB,GAAG,gCAAgB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;SAC7E;QAGD,OAAO,OAAO,CAAC,+CAA+C,aAAa,CAAC,aAAa,EAAE,EAAE;YAC3F,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc;SACrB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -3,11 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
4
|
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
|
+
const ga4_types_1 = require("../ga4-types");
|
|
6
7
|
const action = {
|
|
7
8
|
title: 'View Item List',
|
|
8
9
|
description: 'Send event when a user views a list of items or offerings',
|
|
9
10
|
defaultSubscription: 'type = "track" and event = "Product List Viewed"',
|
|
10
11
|
fields: {
|
|
12
|
+
data_stream_type: { ...ga4_properties_1.data_stream_type },
|
|
13
|
+
app_instance_id: { ...ga4_properties_1.app_instance_id },
|
|
11
14
|
client_id: { ...ga4_properties_1.client_id },
|
|
12
15
|
user_id: { ...ga4_properties_1.user_id },
|
|
13
16
|
timestamp_micros: { ...ga4_properties_1.timestamp_micros },
|
|
@@ -35,7 +38,11 @@ const action = {
|
|
|
35
38
|
engagement_time_msec: ga4_properties_1.engagement_time_msec,
|
|
36
39
|
params: ga4_properties_1.params
|
|
37
40
|
},
|
|
38
|
-
perform: (request, { payload, features }) => {
|
|
41
|
+
perform: (request, { payload, features, settings }) => {
|
|
42
|
+
const data_stream_type = payload.data_stream_type ?? ga4_types_1.DataStreamType.Web;
|
|
43
|
+
const stream_params = data_stream_type === ga4_types_1.DataStreamType.MobileApp
|
|
44
|
+
? ga4_functions_1.getMobileStreamParams(settings.apiSecret, settings.firebaseAppId, payload.app_instance_id)
|
|
45
|
+
: ga4_functions_1.getWebStreamParams(settings.apiSecret, settings.measurementId, payload.client_id);
|
|
39
46
|
let googleItems = [];
|
|
40
47
|
if (payload.items) {
|
|
41
48
|
googleItems = payload.items.map((product) => {
|
|
@@ -53,7 +60,7 @@ const action = {
|
|
|
53
60
|
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
54
61
|
}
|
|
55
62
|
const request_object = {
|
|
56
|
-
|
|
63
|
+
...stream_params.identifier,
|
|
57
64
|
user_id: payload.user_id,
|
|
58
65
|
events: [
|
|
59
66
|
{
|
|
@@ -72,7 +79,7 @@ const action = {
|
|
|
72
79
|
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
73
80
|
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
74
81
|
}
|
|
75
|
-
return request(
|
|
82
|
+
return request(`https://www.google-analytics.com/mp/collect?${stream_params.search_params}`, {
|
|
76
83
|
method: 'POST',
|
|
77
84
|
json: request_object
|
|
78
85
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewItemList/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewItemList/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAOyB;AACzB,sDAW0B;A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E;QAGD,OAAO,OAAO,CAAC,+CAA+C,aAAa,CAAC,aAAa,EAAE,EAAE;YAC3F,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc;SACrB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -3,11 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
4
|
const ga4_functions_1 = require("../ga4-functions");
|
|
5
5
|
const ga4_properties_1 = require("../ga4-properties");
|
|
6
|
+
const ga4_types_1 = require("../ga4-types");
|
|
6
7
|
const action = {
|
|
7
8
|
title: 'View Promotion',
|
|
8
9
|
description: 'Send event when a promotion is shown to a user',
|
|
9
10
|
defaultSubscription: 'type = "track" and event = "Promotion Viewed"',
|
|
10
11
|
fields: {
|
|
12
|
+
data_stream_type: { ...ga4_properties_1.data_stream_type },
|
|
13
|
+
app_instance_id: { ...ga4_properties_1.app_instance_id },
|
|
11
14
|
client_id: { ...ga4_properties_1.client_id },
|
|
12
15
|
user_id: { ...ga4_properties_1.user_id },
|
|
13
16
|
timestamp_micros: { ...ga4_properties_1.timestamp_micros },
|
|
@@ -46,7 +49,11 @@ const action = {
|
|
|
46
49
|
engagement_time_msec: ga4_properties_1.engagement_time_msec,
|
|
47
50
|
params: ga4_properties_1.params
|
|
48
51
|
},
|
|
49
|
-
perform: (request, { payload, features }) => {
|
|
52
|
+
perform: (request, { payload, features, settings }) => {
|
|
53
|
+
const data_stream_type = payload.data_stream_type ?? ga4_types_1.DataStreamType.Web;
|
|
54
|
+
const stream_params = data_stream_type === ga4_types_1.DataStreamType.MobileApp
|
|
55
|
+
? ga4_functions_1.getMobileStreamParams(settings.apiSecret, settings.firebaseAppId, payload.app_instance_id)
|
|
56
|
+
: ga4_functions_1.getWebStreamParams(settings.apiSecret, settings.measurementId, payload.client_id);
|
|
50
57
|
let googleItems = [];
|
|
51
58
|
if (payload.items) {
|
|
52
59
|
googleItems = payload.items.map((product) => {
|
|
@@ -64,7 +71,7 @@ const action = {
|
|
|
64
71
|
ga4_functions_1.verifyUserProps(payload.user_properties);
|
|
65
72
|
}
|
|
66
73
|
const request_object = {
|
|
67
|
-
|
|
74
|
+
...stream_params.identifier,
|
|
68
75
|
user_id: payload.user_id,
|
|
69
76
|
events: [
|
|
70
77
|
{
|
|
@@ -86,7 +93,7 @@ const action = {
|
|
|
86
93
|
if (features && features['actions-google-analytics-4-add-timestamp']) {
|
|
87
94
|
request_object.timestamp_micros = ga4_functions_1.convertTimestamp(payload.timestamp_micros);
|
|
88
95
|
}
|
|
89
|
-
return request(
|
|
96
|
+
return request(`https://www.google-analytics.com/mp/collect?${stream_params.search_params}`, {
|
|
90
97
|
method: 'POST',
|
|
91
98
|
json: request_object
|
|
92
99
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewPromotion/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-analytics-4/viewPromotion/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAC1E,oDAOyB;AACzB,sDAgB0B;AAC1B,4CAAqF;AAQrF,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,gDAAgD;IAC7D,mBAAmB,EAAE,+CAA+C;IACpE,MAAM,EAAE;QACN,gBAAgB,EAAE,EAAE,GAAG,iCAAgB,EAAE;QACzC,eAAe,EAAE,EAAE,GAAG,gCAAe,EAAE;QACvC,SAAS,EAAE,EAAE,GAAG,0BAAS,EAAE;QAC3B,OAAO,EAAE,EAAE,GAAG,wBAAO,EAAE;QACvB,gBAAgB,EAAE,EAAE,GAAG,iCAAgB,EAAE;QACzC,aAAa,EAAE,EAAE,GAAG,8BAAa,EAAE;QACnC,aAAa,EAAE,EAAE,GAA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ACpE,cAAc,CAAC,gBAAgB,GAAG,gCAAgB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;SAC7E;QAGD,OAAO,OAAO,CAAC,+CAA+C,aAAa,CAAC,aAAa,EAAE,EAAE;YAC3F,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc;SACrB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -21,14 +21,13 @@ const action = {
|
|
|
21
21
|
label: 'Event Name',
|
|
22
22
|
description: 'The name of the event coming from the source, this is an additional information field before the call goes to Ironclad.',
|
|
23
23
|
type: 'string',
|
|
24
|
-
default: { '@path': 'event' },
|
|
24
|
+
default: { '@path': '$.event' },
|
|
25
25
|
required: false
|
|
26
26
|
},
|
|
27
27
|
group_id: {
|
|
28
28
|
label: 'Clickwrap Group Id',
|
|
29
|
-
description: 'The ID of the Clickwrap Group associated with the acceptance event.',
|
|
30
|
-
type: '
|
|
31
|
-
default: '',
|
|
29
|
+
description: 'The ID of the Clickwrap Group associated with the acceptance event. Needs to be an integer',
|
|
30
|
+
type: 'integer',
|
|
32
31
|
required: true
|
|
33
32
|
},
|
|
34
33
|
event_type: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/ironclad/RecordAction/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EACT,yKAAyK;IAC3K,MAAM,EAAE;QACN,GAAG,EAAE;YACH,KAAK,EAAE,WAAW;YAClB,WAAW,EACT,uIAAuI;YACzI,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;iBACnC;aACF;YACD,QAAQ,EAAE,IAAI;SACf;QACD,UAAU,EAAE;YACV,KAAK,EAAE,YAAY;YACnB,WAAW,EACT,yHAAyH;YAC3H,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/ironclad/RecordAction/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EACT,yKAAyK;IAC3K,MAAM,EAAE;QACN,GAAG,EAAE;YACH,KAAK,EAAE,WAAW;YAClB,WAAW,EACT,uIAAuI;YACzI,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;iBACnC;aACF;YACD,QAAQ,EAAE,IAAI;SACf;QACD,UAAU,EAAE;YACV,KAAK,EAAE,YAAY;YACnB,WAAW,EACT,yHAAyH;YAC3H,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;YAC/B,QAAQ,EAAE,KAAK;SAChB;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,oBAAoB;YAC3B,WAAW,EAAE,4FAA4F;YACzG,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,IAAI;SACf;QACD,UAAU,EAAE;YACV,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,6FAA6F;YAC1G,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,WAAW;YACpB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;gBAC1C,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ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AAE,IAAI,CAAC,OAAO,EAAE,iBAAiB,EAAE,EAAE;YACvC,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,iBAAiB,EAAE,GAAG;YACzC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,iBAAiB,EAAE,IAAI;YAC3C,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC;YACnC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU;YAC5B,WAAW,EAAE,IAAI;YACjB,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,SAAS;SAC5B,CAAA;QAED,MAAM,gBAAgB,GAAG,MAAM,OAAO,CAAC,WAAW,GAAG,YAAY,EAAE;YACjE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,QAAQ;SACf,CAAC,CAAA;QAEF,OAAO,gBAAgB,CAAA;IACzB,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -15,21 +15,18 @@ const destination = {
|
|
|
15
15
|
label: 'Site Access ID',
|
|
16
16
|
description: 'Site Access ID. An ID that’s unique for each site within your account. Information on finding your sid can be found in the authentication section.',
|
|
17
17
|
type: 'string',
|
|
18
|
-
default: '',
|
|
19
18
|
required: true
|
|
20
19
|
},
|
|
21
20
|
staging_endpoint: {
|
|
22
21
|
label: 'Staging Endpoint',
|
|
23
22
|
description: 'Turn this ON, to send requests to the staging server, ONLY if Clickwrap support instructs you to do so.',
|
|
24
23
|
type: 'boolean',
|
|
25
|
-
required: true,
|
|
26
24
|
default: false
|
|
27
25
|
},
|
|
28
26
|
test_mode: {
|
|
29
27
|
label: 'Test Mode',
|
|
30
28
|
description: 'Test Mode, whether or not to process the acceptance in test_mode. Defaults to false, Toggle to ON to enable it.',
|
|
31
29
|
type: 'boolean',
|
|
32
|
-
required: true,
|
|
33
30
|
default: false
|
|
34
31
|
}
|
|
35
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/ironclad/index.ts"],"names":[],"mappings":";;;;;AAGA,kEAAyC;AAEzC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,GAAG,EAAE;gBACH,KAAK,EAAE,gBAAgB;gBACvB,WAAW,EACT,oJAAoJ;gBACtJ,IAAI,EAAE,QAAQ;gBACd,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/ironclad/index.ts"],"names":[],"mappings":";;;;;AAGA,kEAAyC;AAEzC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,GAAG,EAAE;gBACH,KAAK,EAAE,gBAAgB;gBACvB,WAAW,EACT,oJAAoJ;gBACtJ,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,gBAAgB,EAAE;gBAChB,KAAK,EAAE,kBAAkB;gBACzB,WAAW,EACT,yGAAyG;gBAC3G,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,KAAK;aACf;YACD,SAAS,EAAE;gBACT,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,iHAAiH;gBACnH,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,KAAK;aACf;SACF;KACF;IAED,OAAO,EAAE;QACP,YAAY,EAAZ,sBAAY;KACb;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -4,9 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const qualtricsApiClient_1 = __importDefault(require("../qualtricsApiClient"));
|
|
7
|
+
const dynamicFields_1 = require("../dynamicFields");
|
|
7
8
|
const action = {
|
|
8
|
-
title: '
|
|
9
|
-
description: '
|
|
9
|
+
title: 'Create and/or update contact in XM Directory',
|
|
10
|
+
description: 'Create and/or update contact in XM Directory. Updating is handled by contact deduplication in your [directory settings](https://www.qualtrics.com/support/iq-directory/directory-settings-tab/automatic-deduplication/). If deduplication is setup correctly this action will perform UPSERT operations on contacts',
|
|
10
11
|
defaultSubscription: 'type = "identify"',
|
|
11
12
|
fields: {
|
|
12
13
|
directoryId: {
|
|
@@ -14,9 +15,7 @@ const action = {
|
|
|
14
15
|
type: 'string',
|
|
15
16
|
description: 'Directory id. Also known as the Pool ID. POOL_XXX',
|
|
16
17
|
required: true,
|
|
17
|
-
|
|
18
|
-
'@path': '$.traits.directoryId'
|
|
19
|
-
}
|
|
18
|
+
dynamic: true
|
|
20
19
|
},
|
|
21
20
|
extRef: {
|
|
22
21
|
label: 'External Data Reference',
|
|
@@ -87,6 +86,9 @@ const action = {
|
|
|
87
86
|
defaultObjectUI: 'keyvalue'
|
|
88
87
|
}
|
|
89
88
|
},
|
|
89
|
+
dynamicFields: {
|
|
90
|
+
directoryId: dynamicFields_1.getDirectoryIds
|
|
91
|
+
},
|
|
90
92
|
perform: (request, data) => {
|
|
91
93
|
const apiClient = new qualtricsApiClient_1.default(data.settings.datacenter, data.settings.apiToken, request);
|
|
92
94
|
const payload = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/qualtrics/addContactToXmd/index.ts"],"names":[],"mappings":";;;;;AAEA,+EAAsD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/qualtrics/addContactToXmd/index.ts"],"names":[],"mappings":";;;;;AAEA,+EAAsD;AAEtD,oDAAkD;AAElD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,8CAA8C;IACrD,WAAW,EACT,qTAAqT;IACvT,mBA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
|
|
2
|
+
import { RequestClient } from '@segment/actions-core';
|
|
3
|
+
import { ExecuteInput } from '@segment/actions-core';
|
|
4
|
+
import { Settings } from './generated-types';
|
|
5
|
+
export declare function getDirectoryIds(request: RequestClient, data: ExecuteInput<Settings, unknown>): Promise<DynamicFieldResponse>;
|
|
@@ -0,0 +1,39 @@
|
|
|
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.getDirectoryIds = void 0;
|
|
7
|
+
const qualtricsApiClient_1 = __importDefault(require("./qualtricsApiClient"));
|
|
8
|
+
async function getDirectoryIds(request, data) {
|
|
9
|
+
const choices = [];
|
|
10
|
+
const apiClient = new qualtricsApiClient_1.default(data.settings.datacenter, data.settings.apiToken, request);
|
|
11
|
+
try {
|
|
12
|
+
const response = await apiClient.listDirectories();
|
|
13
|
+
for (const directory of response.elements) {
|
|
14
|
+
choices.push({
|
|
15
|
+
label: `${directory.name}`,
|
|
16
|
+
value: directory.directoryId
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
return getError(err);
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
choices
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
exports.getDirectoryIds = getDirectoryIds;
|
|
28
|
+
async function getError(err) {
|
|
29
|
+
const errResponse = err?.response;
|
|
30
|
+
const errorBody = (await errResponse.json());
|
|
31
|
+
return {
|
|
32
|
+
choices: [],
|
|
33
|
+
error: {
|
|
34
|
+
message: errorBody?.meta?.error?.errorMessage ?? 'Unknown Error',
|
|
35
|
+
code: errResponse?.status.toString() ?? '500'
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=dynamicFields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamicFields.js","sourceRoot":"","sources":["../../../src/destinations/qualtrics/dynamicFields.ts"],"names":[],"mappings":";;;;;;AACA,8EAAoF;AAM7E,KAAK,UAAU,eAAe,CACnC,OAAsB,EACtB,IAAqC;IAErC,MAAM,OAAO,GAAuB,EAAE,CAAA;IACtC,MAAM,SAAS,GAAG,IAAI,4BAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IACnG,IAAI;QACF,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,eAAe,EAAE,CAAA;QAClD,KAAK,MAAM,SAAS,IAAI,QAAQ,CAAC,QAAQ,EAAE;YACzC,OAAO,CAAC,IAAI,CAAC;gBACX,KAAK,EAAE,GAAG,SAAS,CAAC,IAAI,EAAE;gBAC1B,KAAK,EAAE,SAAS,CAAC,WAAW;aAC7B,CAAC,CAAA;SACH;KACF;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAA;KACrB;IAED,OAAO;QACL,OAAO;KACR,CAAA;AACH,CAAC;AArBD,0CAqBC;AAED,KAAK,UAAU,QAAQ,CAAC,GAAY;IAClC,MAAM,WAAW,GAAI,GAAiB,EAAE,QAAQ,CAAA;IAChD,MAAM,SAAS,GAAG,CAAC,MAAM,WAAW,CAAC,IAAI,EAAE,CAA8B,CAAA;IACzE,OAAO;QACL,OAAO,EAAE,EAAE;QACX,KAAK,EAAE;YACL,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,IAAI,eAAe;YAChE,IAAI,EAAE,WAAW,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,KAAK;SAC9C;KACF,CAAA;AACH,CAAC"}
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const addContactToXmd_1 = __importDefault(require("./addContactToXmd"));
|
|
7
|
+
const upsertContactTransaction_1 = __importDefault(require("./upsertContactTransaction"));
|
|
7
8
|
const triggerXflowWorkflow_1 = __importDefault(require("./triggerXflowWorkflow"));
|
|
8
9
|
const qualtricsApiClient_1 = __importDefault(require("./qualtricsApiClient"));
|
|
9
10
|
const destination = {
|
|
@@ -23,16 +24,19 @@ const destination = {
|
|
|
23
24
|
label: 'Datacenter ID',
|
|
24
25
|
description: 'Qualtrics datacenter id that identifies where your qualtrics instance is located. Found under "Account settings" -> "Qualtrics IDs".',
|
|
25
26
|
type: 'string',
|
|
26
|
-
required: true
|
|
27
|
+
required: true,
|
|
28
|
+
default: 'iad1'
|
|
27
29
|
}
|
|
28
30
|
},
|
|
29
|
-
testAuthentication: (request, input) => {
|
|
31
|
+
testAuthentication: async (request, input) => {
|
|
30
32
|
const apiClient = new qualtricsApiClient_1.default(input.settings.datacenter, input.settings.apiToken, request);
|
|
31
|
-
|
|
33
|
+
const response = await apiClient.whoaAmI();
|
|
34
|
+
return response.userName !== undefined;
|
|
32
35
|
}
|
|
33
36
|
},
|
|
34
37
|
actions: {
|
|
35
38
|
addContactToXmd: addContactToXmd_1.default,
|
|
39
|
+
upsertContactTransaction: upsertContactTransaction_1.default,
|
|
36
40
|
triggerXflowWorkflow: triggerXflowWorkflow_1.default
|
|
37
41
|
}
|
|
38
42
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/qualtrics/index.ts"],"names":[],"mappings":";;;;;AAIA,wEAA+C;AAC/C,kFAAyD;AACzD,8EAAqD;AAErD,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,QAAQ,EA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