@segment/action-destinations 3.331.0-staging.0 → 3.331.1-staging.1

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.
@@ -9,7 +9,7 @@ export declare const dateStringToFuzzyDate: (dateString: string | number) => fal
9
9
  y: string;
10
10
  };
11
11
  export declare const augmentFieldsWithConstituentFields: (fields: Record<string, InputField>) => Record<string, InputField>;
12
- export declare const splitConstituentPayload: (payload: CreateOrUpdateIndividualConstituentPayload) => (Partial<Constituent> | Partial<Address> | Partial<OnlinePresence> | Partial<Phone>)[];
12
+ export declare const splitConstituentPayload: (payload: CreateOrUpdateIndividualConstituentPayload) => (Partial<Phone> | Partial<Constituent> | Partial<Address> | Partial<OnlinePresence>)[];
13
13
  export declare const buildConstituentPayloadFromPayload: (payload: StringIndexedObject) => Partial<CreateOrUpdateIndividualConstituentPayload>;
14
14
  export declare const buildGiftDataFromPayload: (constituentId: string, payload: CreateGiftPayload) => Partial<Gift>;
15
15
  export declare const buildConstituentActionDataFromPayload: (constituentId: string, payload: CreateConstituentAction) => Partial<ConstituentAction>;
@@ -1,12 +1,12 @@
1
1
  import { ContextFromDecorator } from './operationTracking';
