@servicetitan/datadog-rum 40.0.0 → 40.1.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/enrich-event.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const SERVICE_REGEX = /unpkg\.servicetitan\.com\/@servicetitan\/(?<service>[\w-]+)(?:@(?<version>\d+\.\d+\.\d+(?:-[\w
|
|
1
|
+
const SERVICE_REGEX = /unpkg\.servicetitan\.com\/@servicetitan\/(?<service>[\w-]+)(?:@(?<version>\d+\.\d+\.\d+(?:-[\w.-]+)?))?/;
|
|
2
2
|
function parseService(event, input) {
|
|
3
3
|
var _match_groups, _match_groups1;
|
|
4
4
|
const match = input === null || input === void 0 ? void 0 : input.match(SERVICE_REGEX);
|
package/dist/enrich-event.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/enrich-event.ts"],"sourcesContent":["import type { RumEvent, RumEventDomainContext } from '@datadog/browser-rum';\n\nconst SERVICE_REGEX =\n /unpkg\\.servicetitan\\.com\\/@servicetitan\\/(?<service>[\\w-]+)(?:@(?<version>\\d+\\.\\d+\\.\\d+(?:-[\\w
|
|
1
|
+
{"version":3,"sources":["../src/enrich-event.ts"],"sourcesContent":["import type { RumEvent, RumEventDomainContext } from '@datadog/browser-rum';\n\nconst SERVICE_REGEX =\n /unpkg\\.servicetitan\\.com\\/@servicetitan\\/(?<service>[\\w-]+)(?:@(?<version>\\d+\\.\\d+\\.\\d+(?:-[\\w.-]+)?))?/;\n\nfunction parseService(event: RumEvent, input: string | undefined) {\n const match = input?.match(SERVICE_REGEX);\n\n const service = match?.groups?.service;\n const version = match?.groups?.version;\n\n if (service) {\n event.service = service;\n event.version = version ?? 'unknown';\n return true;\n }\n\n return false;\n}\n\n/**\n * See https://docs.datadoghq.com/real_user_monitoring/browser/advanced_configuration/?tab=npm#micro-frontend\n */\nexport function enrichEvent(event: RumEvent, context: RumEventDomainContext): void {\n const stack =\n (context && 'handlingStack' in context ? context.handlingStack : undefined) ??\n (event.type === 'error' ? event.error?.stack : undefined);\n\n const message = event.type === 'error' ? event.error?.message : undefined;\n\n const url = event.type === 'resource' ? event.resource?.url : undefined;\n\n for (const source of [stack, message, url]) {\n if (parseService(event, source)) {\n break;\n }\n }\n}\n"],"names":["SERVICE_REGEX","parseService","event","input","match","service","groups","version","enrichEvent","context","stack","handlingStack","undefined","type","error","message","url","resource","source"],"mappings":"AAEA,MAAMA,gBACF;AAEJ,SAASC,aAAaC,KAAe,EAAEC,KAAyB;QAG5CC,eACAA;IAHhB,MAAMA,QAAQD,kBAAAA,4BAAAA,MAAOC,KAAK,CAACJ;IAE3B,MAAMK,UAAUD,kBAAAA,6BAAAA,gBAAAA,MAAOE,MAAM,cAAbF,oCAAAA,cAAeC,OAAO;IACtC,MAAME,UAAUH,kBAAAA,6BAAAA,iBAAAA,MAAOE,MAAM,cAAbF,qCAAAA,eAAeG,OAAO;IAEtC,IAAIF,SAAS;QACTH,MAAMG,OAAO,GAAGA;QAChBH,MAAMK,OAAO,GAAGA,oBAAAA,qBAAAA,UAAW;QAC3B,OAAO;IACX;IAEA,OAAO;AACX;AAEA;;CAEC,GACD,OAAO,SAASC,YAAYN,KAAe,EAAEO,OAA8B;QAElEA;QACyBP,cAEWA,eAEDA;IANxC,MAAMQ,SACDD,OAAAA,WAAW,mBAAmBA,UAAUA,QAAQE,aAAa,GAAGC,uBAAhEH,kBAAAA,OACAP,MAAMW,IAAI,KAAK,WAAUX,eAAAA,MAAMY,KAAK,cAAXZ,mCAAAA,aAAaQ,KAAK,GAAGE;IAEnD,MAAMG,UAAUb,MAAMW,IAAI,KAAK,WAAUX,gBAAAA,MAAMY,KAAK,cAAXZ,oCAAAA,cAAaa,OAAO,GAAGH;IAEhE,MAAMI,MAAMd,MAAMW,IAAI,KAAK,cAAaX,kBAAAA,MAAMe,QAAQ,cAAdf,sCAAAA,gBAAgBc,GAAG,GAAGJ;IAE9D,KAAK,MAAMM,UAAU;QAACR;QAAOK;QAASC;KAAI,CAAE;QACxC,IAAIf,aAAaC,OAAOgB,SAAS;YAC7B;QACJ;IACJ;AACJ"}
|
package/package.json
CHANGED
|
@@ -82,6 +82,45 @@ const hostResourceUnpkgRequest = {
|
|
|
82
82
|
context: {},
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
+
const hostResourceUnpkgRequestHyphenatedPrerelease = {
|
|
86
|
+
resource: {
|
|
87
|
+
url: 'https://unpkg.servicetitan.com/@servicetitan/eh-my-tenants@5.0.1-master-rc-eb9d8e988.0/dist/bundle/full/runtime.42087bf59c5e718ff526.bundle.js',
|
|
88
|
+
},
|
|
89
|
+
context: {},
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const hostResourceUnpkgRequestBranchAndHash = {
|
|
93
|
+
resource: {
|
|
94
|
+
url: 'https://unpkg.servicetitan.com/@servicetitan/eh-ccpro@1.7.2-master-48be403.0/dist/bundle/full/runtime.e648f9a4.bundle.js',
|
|
95
|
+
},
|
|
96
|
+
context: {},
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const hostResourceUnpkgRequestBuildAndBranch = {
|
|
100
|
+
resource: {
|
|
101
|
+
url: 'https://unpkg.servicetitan.com/@servicetitan/pricebook-enterprisehub@0.0.0-1.0.532-master/dist/bundle/full/runtime.2df2b4c6001e8a11f406.bundle.js',
|
|
102
|
+
},
|
|
103
|
+
context: {},
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const hostResourceUnpkgRequestGitDescribe = {
|
|
107
|
+
resource: {
|
|
108
|
+
url: 'https://unpkg.servicetitan.com/@servicetitan/customer-portal-estimates@0.0.0-1.0.1773-mockSupportForCPContainers.g19c652d3a4/dist/bundle/full/runtime.c58942f1a38b681d0249.bundle.js',
|
|
109
|
+
},
|
|
110
|
+
context: {},
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const mfeErrorHyphenatedPrerelease = {
|
|
114
|
+
error: {
|
|
115
|
+
message: 'Role name already exists',
|
|
116
|
+
stack: `
|
|
117
|
+
Error: Role name already exists
|
|
118
|
+
at value @ https://unpkg.servicetitan.com/@servicetitan/eh-user-management-client@10.0.9-master-rc-eb9d8e988.0/dist/bundle/full/main.0bbcdbd062f391fda175.bundle.js:2:1368334
|
|
119
|
+
`,
|
|
120
|
+
},
|
|
121
|
+
context: {},
|
|
122
|
+
};
|
|
123
|
+
|
|
85
124
|
const mfeResourceXhrRequest = {
|
|
86
125
|
resource: { url: 'https://go.servicetitan.com/app/api/data/user' },
|
|
87
126
|
context: {
|
|
@@ -174,4 +213,54 @@ export const rumEvents: {
|
|
|
174
213
|
service: 'global-search-bar',
|
|
175
214
|
version: '0.0.0-HEAD.c8fa2a6',
|
|
176
215
|
},
|
|
216
|
+
{
|
|
217
|
+
event: {
|
|
218
|
+
type: 'resource',
|
|
219
|
+
resource: hostResourceUnpkgRequestHyphenatedPrerelease.resource,
|
|
220
|
+
},
|
|
221
|
+
context: hostResourceUnpkgRequestHyphenatedPrerelease.context,
|
|
222
|
+
title: 'host sends request to unpkg for a prerelease with a hyphen',
|
|
223
|
+
service: 'eh-my-tenants',
|
|
224
|
+
version: '5.0.1-master-rc-eb9d8e988.0',
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
event: {
|
|
228
|
+
type: 'resource',
|
|
229
|
+
resource: hostResourceUnpkgRequestBranchAndHash.resource,
|
|
230
|
+
},
|
|
231
|
+
context: hostResourceUnpkgRequestBranchAndHash.context,
|
|
232
|
+
title: 'host sends request to unpkg for a prerelease with a branch and a hash',
|
|
233
|
+
service: 'eh-ccpro',
|
|
234
|
+
version: '1.7.2-master-48be403.0',
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
event: {
|
|
238
|
+
type: 'resource',
|
|
239
|
+
resource: hostResourceUnpkgRequestBuildAndBranch.resource,
|
|
240
|
+
},
|
|
241
|
+
context: hostResourceUnpkgRequestBuildAndBranch.context,
|
|
242
|
+
title: 'host sends request to unpkg for a prerelease with a build number and a branch',
|
|
243
|
+
service: 'pricebook-enterprisehub',
|
|
244
|
+
version: '0.0.0-1.0.532-master',
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
event: {
|
|
248
|
+
type: 'resource',
|
|
249
|
+
resource: hostResourceUnpkgRequestGitDescribe.resource,
|
|
250
|
+
},
|
|
251
|
+
context: hostResourceUnpkgRequestGitDescribe.context,
|
|
252
|
+
title: 'host sends request to unpkg for a prerelease with a git describe suffix',
|
|
253
|
+
service: 'customer-portal-estimates',
|
|
254
|
+
version: '0.0.0-1.0.1773-mockSupportForCPContainers.g19c652d3a4',
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
event: {
|
|
258
|
+
type: 'error',
|
|
259
|
+
error: mfeErrorHyphenatedPrerelease.error,
|
|
260
|
+
},
|
|
261
|
+
context: mfeErrorHyphenatedPrerelease.context,
|
|
262
|
+
title: 'MFE error from a prerelease with a hyphen',
|
|
263
|
+
service: 'eh-user-management-client',
|
|
264
|
+
version: '10.0.9-master-rc-eb9d8e988.0',
|
|
265
|
+
},
|
|
177
266
|
];
|
package/src/enrich-event.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RumEvent, RumEventDomainContext } from '@datadog/browser-rum';
|
|
2
2
|
|
|
3
3
|
const SERVICE_REGEX =
|
|
4
|
-
/unpkg\.servicetitan\.com\/@servicetitan\/(?<service>[\w-]+)(?:@(?<version>\d+\.\d+\.\d+(?:-[\w
|
|
4
|
+
/unpkg\.servicetitan\.com\/@servicetitan\/(?<service>[\w-]+)(?:@(?<version>\d+\.\d+\.\d+(?:-[\w.-]+)?))?/;
|
|
5
5
|
|
|
6
6
|
function parseService(event: RumEvent, input: string | undefined) {
|
|
7
7
|
const match = input?.match(SERVICE_REGEX);
|