@sentry/google-cloud-serverless 8.0.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/LICENSE +14 -0
  2. package/README.md +47 -0
  3. package/cjs/debug-build.js +11 -0
  4. package/cjs/debug-build.js.map +1 -0
  5. package/cjs/gcpfunction/cloud_events.js +82 -0
  6. package/cjs/gcpfunction/cloud_events.js.map +1 -0
  7. package/cjs/gcpfunction/events.js +87 -0
  8. package/cjs/gcpfunction/events.js.map +1 -0
  9. package/cjs/gcpfunction/http.js +98 -0
  10. package/cjs/gcpfunction/http.js.map +1 -0
  11. package/cjs/index.js +115 -0
  12. package/cjs/index.js.map +1 -0
  13. package/cjs/integrations/google-cloud-grpc.js +114 -0
  14. package/cjs/integrations/google-cloud-grpc.js.map +1 -0
  15. package/cjs/integrations/google-cloud-http.js +65 -0
  16. package/cjs/integrations/google-cloud-http.js.map +1 -0
  17. package/cjs/sdk.js +42 -0
  18. package/cjs/sdk.js.map +1 -0
  19. package/cjs/utils.js +60 -0
  20. package/cjs/utils.js.map +1 -0
  21. package/esm/debug-build.js +9 -0
  22. package/esm/debug-build.js.map +1 -0
  23. package/esm/gcpfunction/cloud_events.js +80 -0
  24. package/esm/gcpfunction/cloud_events.js.map +1 -0
  25. package/esm/gcpfunction/events.js +85 -0
  26. package/esm/gcpfunction/events.js.map +1 -0
  27. package/esm/gcpfunction/http.js +93 -0
  28. package/esm/gcpfunction/http.js.map +1 -0
  29. package/esm/index.js +9 -0
  30. package/esm/index.js.map +1 -0
  31. package/esm/integrations/google-cloud-grpc.js +109 -0
  32. package/esm/integrations/google-cloud-grpc.js.map +1 -0
  33. package/esm/integrations/google-cloud-http.js +63 -0
  34. package/esm/integrations/google-cloud-http.js.map +1 -0
  35. package/esm/package.json +1 -0
  36. package/esm/sdk.js +39 -0
  37. package/esm/sdk.js.map +1 -0
  38. package/esm/utils.js +56 -0
  39. package/esm/utils.js.map +1 -0
  40. package/package.json +58 -0
  41. package/types/debug-build.d.ts +7 -0
  42. package/types/debug-build.d.ts.map +1 -0
  43. package/types/gcpfunction/cloud_events.d.ts +11 -0
  44. package/types/gcpfunction/cloud_events.d.ts.map +1 -0
  45. package/types/gcpfunction/events.d.ts +11 -0
  46. package/types/gcpfunction/events.d.ts.map +1 -0
  47. package/types/gcpfunction/general.d.ts +38 -0
  48. package/types/gcpfunction/general.d.ts.map +1 -0
  49. package/types/gcpfunction/http.d.ts +10 -0
  50. package/types/gcpfunction/http.d.ts.map +1 -0
  51. package/types/index.d.ts +9 -0
  52. package/types/index.d.ts.map +1 -0
  53. package/types/integrations/google-cloud-grpc.d.ts +7 -0
  54. package/types/integrations/google-cloud-grpc.d.ts.map +1 -0
  55. package/types/integrations/google-cloud-http.d.ts +7 -0
  56. package/types/integrations/google-cloud-http.d.ts.map +1 -0
  57. package/types/sdk.d.ts +9 -0
  58. package/types/sdk.d.ts.map +1 -0
  59. package/types/utils.d.ts +18 -0
  60. package/types/utils.d.ts.map +1 -0
  61. package/types-ts3.8/debug-build.d.ts +7 -0
  62. package/types-ts3.8/gcpfunction/cloud_events.d.ts +11 -0
  63. package/types-ts3.8/gcpfunction/events.d.ts +11 -0
  64. package/types-ts3.8/gcpfunction/general.d.ts +38 -0
  65. package/types-ts3.8/gcpfunction/http.d.ts +10 -0
  66. package/types-ts3.8/index.d.ts +9 -0
  67. package/types-ts3.8/integrations/google-cloud-grpc.d.ts +7 -0
  68. package/types-ts3.8/integrations/google-cloud-http.d.ts +7 -0
  69. package/types-ts3.8/sdk.d.ts +9 -0
  70. package/types-ts3.8/utils.d.ts +18 -0