2
2
  export declare const track: ((decoratorArgs?: ({
3
+ shouldStats?: ((args: import("./operationTracking").OperationStatsEventArgs) => boolean | void) | undefined;
4
+ } & {
3
5
  onError?: ((ctx: import("./operationTracking").OperationErrorHandlerContext<import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>>) => void) | undefined;
4
- } & import("./operationTracking").OperationLoggerDecoratorArgs & {
6
+ } & {
5
7
  onTry?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
6
8
  onFinally?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
7
- } & {
8
- shouldStats?: ((args: import("./operationTracking").OperationStatsEventArgs) => boolean | void) | undefined;
9
- } & {
9
+ } & import("./operationTracking").OperationLoggerDecoratorArgs & {
10
10
  wrapIntegrationError?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => import("@segment/actions-core/*").IntegrationError | [message: string, code: string, status: number]) | undefined;
11
11
  }) | undefined) => import("./operationTracking").GenericMethodDecorator<(this: any, ...args: any[]) => any>) & {
12
12
  getCurrentOperation(classInstance: any): (import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & {
@@ -15,8 +15,13 @@ export declare const track: ((decoratorArgs?: ({
15
15
  }) | undefined;
16
16
  } & {
17
17
  _contextType: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & {
18
- start?: number | undefined;
19
- duration?: number | undefined;
18
+ tags: string[];
19
+ sharedContext: {
20
+ tags: string[];
21
+ };
22
+ decoratorArgs?: {
23
+ shouldStats?: ((args: import("./operationTracking").OperationStatsEventArgs) => boolean | void) | undefined;
24
+ } | undefined;
20
25
  } & {
21
26
  decoratorArgs?: {
22
27
  onError?: ((ctx: import("./operationTracking").OperationErrorHandlerContext<import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>>) => void) | undefined;
@@ -25,10 +30,8 @@ export declare const track: ((decoratorArgs?: ({
25
30
  parent?: (import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any> & any) | undefined;
26
31
  sharedContext: {};
27
32
  } & {
28
- logs: string[];
29
- logMetadata?: Record<string, unknown> | undefined;
30
- decoratorArgs?: import("./operationTracking").OperationLoggerDecoratorArgs | undefined;
31
- sharedContext: import("./operationTracking").OperationLoggerSharedContext;
33
+ start?: number | undefined;
34
+ duration?: number | undefined;
32
35
  } & {
33
36
  onFinally: (() => void)[];
34
37
  decoratorArgs?: {
@@ -36,13 +39,10 @@ export declare const track: ((decoratorArgs?: ({
36
39
  onFinally?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => void) | undefined;
37
40
  } | undefined;
38
41
  } & {
39
- tags: string[];
40
- sharedContext: {
41
- tags: string[];
42
- };
43
- decoratorArgs?: {
44
- shouldStats?: ((args: import("./operationTracking").OperationStatsEventArgs) => boolean | void) | undefined;
45
- } | undefined;
42
+ logs: string[];
43
+ logMetadata?: Record<string, unknown> | undefined;
44
+ decoratorArgs?: import("./operationTracking").OperationLoggerDecoratorArgs | undefined;
45
+ sharedContext: import("./operationTracking").OperationLoggerSharedContext;
46
46
  } & {
47
47
  decoratorArgs?: {
48
48
  wrapIntegrationError?: ((ctx: import("./operationTracking").TryCatchFinallyContext<(this: any, ...args: any[]) => any>) => import("@segment/actions-core/*").IntegrationError | [message: string, code: string, status: number]) | undefined;
@@ -3,7 +3,7 @@ import { ModifiedResponse, RequestClient, DynamicFieldResponse } from '@segment/
3
3
  import { StatsContext } from '@segment/actions-core/destination-kit';
4
4
  import { Features } from '@segment/actions-core/mapping-kit';
5
5
  export declare const API_VERSION = "v13";
6
- export declare const CANARY_API_VERSION = "v13";
6
+ export declare const CANARY_API_VERSION = "v15";
7
7
  export declare const FLAGON_NAME = "google-enhanced-canary-version";
8
8
  export declare function formatCustomVariables(customVariables: object, customVariableIdsResults: Array<ConversionCustomVariable>): object;
9
9
  export declare const hash: (value: string | undefined) => string | undefined;
@@ -5,7 +5,7 @@ const crypto_1 = require("crypto");
5
5
  const actions_core_1 = require("@segment/actions-core");
6
6
  const formats_1 = require("ajv-formats/dist/formats");
7
7
  exports.API_VERSION = 'v13';
8
- exports.CANARY_API_VERSION = 'v13';
8
+ exports.CANARY_API_VERSION = 'v15';
9
9
  exports.FLAGON_NAME = 'google-enhanced-canary-version';
10
10
  function formatCustomVariables(customVariables, customVariableIdsResults) {
11
11
  const resourceNames = {};
@@ -0,0 +1,13 @@
1
+ export declare enum ApiRegions {
2
+ US = "US \uD83C\uDDFA\uD83C\uDDF8",
3
+ EU = "EU \uD83C\uDDEA\uD83C\uDDFA"
4
+ }
5
+ export declare enum StrictMode {
6
+ ON = "1",
7
+ OFF = "0"
8
+ }
9
+ export declare function getConcatenatedName(firstName: unknown, lastName: unknown, name: unknown): unknown;
10
+ export declare function getApiServerUrl(apiRegion: string | undefined): "https://api-eu.mixpanel.com" | "https://api.mixpanel.com";
11
+ export declare function getBrowser(userAgent: string): string;
12
+ export declare function getBrowserVersion(userAgent: string): string | undefined;
13
+ export declare function cheapGuid(maxlen?: number): string;
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cheapGuid = exports.getBrowserVersion = exports.getBrowser = exports.getApiServerUrl = exports.getConcatenatedName = exports.StrictMode = exports.ApiRegions = void 0;
4
+ var ApiRegions;
5
+ (function (ApiRegions) {
6
+ ApiRegions["US"] = "US \uD83C\uDDFA\uD83C\uDDF8";
7
+ ApiRegions["EU"] = "EU \uD83C\uDDEA\uD83C\uDDFA";
8
+ })(ApiRegions = exports.ApiRegions || (exports.ApiRegions = {}));
9
+ var StrictMode;
10
+ (function (StrictMode) {
11
+ StrictMode["ON"] = "1";
12
+ StrictMode["OFF"] = "0";
13
+ })(StrictMode = exports.StrictMode || (exports.StrictMode = {}));
14
+ function getConcatenatedName(firstName, lastName, name) {
15
+ return name ?? (firstName && lastName ? `${firstName} ${lastName}` : undefined);
16
+ }
17
+ exports.getConcatenatedName = getConcatenatedName;
18
+ function getApiServerUrl(apiRegion) {
19
+ if (apiRegion == ApiRegions.EU) {
20
+ return 'https://api-eu.mixpanel.com';
21
+ }
22
+ return 'https://api.mixpanel.com';
23
+ }
24
+ exports.getApiServerUrl = getApiServerUrl;
25
+ function getBrowser(userAgent) {
26
+ if (userAgent.includes(' OPR/')) {
27
+ if (userAgent.includes('Mini')) {
28
+ return 'Opera Mini';
29
+ }
30
+ return 'Opera';
31
+ }
32
+ else if (/(BlackBerry|PlayBook|BB10)/i.test(userAgent)) {
33
+ return 'BlackBerry';
34
+ }
35
+ else if (userAgent.includes('IEMobile') || userAgent.includes('WPDesktop')) {
36
+ return 'Internet Explorer Mobile';
37
+ }
38
+ else if (userAgent.includes('SamsungBrowser/')) {
39
+ return 'Samsung Internet';
40
+ }
41
+ else if (userAgent.includes('Edge') || userAgent.includes('Edg/')) {
42
+ return 'Microsoft Edge';
43
+ }
44
+ else if (userAgent.includes('FBIOS')) {
45
+ return 'Facebook Mobile';
46
+ }
47
+ else if (userAgent.includes('Chrome')) {
48
+ return 'Chrome';
49
+ }
50
+ else if (userAgent.includes('CriOS')) {
51
+ return 'Chrome iOS';
52
+ }
53
+ else if (userAgent.includes('UCWEB') || userAgent.includes('UCBrowser')) {
54
+ return 'UC Browser';
55
+ }
56
+ else if (userAgent.includes('FxiOS')) {
57
+ return 'Firefox iOS';
58
+ }
59
+ else if (userAgent.includes('Safari')) {
60
+ return 'Safari';
61
+ }
62
+ else if (userAgent.includes('Android')) {
63
+ return 'Android Mobile';
64
+ }
65
+ else if (userAgent.includes('Konqueror')) {
66
+ return 'Konqueror';
67
+ }
68
+ else if (userAgent.includes('Firefox')) {
69
+ return 'Firefox';
70
+ }
71
+ else if (userAgent.includes('MSIE') || userAgent.includes('Trident/')) {
72
+ return 'Internet Explorer';
73
+ }
74
+ else if (userAgent.includes('Gecko')) {
75
+ return 'Mozilla';
76
+ }
77
+ else {
78
+ return '';
79
+ }
80
+ }
81
+ exports.getBrowser = getBrowser;
82
+ function getBrowserVersion(userAgent) {
83
+ const browser = getBrowser(userAgent);
84
+ const versionRegexs = {
85
+ 'Internet Explorer Mobile': /rv:(\d+(\.\d+)?)/,
86
+ 'Microsoft Edge': /Edge?\/(\d+(\.\d+)?)/,
87
+ Chrome: /Chrome\/(\d+(\.\d+)?)/,
88
+ 'Chrome iOS': /CriOS\/(\d+(\.\d+)?)/,
89
+ 'UC Browser': /(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,
90
+ Safari: /Version\/(\d+(\.\d+)?)/,
91
+ 'Mobile Safari': /Version\/(\d+(\.\d+)?)/,
92
+ Opera: /(Opera|OPR)\/(\d+(\.\d+)?)/,
93
+ Firefox: /Firefox\/(\d+(\.\d+)?)/,
94
+ 'Firefox iOS': /FxiOS\/(\d+(\.\d+)?)/,
95
+ Konqueror: /Konqueror:(\d+(\.\d+)?)/,
96
+ BlackBerry: /BlackBerry (\d+(\.\d+)?)/,
97
+ 'Android Mobile': /android\s(\d+(\.\d+)?)/,
98
+ 'Samsung Internet': /SamsungBrowser\/(\d+(\.\d+)?)/,
99
+ 'Internet Explorer': /(rv:|MSIE )(\d+(\.\d+)?)/,
100
+ Mozilla: /rv:(\d+(\.\d+)?)/
101
+ };
102
+ const regex = versionRegexs[browser];
103
+ if (!regex)
104
+ return regex;
105
+ const matches = regex.exec(userAgent);
106
+ if (!matches) {
107
+ return undefined;
108
+ }
109
+ return matches[matches.length - 2];
110
+ }
111
+ exports.getBrowserVersion = getBrowserVersion;
112
+ function cheapGuid(maxlen) {
113
+ const guid = Math.random().toString(36).substring(2, 10) + Math.random().toString(36).substring(2, 10);
114
+ return maxlen ? guid.substring(0, maxlen) : guid;
115
+ }
116
+ exports.cheapGuid = cheapGuid;
117
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/destinations/mixpanel/utils.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,gDAAc,CAAA;IACd,gDAAc,CAAA;AAChB,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB;AAED,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,sBAAQ,CAAA;IACR,uBAAS,CAAA;AACX,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB;AAED,SAAgB,mBAAmB,CAAC,SAAkB,EAAE,QAAiB,EAAE,IAAa;IACtF,OAAO,IAAI,IAAI,CAAC,SAAS,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;AACjF,CAAC;AAFD,kDA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kB;KAC5B,CAAA;IACD,MAAM,KAAK,GAAG,aAAa,CAAC,OAAO,CAAC,CAAA;IACpC,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAA;IACxB,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IACrC,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,SAAS,CAAA;KACjB;IACD,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;AACpC,CAAC;AA3BD,8CA2BC;AAED,SAAgB,SAAS,CAAC,MAAe;IACvC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IACtG,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AAClD,CAAC;AAHD,8BAGC"}
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.331.0-staging.0",
4
+ "version": "3.331.1-staging.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/segmentio/action-destinations",