alchemy 0.16.5 → 0.16.6

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.
@@ -0,0 +1,50 @@
1
+ import type { Secret } from "../secret.js";
2
+ /**
3
+ * Options for Sentry API requests
4
+ */
5
+ export interface SentryApiOptions {
6
+ /**
7
+ * Auth token to use (overrides environment variable)
8
+ */
9
+ authToken?: Secret;
10
+ }
11
+ /**
12
+ * Minimal API client using raw fetch
13
+ */
14
+ export declare class SentryApi {
15
+ /** Base URL for API */
16
+ readonly baseUrl: string;
17
+ /** Auth token */
18
+ readonly authToken: Secret;
19
+ /**
20
+ * Create a new API client
21
+ *
22
+ * @param options API options
23
+ */
24
+ constructor(options?: SentryApiOptions);
25
+ /**
26
+ * Make a request to the API
27
+ *
28
+ * @param path API path (without base URL)
29
+ * @param init Fetch init options
30
+ * @returns Raw Response object from fetch
31
+ */
32
+ fetch(path: string, init?: RequestInit): Promise<Response>;
33
+ /**
34
+ * Helper for GET requests
35
+ */
36
+ get(path: string, init?: RequestInit): Promise<Response>;
37
+ /**
38
+ * Helper for POST requests
39
+ */
40
+ post(path: string, body: any, init?: RequestInit): Promise<Response>;
41
+ /**
42
+ * Helper for PUT requests
43
+ */
44
+ put(path: string, body: any, init?: RequestInit): Promise<Response>;
45
+ /**
46
+ * Helper for DELETE requests
47
+ */
48
+ delete(path: string, init?: RequestInit): Promise<Response>;
49
+ }
50
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/sentry/api.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,qBAAa,SAAS;IACpB,uBAAuB;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,iBAAiB;IACjB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B;;;;OAIG;gBACS,OAAO,GAAE,gBAAqB;IAU1C;;;;;;OAMG;IACG,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAuBpE;;OAEG;IACG,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC;IAIlE;;OAEG;IACG,IAAI,CACR,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,GAAG,EACT,IAAI,GAAE,WAAgB,GACrB,OAAO,CAAC,QAAQ,CAAC;IAKpB;;OAEG;IACG,GAAG,CACP,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,GAAG,EACT,IAAI,GAAE,WAAgB,GACrB,OAAO,CAAC,QAAQ,CAAC;IAKpB;;OAEG;IACG,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC;CAGtE"}
@@ -0,0 +1,76 @@
1
+ import { alchemy } from "../alchemy.js";
2
+ /**
3
+ * Minimal API client using raw fetch
4
+ */
5
+ export class SentryApi {
6
+ /** Base URL for API */
7
+ baseUrl;
8
+ /** Auth token */
9
+ authToken;
10
+ /**
11
+ * Create a new API client
12
+ *
13
+ * @param options API options
14
+ */
15
+ constructor(options = {}) {
16
+ this.baseUrl = "https://sentry.io/api/0";
17
+ this.authToken =
18
+ options.authToken ?? alchemy.secret(process.env.SENTRY_AUTH_TOKEN || "");
19
+ if (!this.authToken.unencrypted) {
20
+ throw new Error("SENTRY_AUTH_TOKEN environment variable is required");
21
+ }
22
+ }
23
+ /**
24
+ * Make a request to the API
25
+ *
26
+ * @param path API path (without base URL)
27
+ * @param init Fetch init options
28
+ * @returns Raw Response object from fetch
29
+ */
30
+ async fetch(path, init = {}) {
31
+ const headers = {
32
+ "Content-Type": "application/json",
33
+ Authorization: `Bearer ${this.authToken.unencrypted}`,
34
+ };
35
+ if (init.headers) {
36
+ const initHeaders = init.headers;
37
+ Object.keys(initHeaders).forEach((key) => {
38
+ headers[key] = initHeaders[key];
39
+ });
40
+ }
41
+ if (init.body instanceof FormData) {
42
+ delete headers["Content-Type"];
43
+ }
44
+ return fetch(`${this.baseUrl}${path}`, {
45
+ ...init,
46
+ headers,
47
+ });
48
+ }
49
+ /**
50
+ * Helper for GET requests
51
+ */
52
+ async get(path, init = {}) {
53
+ return this.fetch(path, { ...init, method: "GET" });
54
+ }
55
+ /**
56
+ * Helper for POST requests
57
+ */
58
+ async post(path, body, init = {}) {
59
+ const requestBody = body instanceof FormData ? body : JSON.stringify(body);
60
+ return this.fetch(path, { ...init, method: "POST", body: requestBody });
61
+ }
62
+ /**
63
+ * Helper for PUT requests
64
+ */
65
+ async put(path, body, init = {}) {
66
+ const requestBody = body instanceof FormData ? body : JSON.stringify(body);
67
+ return this.fetch(path, { ...init, method: "PUT", body: requestBody });
68
+ }
69
+ /**
70
+ * Helper for DELETE requests
71
+ */
72
+ async delete(path, init = {}) {
73
+ return this.fetch(path, { ...init, method: "DELETE" });
74
+ }
75
+ }
76
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/sentry/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAaxC;;GAEG;AACH,MAAM,OAAO,SAAS;IACpB,uBAAuB;IACd,OAAO,CAAS;IAEzB,iBAAiB;IACR,SAAS,CAAS;IAE3B;;;;OAIG;IACH,YAAY,UAA4B,EAAE;QACxC,IAAI,CAAC,OAAO,GAAG,yBAAyB,CAAC;QACzC,IAAI,CAAC,SAAS;YACZ,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,EAAE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,IAAI,CAAC,CAAC;QAC3E,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;IAC1E,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,GAAG,CACP,IAAY,EACZ,IAAS,EACT,OAAoB,EAAE;QAEtB,MAAM,WAAW,GAAG,IAAI,YAAY,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QAC3E,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,IAAY,EAAE,OAAoB,EAAE;QAC/C,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IACzD,CAAC;CACF"}
@@ -0,0 +1,156 @@
1
+ import type { Context } from "../context.js";
2
+ import { Resource } from "../resource.js";
3
+ import type { Secret } from "../secret.js";
4
+ /**
5
+ * Properties for creating or updating a ClientKey
6
+ */
7
+ export interface ClientKeyProps {
8
+ /**
9
+ * The name of the key
10
+ */
11
+ name?: string;
12
+ /**
13
+ * Rate limit configuration
14
+ */
15
+ rateLimit?: {
16
+ /**
17
+ * Time window in seconds
18
+ */
19
+ window: number;
20
+ /**
21
+ * Maximum number of events allowed in the window
22
+ */
23
+ count: number;
24
+ };
25
+ /**
26
+ * The use case for the key
27
+ */
28
+ useCase?: "user" | "profiling" | "escalating_issues" | "tempest" | "demo";
29
+ /**
30
+ * The project slug that owns the key
31
+ */
32
+ project: string;
33
+ /**
34
+ * The organization ID or slug that owns the key
35
+ */
36
+ organization: string;
37
+ /**
38
+ * Auth token to use (overrides environment variable)
39
+ */
40
+ authToken?: Secret;
41
+ /**
42
+ * Whether to adopt an existing key with the same name if it exists
43
+ * If true and a key with the same name exists, it will be adopted rather than creating a new one
44
+ *
45
+ * @default false
46
+ */
47
+ adopt?: boolean;
48
+ }
49
+ /**
50
+ * Output returned after ClientKey creation/update
51
+ */
52
+ export interface ClientKey extends Resource<"sentry::ClientKey">, ClientKeyProps {
53
+ /**
54
+ * The ID of the key
55
+ */
56
+ id: string;
57
+ /**
58
+ * The label of the key
59
+ */
60
+ label: string;
61
+ /**
62
+ * The public key
63
+ */
64
+ public: string;
65
+ /**
66
+ * The secret key
67
+ */
68
+ secret: string;
69
+ /**
70
+ * The project ID
71
+ */
72
+ projectId: number;
73
+ /**
74
+ * Whether the key is active
75
+ */
76
+ isActive: boolean;
77
+ /**
78
+ * DSN configuration
79
+ */
80
+ dsn: {
81
+ secret: string;
82
+ public: string;
83
+ csp: string;
84
+ security: string;
85
+ minidump: string;
86
+ nel: string;
87
+ unreal: string;
88
+ cdn: string;
89
+ crons: string;
90
+ };
91
+ /**
92
+ * Browser SDK version
93
+ */
94
+ browserSdkVersion: string;
95
+ /**
96
+ * Browser SDK choices
97
+ */
98
+ browserSdk: {
99
+ choices: Array<[string, string]>;
100
+ };
101
+ /**
102
+ * Time at which the key was created
103
+ */
104
+ dateCreated: string;
105
+ /**
106
+ * Dynamic SDK loader options
107
+ */
108
+ dynamicSdkLoaderOptions: {
109
+ hasReplay: boolean;
110
+ hasPerformance: boolean;
111
+ hasDebug: boolean;
112
+ };
113
+ }
114
+ /**
115
+ * Create and manage Sentry client keys
116
+ *
117
+ * @example
118
+ * // Create a basic Sentry client key:
119
+ * const key = await ClientKey("my-key", {
120
+ * name: "My Key",
121
+ * project: "my-project",
122
+ * organization: "my-org"
123
+ * });
124
+ *
125
+ * @example
126
+ * // Create a client key with rate limiting:
127
+ * const key = await ClientKey("rate-limited-key", {
128
+ * name: "Rate Limited Key",
129
+ * project: "my-project",
130
+ * organization: "my-org",
131
+ * rateLimit: {
132
+ * window: 3600, // 1 hour
133
+ * count: 1000 // 1000 events per hour
134
+ * }
135
+ * });
136
+ *
137
+ * @example
138
+ * // Create a client key for a specific use case:
139
+ * const key = await ClientKey("profiling-key", {
140
+ * name: "Profiling Key",
141
+ * project: "my-project",
142
+ * organization: "my-org",
143
+ * useCase: "profiling"
144
+ * });
145
+ *
146
+ * @example
147
+ * // Create or adopt an existing key with the same name:
148
+ * const key = await ClientKey("existing-key", {
149
+ * name: "Existing Key",
150
+ * project: "my-project",
151
+ * organization: "my-org",
152
+ * adopt: true
153
+ * });
154
+ */
155
+ export declare const ClientKey: (((this: any, id: string, props?: {}) => never) & (new (_: never) => never)) | ((this: Context<ClientKey>, id: string, props: ClientKeyProps) => Promise<ClientKey>);
156
+ //# sourceMappingURL=client-key.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-key.d.ts","sourceRoot":"","sources":["../../src/sentry/client-key.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,CAAC,EAAE;QACV;;WAEG;QACH,MAAM,EAAE,MAAM,CAAC;QAEf;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IAEF;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,mBAAmB,GAAG,SAAS,GAAG,MAAM,CAAC;IAE1E;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;I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-0,0 +1,126 @@
1
+ import { Resource } from "../resource.js";
2
+ import { SentryApi } from "./api.js";
3
+ /**
4
+ * Create and manage Sentry client keys
5
+ *
6
+ * @example
7
+ * // Create a basic Sentry client key:
8
+ * const key = await ClientKey("my-key", {
9
+ * name: "My Key",
10
+ * project: "my-project",
11
+ * organization: "my-org"
12
+ * });
13
+ *
14
+ * @example
15
+ * // Create a client key with rate limiting:
16
+ * const key = await ClientKey("rate-limited-key", {
17
+ * name: "Rate Limited Key",
18
+ * project: "my-project",
19
+ * organization: "my-org",
20
+ * rateLimit: {
21
+ * window: 3600, // 1 hour
22
+ * count: 1000 // 1000 events per hour
23
+ * }
24
+ * });
25
+ *
26
+ * @example
27
+ * // Create a client key for a specific use case:
28
+ * const key = await ClientKey("profiling-key", {
29
+ * name: "Profiling Key",
30
+ * project: "my-project",
31
+ * organization: "my-org",
32
+ * useCase: "profiling"
33
+ * });
34
+ *
35
+ * @example
36
+ * // Create or adopt an existing key with the same name:
37
+ * const key = await ClientKey("existing-key", {
38
+ * name: "Existing Key",
39
+ * project: "my-project",
40
+ * organization: "my-org",
41
+ * adopt: true
42
+ * });
43
+ */
44
+ export const ClientKey = Resource("sentry::ClientKey", async function (id, props) {
45
+ const api = new SentryApi({ authToken: props.authToken });
46
+ if (this.phase === "delete") {
47
+ try {
48
+ if (this.output?.id) {
49
+ const response = await api.delete(`/projects/${props.organization}/${props.project}/keys/${this.output.id}/`);
50
+ if (!response.ok && response.status !== 404) {
51
+ console.error("Error deleting client key:", response.statusText);
52
+ }
53
+ }
54
+ }
55
+ catch (error) {
56
+ console.error("Error deleting client key:", error);
57
+ }
58
+ return this.destroy();
59
+ }
60
+ else {
61
+ try {
62
+ let response;
63
+ if (this.phase === "update" && this.output?.id) {
64
+ response = await api.put(`/projects/${props.organization}/${props.project}/keys/${this.output.id}/`, props);
65
+ }
66
+ else {
67
+ try {
68
+ response = await api.post(`/projects/${props.organization}/${props.project}/keys/`, props);
69
+ }
70
+ catch (error) {
71
+ // Check if this is a "key already exists" error and adopt is enabled
72
+ if (props.adopt &&
73
+ error instanceof Error &&
74
+ error.message.includes("already exists") &&
75
+ props.name) {
76
+ console.log(`Client key '${props.name}' already exists, adopting it`);
77
+ // Find the existing key by name
78
+ const existingKey = await findClientKeyByName(api, props.organization, props.project, props.name);
79
+ if (!existingKey) {
80
+ throw new Error(`Failed to find existing client key '${props.name}' for adoption`);
81
+ }
82
+ response = await api.get(`/projects/${props.organization}/${props.project}/keys/${existingKey.id}/`);
83
+ }
84
+ else {
85
+ throw error;
86
+ }
87
+ }
88
+ }
89
+ if (!response.ok) {
90
+ throw new Error(`API error: ${response.statusText}`);
91
+ }
92
+ const data = (await response.json());
93
+ return this({
94
+ ...props,
95
+ id: data.id,
96
+ label: data.label,
97
+ public: data.public,
98
+ secret: data.secret,
99
+ projectId: data.projectId,
100
+ isActive: data.isActive,
101
+ dsn: data.dsn,
102
+ browserSdkVersion: data.browserSdkVersion,
103
+ browserSdk: data.browserSdk,
104
+ dateCreated: data.dateCreated,
105
+ dynamicSdkLoaderOptions: data.dynamicSdkLoaderOptions,
106
+ });
107
+ }
108
+ catch (error) {
109
+ console.error("Error creating/updating client key:", error);
110
+ throw error;
111
+ }
112
+ }
113
+ });
114
+ /**
115
+ * Find a client key by name
116
+ */
117
+ async function findClientKeyByName(api, organization, project, name) {
118
+ const response = await api.get(`/projects/${organization}/${project}/keys/`);
119
+ if (!response.ok) {
120
+ throw new Error(`API error: ${response.statusText}`);
121
+ }
122
+ const keys = (await response.json());
123
+ const key = keys.find((k) => k.name === name);
124
+ return key ? { id: key.id } : null;
125
+ }
126
+ //# sourceMappingURL=client-key.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-key.js","sourceRoot":"","sources":["../../src/sentry/client-key.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAqIrC;;;;;;;;;;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
3
+ export * from "./project.js";
4
+ export * from "./team.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sentry/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from "./api.js";
2
+ export * from "./client-key.js";
3
+ export * from "./project.js";
4
+ export * from "./team.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sentry/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
@@ -0,0 +1,235 @@
1
+ import type { Context } from "../context.js";
2
+ import { Resource } from "../resource.js";
3
+ import type { Secret } from "../secret.js";
4
+ /**
5
+ * Properties for creating or updating a Project
6
+ */
7
+ export interface ProjectProps {
8
+ /**
9
+ * The name for the project
10
+ */
11
+ name: string;
12
+ /**
13
+ * Uniquely identifies a project and is used for the interface
14
+ */
15
+ slug?: string;
16
+ /**
17
+ * The platform for the project
18
+ */
19
+ platform?: string;
20
+ /**
21
+ * Whether to alert on every new issue
22
+ */
23
+ defaultRules?: boolean;
24
+ /**
25
+ * The team slug that owns the project
26
+ */
27
+ team: string;
28
+ /**
29
+ * The organization ID or slug that owns the project
30
+ */
31
+ organization: string;
32
+ /**
33
+ * Auth token to use (overrides environment variable)
34
+ */
35
+ authToken?: Secret;
36
+ /**
37
+ * Whether to adopt an existing project with the same slug if it exists
38
+ * If true and a project with the same slug exists, it will be adopted rather than creating a new one
39
+ *
40
+ * @default false
41
+ */
42
+ adopt?: boolean;
43
+ }
44
+ /**
45
+ * Output returned after Project creation/update
46
+ */
47
+ export interface Project extends Omit<Resource<"sentry::Project">, "team">, Omit<ProjectProps, "team"> {
48
+ /**
49
+ * The ID of the project
50
+ */
51
+ id: string;
52
+ /**
53
+ * The team that owns the project
54
+ */
55
+ team: {
56
+ id: string;
57
+ name: string;
58
+ slug: string;
59
+ };
60
+ /**
61
+ * All teams that have access to the project
62
+ */
63
+ teams: Array<{
64
+ id: string;
65
+ name: string;
66
+ slug: string;
67
+ }>;
68
+ /**
69
+ * Whether the project is bookmarked
70
+ */
71
+ isBookmarked: boolean;
72
+ /**
73
+ * Whether the current user is a member of the project
74
+ */
75
+ isMember: boolean;
76
+ /**
77
+ * Access permissions for the project
78
+ */
79
+ access: string[];
80
+ /**
81
+ * Whether the current user has access to the project
82
+ */
83
+ hasAccess: boolean;
84
+ /**
85
+ * Time at which the project was created
86
+ */
87
+ dateCreated: string;
88
+ /**
89
+ * List of environments in the project
90
+ */
91
+ environments: string[];
92
+ /**
93
+ * Event processing status
94
+ */
95
+ eventProcessing: {
96
+ symbolicationDegraded: boolean;
97
+ };
98
+ /**
99
+ * List of features enabled for the project
100
+ */
101
+ features: string[];
102
+ /**
103
+ * Whether the project has received its first event
104
+ */
105
+ firstEvent: string | null;
106
+ /**
107
+ * Whether the project has received its first transaction event
108
+ */
109
+ firstTransactionEvent: boolean;
110
+ /**
111
+ * Whether the project has sessions
112
+ */
113
+ hasSessions: boolean;
114
+ /**
115
+ * Whether the project has profiles
116
+ */
117
+ hasProfiles: boolean;
118
+ /**
119
+ * Whether the project has replays
120
+ */
121
+ hasReplays: boolean;
122
+ /**
123
+ * Whether the project has flags
124
+ */
125
+ hasFlags: boolean;
126
+ /**
127
+ * Whether the project has monitors
128
+ */
129
+ hasMonitors: boolean;
130
+ /**
131
+ * Whether the project has feedback
132
+ */
133
+ hasFeedbacks: boolean;
134
+ /**
135
+ * Whether the project has new feedback
136
+ */
137
+ hasNewFeedbacks: boolean;
138
+ /**
139
+ * Whether the project has minified stack traces
140
+ */
141
+ hasMinifiedStackTrace: boolean;
142
+ /**
143
+ * Whether the project has HTTP insights
144
+ */
145
+ hasInsightsHttp: boolean;
146
+ /**
147
+ * Whether the project has database insights
148
+ */
149
+ hasInsightsDb: boolean;
150
+ /**
151
+ * Whether the project has asset insights
152
+ */
153
+ hasInsightsAssets: boolean;
154
+ /**
155
+ * Whether the project has app start insights
156
+ */
157
+ hasInsightsAppStart: boolean;
158
+ /**
159
+ * Whether the project has screen load insights
160
+ */
161
+ hasInsightsScreenLoad: boolean;
162
+ /**
163
+ * Whether the project has vitals insights
164
+ */
165
+ hasInsightsVitals: boolean;
166
+ /**
167
+ * Whether the project has cache insights
168
+ */
169
+ hasInsightsCaches: boolean;
170
+ /**
171
+ * Whether the project has queue insights
172
+ */
173
+ hasInsightsQueues: boolean;
174
+ /**
175
+ * Whether the project has LLM monitoring
176
+ */
177
+ hasInsightsLlmMonitoring: boolean;
178
+ /**
179
+ * List of platforms in the project
180
+ */
181
+ platforms: string[];
182
+ /**
183
+ * Latest release information
184
+ */
185
+ latestRelease: string | null;
186
+ /**
187
+ * Whether the project has user reports
188
+ */
189
+ hasUserReports: boolean;
190
+ /**
191
+ * Latest deployment information
192
+ */
193
+ latestDeploys: string | null;
194
+ }
195
+ /**
196
+ * Create and manage Sentry projects
197
+ *
198
+ * @example
199
+ * // Create a basic Sentry project:
200
+ * const project = await Project("my-project", {
201
+ * name: "My Project",
202
+ * team: "my-team",
203
+ * organization: "my-org"
204
+ * });
205
+ *
206
+ * @example
207
+ * // Create a project for a specific platform:
208
+ * const project = await Project("js-project", {
209
+ * name: "JavaScript Project",
210
+ * team: "my-team",
211
+ * organization: "my-org",
212
+ * platform: "javascript"
213
+ * });
214
+ *
215
+ * @example
216
+ * // Create a project with a custom slug and disabled default rules:
217
+ * const project = await Project("custom-project", {
218
+ * name: "Custom Project",
219
+ * team: "my-team",
220
+ * organization: "my-org",
221
+ * slug: "custom-project-slug",
222
+ * defaultRules: false
223
+ * });
224
+ *
225
+ * @example
226
+ * // Create or adopt an existing project with the same slug:
227
+ * const project = await Project("existing-project", {
228
+ * name: "Existing Project",
229
+ * team: "my-team",
230
+ * organization: "my-org",
231
+ * adopt: true
232
+ * });
233
+ */
234
+ export declare const Project: (((this: any, id: string, props?: {}) => never) & (new (_: never) => never)) | ((this: Context<Project>, id: string, props: ProjectProps) => Promise<Project>);
235
+ //# sourceMappingURL=project.d.ts.map