@@ -0,0 +1,109 @@
1
+ import { _optionalChain } from '@sentry/utils';
2
+ import { defineIntegration, getClient, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
3
+ import { startInactiveSpan } from '@sentry/node';
4
+ import { fill } from '@sentry/utils';
5
+
6
+ const SERVICE_PATH_REGEX = /^(\w+)\.googleapis.com$/;
7
+
8
+ const INTEGRATION_NAME = 'GoogleCloudGrpc';
9
+
10
+ const SETUP_CLIENTS = new WeakMap();
11
+
12
+ const _googleCloudGrpcIntegration = ((options = {}) => {
13
+ const optional = options.optional || false;
14
+ return {
15
+ name: INTEGRATION_NAME,
16
+ setupOnce() {
17
+ try {
18
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
19
+ const gaxModule = require('google-gax');
20
+ fill(
21
+ gaxModule.GrpcClient.prototype, // eslint-disable-line @typescript-eslint/no-unsafe-member-access
22
+ 'createStub',
23
+ wrapCreateStub,
24
+ );
25
+ } catch (e) {
26
+ if (!optional) {
27
+ throw e;
28
+ }
29
+ }
30
+ },
31
+ setup(client) {
32
+ SETUP_CLIENTS.set(client, true);
33
+ },
34
+ };
35
+ }) ;
36
+
37
+ /**
38
+ * Google Cloud Platform service requests tracking for GRPC APIs.
39
+ */
40
+ const googleCloudGrpcIntegration = defineIntegration(_googleCloudGrpcIntegration);
41
+
42
+ /** Returns a wrapped function that returns a stub with tracing enabled */
43
+ function wrapCreateStub(origCreate) {
44
+ return async function ( ...args) {
45
+ const servicePath = _optionalChain([args, 'access', _ => _[1], 'optionalAccess', _2 => _2.servicePath]);
46
+ if (servicePath == null || servicePath == undefined) {
47
+ return origCreate.apply(this, args);
48
+ }
49
+ const serviceIdentifier = identifyService(servicePath);
50
+ const stub = await origCreate.apply(this, args);
51
+ for (const methodName of Object.keys(Object.getPrototypeOf(stub))) {
52
+ fillGrpcFunction(stub, serviceIdentifier, methodName);
53
+ }
54
+ return stub;
55
+ };
56
+ }
57
+
58
+ /** Patches the function in grpc stub to enable tracing */
59
+ function fillGrpcFunction(stub, serviceIdentifier, methodName) {
60
+ const funcObj = stub[methodName];
61
+ if (typeof funcObj !== 'function') {
62
+ return;
63
+ }
64
+ const callType =
65
+ !funcObj.requestStream && !funcObj.responseStream
66
+ ? 'unary call'
67
+ : funcObj.requestStream && !funcObj.responseStream
68
+ ? 'client stream'
69
+ : !funcObj.requestStream && funcObj.responseStream
70
+ ? 'server stream'
71
+ : 'bidi stream';
72
+ if (callType != 'unary call') {
73
+ return;
74
+ }
75
+ fill(
76
+ stub,
77
+ methodName,
78
+ (orig) =>
79
+ (...args) => {
80
+ const ret = orig.apply(stub, args);
81
+ if (typeof _optionalChain([ret, 'optionalAccess', _3 => _3.on]) !== 'function' || !SETUP_CLIENTS.has(getClient() )) {
82
+ return ret;
83
+ }
84
+ const span = startInactiveSpan({
85
+ name: `${callType} ${methodName}`,
86
+ onlyIfParent: true,
87
+ op: `grpc.${serviceIdentifier}`,
88
+ attributes: {
89
+ [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.grpc.serverless',
90
+ },
91
+ });
92
+ ret.on('status', () => {
93
+ if (span) {
94
+ span.end();
95
+ }
96
+ });
97
+ return ret;
98
+ },
99
+ );
100
+ }
101
+
102
+ /** Identifies service by its address */
103
+ function identifyService(servicePath) {
104
+ const match = servicePath.match(SERVICE_PATH_REGEX);
105
+ return match ? match[1] : servicePath;
106
+ }
107
+
108
+ export { googleCloudGrpcIntegration };
109
+ //# sourceMappingURL=google-cloud-grpc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google-cloud-grpc.js","sources":["../../../src/integrations/google-cloud-grpc.ts"],"sourcesContent":["import type { EventEmitter } from 'events';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, defineIntegration, getClient } from '@sentry/core';\nimport { startInactiveSpan } from '@sentry/node';\nimport type { Client, IntegrationFn } from '@sentry/types';\nimport { fill } from '@sentry/utils';\n\ninterface GrpcFunction extends CallableFunction {\n (...args: unknown[]): EventEmitter;\n}\n\ninterface GrpcFunctionObject extends GrpcFunction {\n requestStream: boolean;\n responseStream: boolean;\n originalName: string;\n}\n\ninterface StubOptions {\n servicePath?: string;\n}\n\ninterface CreateStubFunc extends CallableFunction {\n (createStub: unknown, options: StubOptions): PromiseLike<Stub>;\n}\n\ninterface Stub {\n [key: string]: GrpcFunctionObject;\n}\n\nconst SERVICE_PATH_REGEX = /^(\\w+)\\.googleapis.com$/;\n\nconst INTEGRATION_NAME = 'GoogleCloudGrpc';\n\nconst SETUP_CLIENTS = new WeakMap<Client, boolean>();\n\nconst _googleCloudGrpcIntegration = ((options: { optional?: boolean } = {}) => {\n const optional = options.optional || false;\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const gaxModule = require('google-gax');\n fill(\n gaxModule.GrpcClient.prototype, // eslint-disable-line @typescript-eslint/no-unsafe-member-access\n 'createStub',\n wrapCreateStub,\n );\n } catch (e) {\n if (!optional) {\n throw e;\n }\n }\n },\n setup(client) {\n SETUP_CLIENTS.set(client, true);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Google Cloud Platform service requests tracking for GRPC APIs.\n */\nexport const googleCloudGrpcIntegration = defineIntegration(_googleCloudGrpcIntegration);\n\n/** Returns a wrapped function that returns a stub with tracing enabled */\nfunction wrapCreateStub(origCreate: CreateStubFunc): CreateStubFunc {\n return async function (this: unknown, ...args: Parameters<CreateStubFunc>) {\n const servicePath = args[1]?.servicePath;\n if (servicePath == null || servicePath == undefined) {\n return origCreate.apply(this, args);\n }\n const serviceIdentifier = identifyService(servicePath);\n const stub = await origCreate.apply(this, args);\n for (const methodName of Object.keys(Object.getPrototypeOf(stub))) {\n fillGrpcFunction(stub, serviceIdentifier, methodName);\n }\n return stub;\n };\n}\n\n/** Patches the function in grpc stub to enable tracing */\nfunction fillGrpcFunction(stub: Stub, serviceIdentifier: string, methodName: string): void {\n const funcObj = stub[methodName];\n if (typeof funcObj !== 'function') {\n return;\n }\n const callType =\n !funcObj.requestStream && !funcObj.responseStream\n ? 'unary call'\n : funcObj.requestStream && !funcObj.responseStream\n ? 'client stream'\n : !funcObj.requestStream && funcObj.responseStream\n ? 'server stream'\n : 'bidi stream';\n if (callType != 'unary call') {\n return;\n }\n fill(\n stub,\n methodName,\n (orig: GrpcFunction): GrpcFunction =>\n (...args) => {\n const ret = orig.apply(stub, args);\n if (typeof ret?.on !== 'function' || !SETUP_CLIENTS.has(getClient() as Client)) {\n return ret;\n }\n const span = startInactiveSpan({\n name: `${callType} ${methodName}`,\n onlyIfParent: true,\n op: `grpc.${serviceIdentifier}`,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.grpc.serverless',\n },\n });\n ret.on('status', () => {\n if (span) {\n span.end();\n }\n });\n return ret;\n },\n );\n}\n\n/** Identifies service by its address */\nfunction identifyService(servicePath: string): string {\n const match = servicePath.match(SERVICE_PATH_REGEX);\n return match ? match[1] : servicePath;\n}\n"],"names":[],"mappings":";;;;;AA4BA,CAAM,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAqB,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAyB;;AAEpD,CAAM,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAmB,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB;;AAE1C,CAAA,CAAA,CAAA,CAAA,EAAM,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAE,CAAI,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,EAAmB;;AAEpD,CAAA,CAAA,CAAA,CAAA,EAAM,4BAA+B,EAAA,CAAA,CAAC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AA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA;AACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA;EACA,CAAA,CAAA,CAAA,CAAA,EAAA,MAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;EACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,MAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACA;;"}
@@ -0,0 +1,63 @@
1
+ import { defineIntegration, getClient, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SentryNonRecordingSpan } from '@sentry/core';
2
+ import { startInactiveSpan } from '@sentry/node';
3
+ import { fill } from '@sentry/utils';
4
+
5
+ const INTEGRATION_NAME = 'GoogleCloudHttp';
6
+
7
+ const SETUP_CLIENTS = new WeakMap();
8
+
9
+ const _googleCloudHttpIntegration = ((options = {}) => {
10
+ const optional = options.optional || false;
11
+ return {
12
+ name: INTEGRATION_NAME,
13
+ setupOnce() {
14
+ try {
15
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
16
+ const commonModule = require('@google-cloud/common') ;
17
+ fill(commonModule.Service.prototype, 'request', wrapRequestFunction);
18
+ } catch (e) {
19
+ if (!optional) {
20
+ throw e;
21
+ }
22
+ }
23
+ },
24
+ setup(client) {
25
+ SETUP_CLIENTS.set(client, true);
26
+ },
27
+ };
28
+ }) ;
29
+
30
+ /**
31
+ * Google Cloud Platform service requests tracking for RESTful APIs.
32
+ */
33
+ const googleCloudHttpIntegration = defineIntegration(_googleCloudHttpIntegration);
34
+
35
+ /** Returns a wrapped function that makes a request with tracing enabled */
36
+ function wrapRequestFunction(orig) {
37
+ return function ( reqOpts, callback) {
38
+ const httpMethod = reqOpts.method || 'GET';
39
+ const span = SETUP_CLIENTS.has(getClient() )
40
+ ? startInactiveSpan({
41
+ name: `${httpMethod} ${reqOpts.uri}`,
42
+ onlyIfParent: true,
43
+ op: `http.client.${identifyService(this.apiEndpoint)}`,
44
+ attributes: {
45
+ [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.serverless',
46
+ },
47
+ })
48
+ : new SentryNonRecordingSpan();
49
+ orig.call(this, reqOpts, (...args) => {
50
+ span.end();
51
+ callback(...args);
52
+ });
53
+ };
54
+ }
55
+
56
+ /** Identifies service by its base url */
57
+ function identifyService(apiEndpoint) {
58
+ const match = apiEndpoint.match(/^https:\/\/(\w+)\.googleapis.com$/);
59
+ return match ? match[1] : apiEndpoint.replace(/^(http|https)?:\/\//, '');
60
+ }
61
+
62
+ export { googleCloudHttpIntegration };
63
+ //# sourceMappingURL=google-cloud-http.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google-cloud-http.js","sources":["../../../src/integrations/google-cloud-http.ts"],"sourcesContent":["import type * as common from '@google-cloud/common';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SentryNonRecordingSpan, defineIntegration, getClient } from '@sentry/core';\nimport { startInactiveSpan } from '@sentry/node';\nimport type { Client, IntegrationFn } from '@sentry/types';\nimport { fill } from '@sentry/utils';\n\ntype RequestOptions = common.DecorateRequestOptions;\ntype ResponseCallback = common.BodyResponseCallback;\n// This interace could be replaced with just type alias once the `strictBindCallApply` mode is enabled.\ninterface RequestFunction extends CallableFunction {\n (reqOpts: RequestOptions, callback: ResponseCallback): void;\n}\n\nconst INTEGRATION_NAME = 'GoogleCloudHttp';\n\nconst SETUP_CLIENTS = new WeakMap<Client, boolean>();\n\nconst _googleCloudHttpIntegration = ((options: { optional?: boolean } = {}) => {\n const optional = options.optional || false;\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const commonModule = require('@google-cloud/common') as typeof common;\n fill(commonModule.Service.prototype, 'request', wrapRequestFunction);\n } catch (e) {\n if (!optional) {\n throw e;\n }\n }\n },\n setup(client) {\n SETUP_CLIENTS.set(client, true);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Google Cloud Platform service requests tracking for RESTful APIs.\n */\nexport const googleCloudHttpIntegration = defineIntegration(_googleCloudHttpIntegration);\n\n/** Returns a wrapped function that makes a request with tracing enabled */\nfunction wrapRequestFunction(orig: RequestFunction): RequestFunction {\n return function (this: common.Service, reqOpts: RequestOptions, callback: ResponseCallback): void {\n const httpMethod = reqOpts.method || 'GET';\n const span = SETUP_CLIENTS.has(getClient() as Client)\n ? startInactiveSpan({\n name: `${httpMethod} ${reqOpts.uri}`,\n onlyIfParent: true,\n op: `http.client.${identifyService(this.apiEndpoint)}`,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.serverless',\n },\n })\n : new SentryNonRecordingSpan();\n orig.call(this, reqOpts, (...args: Parameters<ResponseCallback>) => {\n span.end();\n callback(...args);\n });\n };\n}\n\n/** Identifies service by its base url */\nfunction identifyService(apiEndpoint: string): string {\n const match = apiEndpoint.match(/^https:\\/\\/(\\w+)\\.googleapis.com$/);\n return match ? match[1] : apiEndpoint.replace(/^(http|https)?:\\/\\//, '');\n}\n"],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A,EAAA,IAAA;AACA,UAAA,EAAA,EAAA,CAAA,YAAA,EAAA,eAAA,CAAA,IAAA,CAAA,WAAA,CAAA,CAAA,CAAA;AACA,UAAA,UAAA,EAAA;AACA,YAAA,CAAA,gCAAA,GAAA,sBAAA;AACA,WAAA;AACA,SAAA,CAAA;AACA,QAAA,IAAA,sBAAA,EAAA,CAAA;AACA,IAAA,IAAA,CAAA,IAAA,CAAA,IAAA,EAAA,OAAA,EAAA,CAAA,GAAA,IAAA,KAAA;AACA,MAAA,IAAA,CAAA,GAAA,EAAA,CAAA;AACA,MAAA,QAAA,CAAA,GAAA,IAAA,CAAA,CAAA;AACA,KAAA,CAAA,CAAA;AACA,GAAA,CAAA;AACA,CAAA;AACA;AACA;AACA,SAAA,eAAA,CAAA,WAAA,EAAA;AACA,EAAA,MAAA,KAAA,GAAA,WAAA,CAAA,KAAA,CAAA,mCAAA,CAAA,CAAA;AACA,EAAA,OAAA,KAAA,GAAA,KAAA,CAAA,CAAA,CAAA,GAAA,WAAA,CAAA,OAAA,CAAA,qBAAA,EAAA,EAAA,CAAA,CAAA;AACA;;;;"}
@@ -0,0 +1 @@
1
+ { "type": "module" }
package/esm/sdk.js ADDED
@@ -0,0 +1,39 @@
1
+ import { getDefaultIntegrations as getDefaultIntegrations$1, SDK_VERSION, init as init$1 } from '@sentry/node';
2
+ import { googleCloudGrpcIntegration } from './integrations/google-cloud-grpc.js';
3
+ import { googleCloudHttpIntegration } from './integrations/google-cloud-http.js';
4
+
5
+ /** Get the default integrations for the GCP SDK. */
6
+ function getDefaultIntegrations(options) {
7
+ return [
8
+ ...getDefaultIntegrations$1(options),
9
+ googleCloudHttpIntegration({ optional: true }), // We mark this integration optional since '@google-cloud/common' module could be missing.
10
+ googleCloudGrpcIntegration({ optional: true }), // We mark this integration optional since 'google-gax' module could be missing.
11
+ ];
12
+ }
13
+
14
+ /**
15
+ * @see {@link Sentry.init}
16
+ */
17
+ function init(options = {}) {
18
+ const opts = {
19
+ _metadata: {} ,
20
+ defaultIntegrations: getDefaultIntegrations(options),
21
+ ...options,
22
+ };
23
+
24
+ opts._metadata.sdk = opts._metadata.sdk || {
25
+ name: 'sentry.javascript.google-cloud-serverless',
26
+ packages: [
27
+ {
28
+ name: 'npm:@sentry/google-cloud-serverless',
29
+ version: SDK_VERSION,
30
+ },
31
+ ],
32
+ version: SDK_VERSION,
33
+ };
34
+
35
+ init$1(opts);
36
+ }
37
+
38
+ export { getDefaultIntegrations, init };
39
+ //# sourceMappingURL=sdk.js.map
package/esm/sdk.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk.js","sources":["../../src/sdk.ts"],"sourcesContent":["import type { NodeOptions } from '@sentry/node';\nimport { SDK_VERSION, getDefaultIntegrations as getDefaultNodeIntegrations, init as initNode } from '@sentry/node';\nimport type { Integration, Options, SdkMetadata } from '@sentry/types';\n\nimport { googleCloudGrpcIntegration } from './integrations/google-cloud-grpc';\nimport { googleCloudHttpIntegration } from './integrations/google-cloud-http';\n\n/** Get the default integrations for the GCP SDK. */\nexport function getDefaultIntegrations(options: Options): Integration[] {\n return [\n ...getDefaultNodeIntegrations(options),\n googleCloudHttpIntegration({ optional: true }), // We mark this integration optional since '@google-cloud/common' module could be missing.\n googleCloudGrpcIntegration({ optional: true }), // We mark this integration optional since 'google-gax' module could be missing.\n ];\n}\n\n/**\n * @see {@link Sentry.init}\n */\nexport function init(options: NodeOptions = {}): void {\n const opts = {\n _metadata: {} as SdkMetadata,\n defaultIntegrations: getDefaultIntegrations(options),\n ...options,\n };\n\n opts._metadata.sdk = opts._metadata.sdk || {\n name: 'sentry.javascript.google-cloud-serverless',\n packages: [\n {\n name: 'npm:@sentry/google-cloud-serverless',\n version: SDK_VERSION,\n },\n ],\n version: SDK_VERSION,\n };\n\n initNode(opts);\n}\n"],"names":["getDefaultNodeIntegrations","initNode"],"mappings":";;;;AAOA;AACO,SAAS,sBAAsB,CAAC,OAAO,EAA0B;AACxE,EAAE,OAAO;AACT,IAAI,GAAGA,wBAA0B,CAAC,OAAO,CAAC;AAC1C,IAAI,0BAA0B,CAAC,EAAE,QAAQ,EAAE,IAAA,EAAM,CAAC;AAClD,IAAI,0BAA0B,CAAC,EAAE,QAAQ,EAAE,IAAA,EAAM,CAAC;AAClD,GAAG,CAAA;AACH,CAAA;AACA;AACA;AACA;AACA;AACO,SAAS,IAAI,CAAC,OAAO,GAAgB,EAAE,EAAQ;AACtD,EAAE,MAAM,OAAO;AACf,IAAI,SAAS,EAAE,EAAG;AAClB,IAAI,mBAAmB,EAAE,sBAAsB,CAAC,OAAO,CAAC;AACxD,IAAI,GAAG,OAAO;AACd,GAAG,CAAA;AACH;AACA,EAAE,IAAI,CAAC,SAAS,CAAC,GAAA,GAAM,IAAI,CAAC,SAAS,CAAC,GAAA,IAAO;AAC7C,IAAI,IAAI,EAAE,2CAA2C;AACrD,IAAI,QAAQ,EAAE;AACd,MAAM;AACN,QAAQ,IAAI,EAAE,qCAAqC;AACnD,QAAQ,OAAO,EAAE,WAAW;AAC5B,OAAO;AACP,KAAK;AACL,IAAI,OAAO,EAAE,WAAW;AACxB,GAAG,CAAA;AACH;AACA,EAAEC,MAAQ,CAAC,IAAI,CAAC,CAAA;AAChB;;;;"}
package/esm/utils.js ADDED
@@ -0,0 +1,56 @@
1
+ import { withIsolationScope } from '@sentry/core';
2
+ import { addExceptionMechanism } from '@sentry/utils';
3
+
4
+ /**
5
+ * @param fn function to run
6
+ * @returns function which runs in the newly created domain or in the existing one
7
+ */
8
+ function domainify(fn) {
9
+ return (...args) => withIsolationScope(() => fn(...args));
10
+ }
11
+
12
+ /**
13
+ * @param source function to be wrapped
14
+ * @param wrap wrapping function that takes source and returns a wrapper
15
+ * @param overrides properties to override in the source
16
+ * @returns wrapped function
17
+ */
18
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
19
+ function proxyFunction(
20
+ source,
21
+ wrap,
22
+ overrides,
23
+ ) {
24
+ const wrapper = wrap(source);
25
+ const handler = {
26
+ apply: (_target, thisArg, args) => {
27
+ return wrapper.apply(thisArg, args);
28
+ },
29
+ };
30
+
31
+ if (overrides) {
32
+ handler.get = (target, prop) => {
33
+ if (Object.prototype.hasOwnProperty.call(overrides, prop)) {
34
+ return overrides[prop ];
35
+ }
36
+ return (target )[prop ];
37
+ };
38
+ }
39
+
40
+ return new Proxy(source, handler);
41
+ }
42
+
43
+ /**
44
+ * Marks an event as unhandled by adding a span processor to the passed scope.
45
+ */
46
+ function markEventUnhandled(scope) {
47
+ scope.addEventProcessor(event => {
48
+ addExceptionMechanism(event, { handled: false });
49
+ return event;
50
+ });
51
+
52
+ return scope;
53
+ }
54
+
55
+ export { domainify, markEventUnhandled, proxyFunction };
56
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sources":["../../src/utils.ts"],"sourcesContent":["import { withIsolationScope } from '@sentry/core';\nimport type { Scope } from '@sentry/types';\nimport { addExceptionMechanism } from '@sentry/utils';\n\n/**\n * @param fn function to run\n * @returns function which runs in the newly created domain or in the existing one\n */\nexport function domainify<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R | void {\n return (...args) => withIsolationScope(() => fn(...args));\n}\n\n/**\n * @param source function to be wrapped\n * @param wrap wrapping function that takes source and returns a wrapper\n * @param overrides properties to override in the source\n * @returns wrapped function\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function proxyFunction<A extends any[], R, F extends (...args: A) => R>(\n source: F,\n wrap: (source: F) => F,\n overrides?: Record<PropertyKey, unknown>,\n): F {\n const wrapper = wrap(source);\n const handler: ProxyHandler<F> = {\n apply: <T>(_target: F, thisArg: T, args: A) => {\n return wrapper.apply(thisArg, args);\n },\n };\n\n if (overrides) {\n handler.get = (target, prop) => {\n if (Object.prototype.hasOwnProperty.call(overrides, prop)) {\n return overrides[prop as string];\n }\n return (target as Record<PropertyKey, unknown>)[prop as string];\n };\n }\n\n return new Proxy(source, handler);\n}\n\n/**\n * Marks an event as unhandled by adding a span processor to the passed scope.\n */\nexport function markEventUnhandled(scope: Scope): Scope {\n scope.addEventProcessor(event => {\n addExceptionMechanism(event, { handled: false });\n return event;\n });\n\n return scope;\n}\n"],"names":[],"mappings":";;;AAIA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAyB,EAAE,EAA+C;AACnG,EAAE,OAAO,CAAC,GAAG,IAAI,KAAK,kBAAkB,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAA;AAC3D,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa;AAC7B,EAAE,MAAM;AACR,EAAE,IAAI;AACN,EAAE,SAAS;AACX,EAAK;AACL,EAAE,MAAM,OAAQ,GAAE,IAAI,CAAC,MAAM,CAAC,CAAA;AAC9B,EAAE,MAAM,OAAO,GAAoB;AACnC,IAAI,KAAK,EAAE,CAAI,OAAO,EAAK,OAAO,EAAK,IAAI,KAAQ;AACnD,MAAM,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACzC,KAAK;AACL,GAAG,CAAA;AACH;AACA,EAAE,IAAI,SAAS,EAAE;AACjB,IAAI,OAAO,CAAC,GAAI,GAAE,CAAC,MAAM,EAAE,IAAI,KAAK;AACpC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE;AACjE,QAAQ,OAAO,SAAS,CAAC,IAAA,EAAe,CAAA;AACxC,OAAM;AACN,MAAM,OAAO,CAAC,MAAA,GAAwC,MAAe,CAAA;AACrE,KAAK,CAAA;AACL,GAAE;AACF;AACA,EAAE,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AACnC,CAAA;AACA;AACA;AACA;AACA;AACO,SAAS,kBAAkB,CAAC,KAAK,EAAgB;AACxD,EAAE,KAAK,CAAC,iBAAiB,CAAC,SAAS;AACnC,IAAI,qBAAqB,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,KAAM,EAAC,CAAC,CAAA;AACpD,IAAI,OAAO,KAAK,CAAA;AAChB,GAAG,CAAC,CAAA;AACJ;AACA,EAAE,OAAO,KAAK,CAAA;AACd;;;;"}
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@sentry/google-cloud-serverless",
3
+ "version": "8.0.0-alpha.4",
4
+ "description": "Official Sentry SDK for Google Cloud Functions",
5
+ "repository": "git://github.com/getsentry/sentry-javascript.git",
6
+ "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/google-cloud",
7
+ "author": "Sentry",
8
+ "license": "MIT",
9
+ "engines": {
10
+ "node": ">=14.18"
11
+ },
12
+ "files": [
13
+ "cjs",
14
+ "esm",
15
+ "types",
16
+ "types-ts3.8"
17
+ ],
18
+ "main": "cjs/index.js",
19
+ "types": "types/index.d.ts",
20
+ "exports": {
21
+ "./package.json": "./package.json",
22
+ ".": {
23
+ "require": {
24
+ "types": "./types/index.d.ts",
25
+ "default": "./cjs/index.js"
26
+ }
27
+ }
28
+ },
29
+ "typesVersions": {
30
+ "<4.9": {
31
+ "types/index.d.ts": [
32
+ "types-ts3.8/index.d.ts"
33
+ ]
34
+ }
35
+ },
36
+ "publishConfig": {
37
+ "access": "public"
38
+ },
39
+ "dependencies": {
40
+ "@sentry/core": "8.0.0-alpha.4",
41
+ "@sentry/node": "8.0.0-alpha.4",
42
+ "@sentry/types": "8.0.0-alpha.4",
43
+ "@sentry/utils": "8.0.0-alpha.4",
44
+ "@types/express": "^4.17.14"
45
+ },
46
+ "devDependencies": {
47
+ "@google-cloud/bigquery": "^5.3.0",
48
+ "@google-cloud/common": "^3.4.1",
49
+ "@google-cloud/functions-framework": "^1.7.1",
50
+ "@google-cloud/pubsub": "^2.5.0",
51
+ "@types/node": "^14.6.4",
52
+ "find-up": "^5.0.0",
53
+ "google-gax": "^2.9.0",
54
+ "nock": "^13.0.4",
55
+ "npm-packlist": "^2.1.4"
56
+ },
57
+ "sideEffects": false
58
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.
3
+ *
4
+ * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.
5
+ */
6
+ export declare const DEBUG_BUILD: boolean;
7
+ //# sourceMappingURL=debug-build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-build.d.ts","sourceRoot":"","sources":["../../src/debug-build.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,WAAW,SAAkB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { CloudEventFunction, CloudEventFunctionWithCallback, WrapperOptions } from './general';
2
+ export type CloudEventFunctionWrapperOptions = WrapperOptions;
3
+ /**
4
+ * Wraps an event function handler adding it error capture and tracing capabilities.
5
+ *
6
+ * @param fn Event handler
7
+ * @param options Options
8
+ * @returns Event handler
9
+ */
10
+ export declare function wrapCloudEventFunction(fn: CloudEventFunction | CloudEventFunctionWithCallback, wrapOptions?: Partial<CloudEventFunctionWrapperOptions>): CloudEventFunctionWithCallback;
11
+ //# sourceMappingURL=cloud_events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud_events.d.ts","sourceRoot":"","sources":["../../../src/gcpfunction/cloud_events.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,8BAA8B,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEpG,MAAM,MAAM,gCAAgC,GAAG,cAAc,CAAC;AAE9D;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,EAAE,EAAE,kBAAkB,GAAG,8BAA8B,EACvD,WAAW,GAAE,OAAO,CAAC,gCAAgC,CAAM,GAC1D,8BAA8B,CAEhC"}
@@ -0,0 +1,11 @@
1
+ import type { EventFunction, EventFunctionWithCallback, WrapperOptions } from './general';
2
+ export type EventFunctionWrapperOptions = WrapperOptions;
3
+ /**
4
+ * Wraps an event function handler adding it error capture and tracing capabilities.
5
+ *
6
+ * @param fn Event handler
7
+ * @param options Options
8
+ * @returns Event handler
9
+ */
10
+ export declare function wrapEventFunction(fn: EventFunction | EventFunctionWithCallback, wrapOptions?: Partial<EventFunctionWrapperOptions>): EventFunctionWithCallback;
11
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/gcpfunction/events.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE1F,MAAM,MAAM,2BAA2B,GAAG,cAAc,CAAC;AAEzD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,aAAa,GAAG,yBAAyB,EAC7C,WAAW,GAAE,OAAO,CAAC,2BAA2B,CAAM,GACrD,yBAAyB,CAE3B"}
@@ -0,0 +1,38 @@
1
+ import type { Request, Response } from 'express';
2
+ export interface HttpFunction {
3
+ (req: Request, res: Response): any;
4
+ }
5
+ export interface EventFunction {
6
+ (data: Record<string, any>, context: Context): any;
7
+ }
8
+ export interface EventFunctionWithCallback {
9
+ (data: Record<string, any>, context: Context, callback: Function): any;
10
+ }
11
+ export interface CloudEventFunction {
12
+ (cloudevent: CloudEventsContext): any;
13
+ }
14
+ export interface CloudEventFunctionWithCallback {
15
+ (cloudevent: CloudEventsContext, callback: Function): any;
16
+ }
17
+ export interface CloudFunctionsContext {
18
+ eventId?: string;
19
+ timestamp?: string;
20
+ eventType?: string;
21
+ resource?: string;
22
+ }
23
+ export interface CloudEventsContext {
24
+ [key: string]: any;
25
+ type?: string;
26
+ specversion?: string;
27
+ source?: string;
28
+ id?: string;
29
+ time?: string;
30
+ schemaurl?: string;
31
+ contenttype?: string;
32
+ }
33
+ export type Context = CloudFunctionsContext | CloudEventsContext;
34
+ export interface WrapperOptions {
35
+ flushTimeout: number;
36
+ }
37
+ export type { Request, Response };
38
+ //# sourceMappingURL=general.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../src/gcpfunction/general.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEjD,MAAM,WAAW,YAAY;IAC3B,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,GAAG,CAAC;CACpC;AAED,MAAM,WAAW,aAAa;IAC5B,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,OAAO,GAAG,GAAG,CAAC;CACpD;AAED,MAAM,WAAW,yBAAyB;IACxC,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,GAAG,GAAG,CAAC;CACxE;AAED,MAAM,WAAW,kBAAkB;IACjC,CAAC,UAAU,EAAE,kBAAkB,GAAG,GAAG,CAAC;CACvC;AAED,MAAM,WAAW,8BAA8B;IAC7C,CAAC,UAAU,EAAE,kBAAkB,EAAE,QAAQ,EAAE,QAAQ,GAAG,GAAG,CAAC;CAC3D;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,OAAO,GAAG,qBAAqB,GAAG,kBAAkB,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { HttpFunction, WrapperOptions } from './general';
2
+ /**
3
+ * Wraps an HTTP function handler adding it error capture and tracing capabilities.
4
+ *
5
+ * @param fn HTTP Handler
6
+ * @param options Options
7
+ * @returns HTTP handler
8
+ */
9
+ export declare function wrapHttpFunction(fn: HttpFunction, wrapOptions?: Partial<WrapperOptions>): HttpFunction;
10
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/gcpfunction/http.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE9D;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,YAAY,EAAE,WAAW,GAAE,OAAO,CAAC,cAAc,CAAM,GAAG,YAAY,CAa1G"}
@@ -0,0 +1,9 @@
1
+ export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureMessage, captureCheckIn, startSession, captureSession, endSession, withMonitor, createTransport, getCurrentHub, getClient, isInitialized, getCurrentScope, getGlobalScope, getIsolationScope, Hub, setCurrentClient, Scope, SDK_VERSION, setContext, setExtra, setExtras, setTag, setTags, setUser, getSpanStatusFromHttpCode, setHttpStatus, withScope, withIsolationScope, makeNodeTransport, NodeClient, defaultStackParser, flush, close, getSentryRelease, addRequestDataToEvent, DEFAULT_USER_INCLUDES, extractRequestData, createGetModuleFromFilename, anrIntegration, consoleIntegration, httpIntegration, nativeNodeFetchIntegration, onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, modulesIntegration, contextLinesIntegration, nodeContextIntegration, localVariablesIntegration, requestDataIntegration, functionToStringIntegration, inboundFiltersIntegration, linkedErrorsIntegration, setMeasurement, getActiveSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, getRootSpan, getSpanDescendants, continueTrace, getAutoPerformanceIntegrations, cron, metrics, parameterize, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, expressIntegration, expressErrorHandler, setupExpressErrorHandler, fastifyIntegration, graphqlIntegration, mongoIntegration, mongooseIntegration, mysqlIntegration, mysql2Integration, nestIntegration, postgresIntegration, prismaIntegration, hapiIntegration, setupHapiErrorHandler, spotlightIntegration, } from '@sentry/node';
2
+ export { captureConsoleIntegration, debugIntegration, dedupeIntegration, extraErrorDataIntegration, rewriteFramesIntegration, sessionTimingIntegration, } from '@sentry/core';
3
+ export { getDefaultIntegrations, init } from './sdk';
4
+ export { googleCloudHttpIntegration } from './integrations/google-cloud-http';
5
+ export { googleCloudGrpcIntegration } from './integrations/google-cloud-grpc';
6
+ export { wrapCloudEventFunction } from './gcpfunction/cloud_events';
7
+ export { wrapHttpFunction } from './gcpfunction/http';
8
+ export { wrapEventFunction } from './gcpfunction/events';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,YAAY,EACZ,cAAc,EACd,UAAU,EACV,WAAW,EACX,eAAe,EAEf,aAAa,EACb,SAAS,EACT,aAAa,EACb,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,GAAG,EACH,gBAAgB,EA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BAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Google Cloud Platform service requests tracking for GRPC APIs.
3
+ */
4
+ export declare const googleCloudGrpcIntegration: (options?: {
5
+ optional?: boolean | undefined;
6
+ } | undefined) => import("@sentry/types").IntegrationFnResult;
7
+ //# sourceMappingURL=google-cloud-grpc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google-cloud-grpc.d.ts","sourceRoot":"","sources":["../../../src/integrations/google-cloud-grpc.ts"],"names":[],"mappings":"AA2DA;;GAEG;AACH,eAAO,MAAM,0BAA0B;;6DAAiD,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Google Cloud Platform service requests tracking for RESTful APIs.
3
+ */
4
+ export declare const googleCloudHttpIntegration: (options?: {
5
+ optional?: boolean | undefined;
6
+ } | undefined) => import("@sentry/types").IntegrationFnResult;
7
+ //# sourceMappingURL=google-cloud-http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"google-cloud-http.d.ts","sourceRoot":"","sources":["../../../src/integrations/google-cloud-http.ts"],"names":[],"mappings":"AAsCA;;GAEG;AACH,eAAO,MAAM,0BAA0B;;6DAAiD,CAAC"}
package/types/sdk.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ import type { NodeOptions } from '@sentry/node';
2
+ import type { Integration, Options } from '@sentry/types';
3
+ /** Get the default integrations for the GCP SDK. */
4
+ export declare function getDefaultIntegrations(options: Options): Integration[];
5
+ /**
6
+ * @see {@link Sentry.init}
7
+ */
8
+ export declare function init(options?: NodeOptions): void;
9
+ //# sourceMappingURL=sdk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAe,MAAM,eAAe,CAAC;AAKvE,oDAAoD;AACpD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,EAAE,CAMtE;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,GAAE,WAAgB,GAAG,IAAI,CAmBpD"}
@@ -0,0 +1,18 @@
1
+ import type { Scope } from '@sentry/types';
2
+ /**
3
+ * @param fn function to run
4
+ * @returns function which runs in the newly created domain or in the existing one
5
+ */
6
+ export declare function domainify<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R | void;
7
+ /**
8
+ * @param source function to be wrapped
9
+ * @param wrap wrapping function that takes source and returns a wrapper
10
+ * @param overrides properties to override in the source
11
+ * @returns wrapped function
12
+ */
13
+ export declare function proxyFunction<A extends any[], R, F extends (...args: A) => R>(source: F, wrap: (source: F) => F, overrides?: Record<PropertyKey, unknown>): F;
14
+ /**
15
+ * Marks an event as unhandled by adding a span processor to the passed scope.
16
+ */
17
+ export declare function markEventUnhandled(scope: Scope): Scope;
18
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG3C;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,OAAO,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,IAAI,CAEjG;AAED;;;;;GAKG;AAEH,wBAAgB,aAAa,CAAC,CAAC,SAAS,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,EAC3E,MAAM,EAAE,CAAC,EACT,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EACtB,SAAS,CAAC,EAAE,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,GACvC,CAAC,CAkBH;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAOtD"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.
3
+ *
4
+ * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.
5
+ */
6
+ export declare const DEBUG_BUILD: boolean;
7
+ //# sourceMappingURL=debug-build.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { CloudEventFunction, CloudEventFunctionWithCallback, WrapperOptions } from './general';
2
+ export type CloudEventFunctionWrapperOptions = WrapperOptions;
3
+ /**
4
+ * Wraps an event function handler adding it error capture and tracing capabilities.
5
+ *
6
+ * @param fn Event handler
7
+ * @param options Options
8
+ * @returns Event handler
9
+ */
10
+ export declare function wrapCloudEventFunction(fn: CloudEventFunction | CloudEventFunctionWithCallback, wrapOptions?: Partial<CloudEventFunctionWrapperOptions>): CloudEventFunctionWithCallback;
11
+ //# sourceMappingURL=cloud_events.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { EventFunction, EventFunctionWithCallback, WrapperOptions } from './general';
2
+ export type EventFunctionWrapperOptions = WrapperOptions;
3
+ /**
4
+ * Wraps an event function handler adding it error capture and tracing capabilities.
5
+ *
6
+ * @param fn Event handler
7
+ * @param options Options
8
+ * @returns Event handler
9
+ */
10
+ export declare function wrapEventFunction(fn: EventFunction | EventFunctionWithCallback, wrapOptions?: Partial<EventFunctionWrapperOptions>): EventFunctionWithCallback;
11
+ //# sourceMappingURL=events.d.ts.map