@superdurable/connector-sentry 0.0.0-stage → 0.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/LICENSE +21 -0
- package/README.md +8 -2
- package/dex-connector.json +120 -0
- package/dist/chunk-I2K5L2H5.js +170 -0
- package/dist/connection-Cvf7BnFm.d.ts +121 -0
- package/dist/index.d.ts +216 -0
- package/dist/index.js +390 -0
- package/dist/mock.d.ts +73 -0
- package/dist/mock.js +169 -0
- package/package.json +61 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Super Durable
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Sentry TypeScript connector
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Install `@superdurable/connector-sentry` to use Sentry issue operations in Dex TypeScript Flows. The package implements `listIssues`, `getIssue`, and `updateIssueStatus`; the manifest's Go connector version remains independent of this package's `v0.1.0` release.
|
|
4
|
+
|
|
5
|
+
`SentryClient` accepts generated `Config` and a live `CredentialProvider<Credentials>`. It resolves the secret at invocation time and sends it only in the Authorization header. `newProjectConnection` reads a named connection and its `api_key` from the Dex project. Project `timeout` accepts a positive Go duration string such as `45s` or a nanosecond count and controls each provider request timeout. `newListIssuesStep`, `newGetIssueStep`, and `newUpdateIssueStatusStep` are the generated operation factories. `./mock` exports scripted operations.
|
|
6
|
+
|
|
7
|
+
The runnable [issue-review example](examples/issue-review/README.md) lists one organization issue page through a Dex Worker. The issue search query is provider syntax; the example sends no credentials in Flow input. The status mutation uses an absolute PUT and a stable Call ID key. Local invalid input or unavailable credentials select `defect`; 408, 429, 5xx, and transport failures retry. Definite provider rejection, missing detail resources, and malformed successful responses select their manifest branches.
|
|
8
|
+
|
|
9
|
+
`npm run check` runs the package suite, typecheck, and lint. `npm run test:integration` requires a local `dexcli dev` address in `DEX_FLOW_SERVICE_ADDRESS` and exercises the example against a local HTTP fixture through a real Dex Worker. Go-recorded scenarios in `conformance/connectors/sentry/scenarios.json` are replayed by the TypeScript suite. Real Sentry authorization, API responses, and Dex Web Connections fields remain unverified.
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
{
|
|
2
|
+
"connectorId": "sentry",
|
|
3
|
+
"releaseTag": "connectors/sentry/go/v0.2.0",
|
|
4
|
+
"package": {
|
|
5
|
+
"ecosystem": "npm",
|
|
6
|
+
"name": "@superdurable/connector-sentry",
|
|
7
|
+
"version": "0.1.0"
|
|
8
|
+
},
|
|
9
|
+
"factories": [
|
|
10
|
+
{
|
|
11
|
+
"name": "newListIssuesStep",
|
|
12
|
+
"kind": "query",
|
|
13
|
+
"operationId": "listIssues",
|
|
14
|
+
"fields": {
|
|
15
|
+
"stepType": "stepType",
|
|
16
|
+
"annotations": "annotations",
|
|
17
|
+
"connectionName": "connectionName",
|
|
18
|
+
"resultAttribute": "resultAttribute"
|
|
19
|
+
},
|
|
20
|
+
"branches": [
|
|
21
|
+
{
|
|
22
|
+
"id": "listed",
|
|
23
|
+
"field": "listed",
|
|
24
|
+
"optional": false
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "providerRejected",
|
|
28
|
+
"field": "providerRejected",
|
|
29
|
+
"optional": true
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"id": "invalidResponse",
|
|
33
|
+
"field": "invalidResponse",
|
|
34
|
+
"optional": true
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "defect",
|
|
38
|
+
"field": "defect",
|
|
39
|
+
"optional": true
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "newGetIssueStep",
|
|
45
|
+
"kind": "query",
|
|
46
|
+
"operationId": "getIssue",
|
|
47
|
+
"fields": {
|
|
48
|
+
"stepType": "stepType",
|
|
49
|
+
"annotations": "annotations",
|
|
50
|
+
"connectionName": "connectionName",
|
|
51
|
+
"resultAttribute": "resultAttribute"
|
|
52
|
+
},
|
|
53
|
+
"branches": [
|
|
54
|
+
{
|
|
55
|
+
"id": "found",
|
|
56
|
+
"field": "found",
|
|
57
|
+
"optional": false
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "notFound",
|
|
61
|
+
"field": "notFound",
|
|
62
|
+
"optional": true
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"id": "providerRejected",
|
|
66
|
+
"field": "providerRejected",
|
|
67
|
+
"optional": true
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"id": "invalidResponse",
|
|
71
|
+
"field": "invalidResponse",
|
|
72
|
+
"optional": true
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"id": "defect",
|
|
76
|
+
"field": "defect",
|
|
77
|
+
"optional": true
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"name": "newUpdateIssueStatusStep",
|
|
83
|
+
"kind": "mutation",
|
|
84
|
+
"operationId": "updateIssueStatus",
|
|
85
|
+
"fields": {
|
|
86
|
+
"stepType": "stepType",
|
|
87
|
+
"annotations": "annotations",
|
|
88
|
+
"connectionName": "connectionName",
|
|
89
|
+
"resultAttribute": "resultAttribute"
|
|
90
|
+
},
|
|
91
|
+
"branches": [
|
|
92
|
+
{
|
|
93
|
+
"id": "updated",
|
|
94
|
+
"field": "updated",
|
|
95
|
+
"optional": false
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"id": "notFound",
|
|
99
|
+
"field": "notFound",
|
|
100
|
+
"optional": true
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"id": "providerRejected",
|
|
104
|
+
"field": "providerRejected",
|
|
105
|
+
"optional": true
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"id": "invalidResponse",
|
|
109
|
+
"field": "invalidResponse",
|
|
110
|
+
"optional": true
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"id": "defect",
|
|
114
|
+
"field": "defect",
|
|
115
|
+
"optional": true
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
// src/generated/models.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var ConfigSchema = z.object({
|
|
4
|
+
"baseUrl": z.string().optional(),
|
|
5
|
+
"timeoutMs": z.number().int().optional(),
|
|
6
|
+
"maxResponseBytes": z.number().int().optional()
|
|
7
|
+
});
|
|
8
|
+
var ListIssuesInputSchema = z.strictObject({
|
|
9
|
+
"organization": z.string(),
|
|
10
|
+
"query": z.string()
|
|
11
|
+
});
|
|
12
|
+
var IssueSchema = z.strictObject({
|
|
13
|
+
"id": z.string(),
|
|
14
|
+
"shortId": z.string(),
|
|
15
|
+
"title": z.string(),
|
|
16
|
+
"status": z.string()
|
|
17
|
+
});
|
|
18
|
+
var IssuePageSchema = z.strictObject({
|
|
19
|
+
"issues": z.array(IssueSchema).nullable()
|
|
20
|
+
});
|
|
21
|
+
var GetIssueInputSchema = z.strictObject({
|
|
22
|
+
"organization": z.string(),
|
|
23
|
+
"id": z.string()
|
|
24
|
+
});
|
|
25
|
+
var UpdateIssueStatusInputSchema = z.strictObject({
|
|
26
|
+
"organization": z.string(),
|
|
27
|
+
"id": z.string(),
|
|
28
|
+
"status": z.string()
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// src/generated/definitions.ts
|
|
32
|
+
var ConnectorID = "sentry";
|
|
33
|
+
var ProviderID = "sentry";
|
|
34
|
+
var ListIssuesBranch = {
|
|
35
|
+
Listed: "listed",
|
|
36
|
+
ProviderRejected: "providerRejected",
|
|
37
|
+
InvalidResponse: "invalidResponse",
|
|
38
|
+
Defect: "defect"
|
|
39
|
+
};
|
|
40
|
+
var ListIssuesBranchListed = ListIssuesBranch.Listed;
|
|
41
|
+
var ListIssuesBranchProviderRejected = ListIssuesBranch.ProviderRejected;
|
|
42
|
+
var ListIssuesBranchInvalidResponse = ListIssuesBranch.InvalidResponse;
|
|
43
|
+
var ListIssuesBranchDefect = ListIssuesBranch.Defect;
|
|
44
|
+
var ListIssuesDefinition = {
|
|
45
|
+
operation: { connectorId: ConnectorID, operationId: "listIssues" },
|
|
46
|
+
branches: [
|
|
47
|
+
{ id: "listed", description: "Sentry returned the requested result." },
|
|
48
|
+
{ id: "providerRejected", description: "The provider definitively rejected the request.", optional: true },
|
|
49
|
+
{ id: "invalidResponse", description: "The provider returned malformed or oversized JSON.", optional: true },
|
|
50
|
+
{ id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
|
|
51
|
+
],
|
|
52
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
53
|
+
};
|
|
54
|
+
var ListIssuesMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
55
|
+
var GetIssueBranch = {
|
|
56
|
+
Found: "found",
|
|
57
|
+
NotFound: "notFound",
|
|
58
|
+
ProviderRejected: "providerRejected",
|
|
59
|
+
InvalidResponse: "invalidResponse",
|
|
60
|
+
Defect: "defect"
|
|
61
|
+
};
|
|
62
|
+
var GetIssueBranchFound = GetIssueBranch.Found;
|
|
63
|
+
var GetIssueBranchNotFound = GetIssueBranch.NotFound;
|
|
64
|
+
var GetIssueBranchProviderRejected = GetIssueBranch.ProviderRejected;
|
|
65
|
+
var GetIssueBranchInvalidResponse = GetIssueBranch.InvalidResponse;
|
|
66
|
+
var GetIssueBranchDefect = GetIssueBranch.Defect;
|
|
67
|
+
var GetIssueDefinition = {
|
|
68
|
+
operation: { connectorId: ConnectorID, operationId: "getIssue" },
|
|
69
|
+
branches: [
|
|
70
|
+
{ id: "found", description: "Sentry returned the requested result." },
|
|
71
|
+
{ id: "notFound", description: "The requested resource does not exist.", optional: true },
|
|
72
|
+
{ id: "providerRejected", description: "The provider definitively rejected the request.", optional: true },
|
|
73
|
+
{ id: "invalidResponse", description: "The provider returned malformed or oversized JSON.", optional: true },
|
|
74
|
+
{ id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
|
|
75
|
+
],
|
|
76
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
77
|
+
};
|
|
78
|
+
var GetIssueMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
79
|
+
var UpdateIssueStatusBranch = {
|
|
80
|
+
Updated: "updated",
|
|
81
|
+
NotFound: "notFound",
|
|
82
|
+
ProviderRejected: "providerRejected",
|
|
83
|
+
InvalidResponse: "invalidResponse",
|
|
84
|
+
Defect: "defect"
|
|
85
|
+
};
|
|
86
|
+
var UpdateIssueStatusBranchUpdated = UpdateIssueStatusBranch.Updated;
|
|
87
|
+
var UpdateIssueStatusBranchNotFound = UpdateIssueStatusBranch.NotFound;
|
|
88
|
+
var UpdateIssueStatusBranchProviderRejected = UpdateIssueStatusBranch.ProviderRejected;
|
|
89
|
+
var UpdateIssueStatusBranchInvalidResponse = UpdateIssueStatusBranch.InvalidResponse;
|
|
90
|
+
var UpdateIssueStatusBranchDefect = UpdateIssueStatusBranch.Defect;
|
|
91
|
+
var UpdateIssueStatusDefinition = {
|
|
92
|
+
operation: { connectorId: ConnectorID, operationId: "updateIssueStatus" },
|
|
93
|
+
branches: [
|
|
94
|
+
{ id: "updated", description: "Sentry returned the requested result." },
|
|
95
|
+
{ id: "notFound", description: "The requested resource does not exist.", optional: true },
|
|
96
|
+
{ id: "providerRejected", description: "The provider definitively rejected the request.", optional: true },
|
|
97
|
+
{ id: "invalidResponse", description: "The provider returned malformed or oversized JSON.", optional: true },
|
|
98
|
+
{ id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
|
|
99
|
+
],
|
|
100
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
101
|
+
};
|
|
102
|
+
var UpdateIssueStatusMetadata = { kind: "mutation", idempotency: "required", authorization: "required" };
|
|
103
|
+
|
|
104
|
+
// src/generated/connection.ts
|
|
105
|
+
import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
|
|
106
|
+
var Connection = class {
|
|
107
|
+
/** Stable provider and connection name. */
|
|
108
|
+
reference;
|
|
109
|
+
/** Bound provider operations. */
|
|
110
|
+
operations;
|
|
111
|
+
/** Validate a reference and bind operations. */
|
|
112
|
+
constructor(reference, operations) {
|
|
113
|
+
this.reference = ConnectionRefSchema.parse(reference);
|
|
114
|
+
if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
|
|
115
|
+
if (!operations) throw new TypeError("connector operations are required");
|
|
116
|
+
this.operations = operations;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
function newConnection(client, reference) {
|
|
120
|
+
if (!client) throw new TypeError("connector client is required");
|
|
121
|
+
return new Connection(reference, client);
|
|
122
|
+
}
|
|
123
|
+
function newConnectionWithOperations(operations, reference) {
|
|
124
|
+
return new Connection(reference, operations);
|
|
125
|
+
}
|
|
126
|
+
function newProjectConnection(project, connectionName, createClient) {
|
|
127
|
+
if (!project) throw new TypeError("loaded project is required");
|
|
128
|
+
const reference = ConnectionRefSchema.parse({ provider: ProviderID, name: connectionName });
|
|
129
|
+
const selected = project.configuration.connections.find((entry) => entry.connectorId === ConnectorID && entry.connectionName === connectionName);
|
|
130
|
+
if (!selected || selected.provider !== ProviderID) throw new TypeError("project connection is not configured");
|
|
131
|
+
return newConnection(createClient(project, connectionName), reference);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export {
|
|
135
|
+
ConfigSchema,
|
|
136
|
+
ListIssuesInputSchema,
|
|
137
|
+
IssueSchema,
|
|
138
|
+
IssuePageSchema,
|
|
139
|
+
GetIssueInputSchema,
|
|
140
|
+
UpdateIssueStatusInputSchema,
|
|
141
|
+
ConnectorID,
|
|
142
|
+
ProviderID,
|
|
143
|
+
ListIssuesBranch,
|
|
144
|
+
ListIssuesBranchListed,
|
|
145
|
+
ListIssuesBranchProviderRejected,
|
|
146
|
+
ListIssuesBranchInvalidResponse,
|
|
147
|
+
ListIssuesBranchDefect,
|
|
148
|
+
ListIssuesDefinition,
|
|
149
|
+
ListIssuesMetadata,
|
|
150
|
+
GetIssueBranch,
|
|
151
|
+
GetIssueBranchFound,
|
|
152
|
+
GetIssueBranchNotFound,
|
|
153
|
+
GetIssueBranchProviderRejected,
|
|
154
|
+
GetIssueBranchInvalidResponse,
|
|
155
|
+
GetIssueBranchDefect,
|
|
156
|
+
GetIssueDefinition,
|
|
157
|
+
GetIssueMetadata,
|
|
158
|
+
UpdateIssueStatusBranch,
|
|
159
|
+
UpdateIssueStatusBranchUpdated,
|
|
160
|
+
UpdateIssueStatusBranchNotFound,
|
|
161
|
+
UpdateIssueStatusBranchProviderRejected,
|
|
162
|
+
UpdateIssueStatusBranchInvalidResponse,
|
|
163
|
+
UpdateIssueStatusBranchDefect,
|
|
164
|
+
UpdateIssueStatusDefinition,
|
|
165
|
+
UpdateIssueStatusMetadata,
|
|
166
|
+
Connection,
|
|
167
|
+
newConnection,
|
|
168
|
+
newConnectionWithOperations,
|
|
169
|
+
newProjectConnection
|
|
170
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { CredentialProvider, SecretString, Query, Mutation, ConnectionRef } from '@superdurable/connectors-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
/** Connector configuration; omitted fields use manifest defaults. */
|
|
5
|
+
interface Config {
|
|
6
|
+
/** Sentry API base URL. Leave blank for the displayed public endpoint; override only for a compatible gateway or local test server. */
|
|
7
|
+
baseUrl?: string;
|
|
8
|
+
/** Maximum time for one HTTP request, as a positive Go duration such as 15s or 1m. Leave blank for the displayed default; override for slower gateways. Runtime value in milliseconds. */
|
|
9
|
+
timeoutMs?: number;
|
|
10
|
+
/** Maximum accepted response size in bytes. Leave blank for the displayed default; increase only for larger legitimate pages. */
|
|
11
|
+
maxResponseBytes?: number;
|
|
12
|
+
}
|
|
13
|
+
/** Runtime schema for manifest configuration. */
|
|
14
|
+
declare const ConfigSchema: z.ZodObject<{
|
|
15
|
+
baseUrl: z.ZodOptional<z.ZodString>;
|
|
16
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
maxResponseBytes: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
/** Private connector credentials resolved by the host. */
|
|
20
|
+
interface Credentials {
|
|
21
|
+
/** Secret Sentry token. Start at https://sentry.io/settings/account/api/auth-tokens/, follow User Settings > Auth Tokens > Create New Token. Create an auth token with event:read for reads and event:write for status updates. Copy the opaque secret; blank prevents requests. It is sent only in the Authorization header. */
|
|
22
|
+
apiKey: SecretString;
|
|
23
|
+
}
|
|
24
|
+
/** Host-owned source of private connector credentials. */
|
|
25
|
+
type CredentialSource = CredentialProvider<Credentials>;
|
|
26
|
+
/** ListIssuesInput selects one organization's current issues. */
|
|
27
|
+
interface ListIssuesInput {
|
|
28
|
+
/** Organization is the Sentry organization slug. */
|
|
29
|
+
"organization": string;
|
|
30
|
+
/** Query is the provider search expression. */
|
|
31
|
+
"query": string;
|
|
32
|
+
}
|
|
33
|
+
/** Issue contains selected issue metadata. */
|
|
34
|
+
interface Issue {
|
|
35
|
+
/** ID is the provider's stable resource identifier. */
|
|
36
|
+
"id": string;
|
|
37
|
+
/** ShortID is the human-readable Sentry issue identifier. */
|
|
38
|
+
"shortId": string;
|
|
39
|
+
/** Title is the provider's display title. */
|
|
40
|
+
"title": string;
|
|
41
|
+
/** Status is the provider's current status. */
|
|
42
|
+
"status": string;
|
|
43
|
+
}
|
|
44
|
+
/** IssuePage is one organization issue response page. */
|
|
45
|
+
interface IssuePage {
|
|
46
|
+
/** Issues contains one Sentry issue response page. */
|
|
47
|
+
"issues": Array<Issue> | null;
|
|
48
|
+
}
|
|
49
|
+
/** GetIssueInput identifies one issue within an organization. */
|
|
50
|
+
interface GetIssueInput {
|
|
51
|
+
/** Organization is the Sentry organization slug. */
|
|
52
|
+
"organization": string;
|
|
53
|
+
/** ID is the provider's stable resource identifier. */
|
|
54
|
+
"id": string;
|
|
55
|
+
}
|
|
56
|
+
/** UpdateIssueStatusInput sets one issue's absolute status. */
|
|
57
|
+
interface UpdateIssueStatusInput {
|
|
58
|
+
/** Organization is the Sentry organization slug. */
|
|
59
|
+
"organization": string;
|
|
60
|
+
/** ID is the provider's stable resource identifier. */
|
|
61
|
+
"id": string;
|
|
62
|
+
/** Status is the provider's current status. */
|
|
63
|
+
"status": string;
|
|
64
|
+
}
|
|
65
|
+
/** Runtime validator for ListIssuesInput. */
|
|
66
|
+
declare const ListIssuesInputSchema: z.ZodObject<{
|
|
67
|
+
organization: z.ZodString;
|
|
68
|
+
query: z.ZodString;
|
|
69
|
+
}, z.core.$strict>;
|
|
70
|
+
/** Runtime validator for Issue. */
|
|
71
|
+
declare const IssueSchema: z.ZodObject<{
|
|
72
|
+
id: z.ZodString;
|
|
73
|
+
shortId: z.ZodString;
|
|
74
|
+
title: z.ZodString;
|
|
75
|
+
status: z.ZodString;
|
|
76
|
+
}, z.core.$strict>;
|
|
77
|
+
/** Runtime validator for IssuePage. */
|
|
78
|
+
declare const IssuePageSchema: z.ZodObject<{
|
|
79
|
+
issues: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
80
|
+
id: z.ZodString;
|
|
81
|
+
shortId: z.ZodString;
|
|
82
|
+
title: z.ZodString;
|
|
83
|
+
status: z.ZodString;
|
|
84
|
+
}, z.core.$strict>>>;
|
|
85
|
+
}, z.core.$strict>;
|
|
86
|
+
/** Runtime validator for GetIssueInput. */
|
|
87
|
+
declare const GetIssueInputSchema: z.ZodObject<{
|
|
88
|
+
organization: z.ZodString;
|
|
89
|
+
id: z.ZodString;
|
|
90
|
+
}, z.core.$strict>;
|
|
91
|
+
/** Runtime validator for UpdateIssueStatusInput. */
|
|
92
|
+
declare const UpdateIssueStatusInputSchema: z.ZodObject<{
|
|
93
|
+
organization: z.ZodString;
|
|
94
|
+
id: z.ZodString;
|
|
95
|
+
status: z.ZodString;
|
|
96
|
+
}, z.core.$strict>;
|
|
97
|
+
|
|
98
|
+
/** Typed operations supplied by a client or mock. */
|
|
99
|
+
interface Operations {
|
|
100
|
+
/** Invoke listIssues through this connection. */
|
|
101
|
+
listIssues(): Query<ListIssuesInput, IssuePage>;
|
|
102
|
+
/** Invoke getIssue through this connection. */
|
|
103
|
+
getIssue(): Query<GetIssueInput, Issue>;
|
|
104
|
+
/** Invoke updateIssueStatus through this connection. */
|
|
105
|
+
updateIssueStatus(): Mutation<UpdateIssueStatusInput, Issue>;
|
|
106
|
+
}
|
|
107
|
+
/** Named connector connection kept outside Flow state. */
|
|
108
|
+
declare class Connection<BoundOperations = Operations> {
|
|
109
|
+
/** Stable provider and connection name. */
|
|
110
|
+
readonly reference: ConnectionRef;
|
|
111
|
+
/** Bound provider operations. */
|
|
112
|
+
readonly operations: BoundOperations;
|
|
113
|
+
/** Validate a reference and bind operations. */
|
|
114
|
+
constructor(reference: ConnectionRef, operations: BoundOperations);
|
|
115
|
+
}
|
|
116
|
+
/** Bind a client to a named connection. */
|
|
117
|
+
declare function newConnection(client: Operations, reference: ConnectionRef): Connection;
|
|
118
|
+
/** Bind scripted operations to a named connection. */
|
|
119
|
+
declare function newConnectionWithOperations(operations: Operations, reference: ConnectionRef): Connection;
|
|
120
|
+
|
|
121
|
+
export { Connection as C, type GetIssueInput as G, type Issue as I, type ListIssuesInput as L, type Operations as O, type UpdateIssueStatusInput as U, type IssuePage as a, type Config as b, type Credentials as c, ConfigSchema as d, type CredentialSource as e, GetIssueInputSchema as f, IssuePageSchema as g, IssueSchema as h, ListIssuesInputSchema as i, UpdateIssueStatusInputSchema as j, newConnectionWithOperations as k, newConnection as n };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { G as GetIssueInput, I as Issue, C as Connection, L as ListIssuesInput, a as IssuePage, U as UpdateIssueStatusInput, b as Config, c as Credentials, O as Operations } from './connection-Cvf7BnFm.js';
|
|
2
|
+
export { d as ConfigSchema, e as CredentialSource, f as GetIssueInputSchema, g as IssuePageSchema, h as IssueSchema, i as ListIssuesInputSchema, j as UpdateIssueStatusInputSchema, n as newConnection, k as newConnectionWithOperations } from './connection-Cvf7BnFm.js';
|
|
3
|
+
import * as _superdurable_connectors_sdk from '@superdurable/connectors-sdk';
|
|
4
|
+
import { QueryDefinition, MutationDefinition, QueryStepConfig, Query, QueryResult, MutationStepConfig, Mutation, MutationResult, QueryStep, MutationStep, Call, QueryAttempt, MutationAttempt, CredentialProvider, Failure } from '@superdurable/connectors-sdk';
|
|
5
|
+
import { StepTarget } from '@superdurable/dex';
|
|
6
|
+
import { LoadedProject } from '@superdurable/connectors-sdk/projectconfig';
|
|
7
|
+
import { ProviderRequest, ProviderResponse } from '@superdurable/connectors-sdk/providerhttp';
|
|
8
|
+
import 'zod';
|
|
9
|
+
|
|
10
|
+
/** Stable connector identity. */
|
|
11
|
+
declare const ConnectorID = "sentry";
|
|
12
|
+
/** Provider identity for named connections. */
|
|
13
|
+
declare const ProviderID = "sentry";
|
|
14
|
+
/** Branch IDs for listIssues. */
|
|
15
|
+
declare const ListIssuesBranch: {
|
|
16
|
+
readonly Listed: "listed";
|
|
17
|
+
readonly ProviderRejected: "providerRejected";
|
|
18
|
+
readonly InvalidResponse: "invalidResponse";
|
|
19
|
+
readonly Defect: "defect";
|
|
20
|
+
};
|
|
21
|
+
/** Sentry returned the requested result. */
|
|
22
|
+
declare const ListIssuesBranchListed: "listed";
|
|
23
|
+
/** The provider definitively rejected the request. */
|
|
24
|
+
declare const ListIssuesBranchProviderRejected: "providerRejected";
|
|
25
|
+
/** The provider returned malformed or oversized JSON. */
|
|
26
|
+
declare const ListIssuesBranchInvalidResponse: "invalidResponse";
|
|
27
|
+
/** Local input or connection credentials are invalid. */
|
|
28
|
+
declare const ListIssuesBranchDefect: "defect";
|
|
29
|
+
/** Manifest definition for listIssues. */
|
|
30
|
+
declare const ListIssuesDefinition: QueryDefinition;
|
|
31
|
+
/** Manifest metadata for listIssues. */
|
|
32
|
+
declare const ListIssuesMetadata: {
|
|
33
|
+
readonly kind: "query";
|
|
34
|
+
readonly idempotency: "none";
|
|
35
|
+
readonly authorization: "required";
|
|
36
|
+
};
|
|
37
|
+
/** Branch IDs for getIssue. */
|
|
38
|
+
declare const GetIssueBranch: {
|
|
39
|
+
readonly Found: "found";
|
|
40
|
+
readonly NotFound: "notFound";
|
|
41
|
+
readonly ProviderRejected: "providerRejected";
|
|
42
|
+
readonly InvalidResponse: "invalidResponse";
|
|
43
|
+
readonly Defect: "defect";
|
|
44
|
+
};
|
|
45
|
+
/** Sentry returned the requested result. */
|
|
46
|
+
declare const GetIssueBranchFound: "found";
|
|
47
|
+
/** The requested resource does not exist. */
|
|
48
|
+
declare const GetIssueBranchNotFound: "notFound";
|
|
49
|
+
/** The provider definitively rejected the request. */
|
|
50
|
+
declare const GetIssueBranchProviderRejected: "providerRejected";
|
|
51
|
+
/** The provider returned malformed or oversized JSON. */
|
|
52
|
+
declare const GetIssueBranchInvalidResponse: "invalidResponse";
|
|
53
|
+
/** Local input or connection credentials are invalid. */
|
|
54
|
+
declare const GetIssueBranchDefect: "defect";
|
|
55
|
+
/** Manifest definition for getIssue. */
|
|
56
|
+
declare const GetIssueDefinition: QueryDefinition;
|
|
57
|
+
/** Manifest metadata for getIssue. */
|
|
58
|
+
declare const GetIssueMetadata: {
|
|
59
|
+
readonly kind: "query";
|
|
60
|
+
readonly idempotency: "none";
|
|
61
|
+
readonly authorization: "required";
|
|
62
|
+
};
|
|
63
|
+
/** Branch IDs for updateIssueStatus. */
|
|
64
|
+
declare const UpdateIssueStatusBranch: {
|
|
65
|
+
readonly Updated: "updated";
|
|
66
|
+
readonly NotFound: "notFound";
|
|
67
|
+
readonly ProviderRejected: "providerRejected";
|
|
68
|
+
readonly InvalidResponse: "invalidResponse";
|
|
69
|
+
readonly Defect: "defect";
|
|
70
|
+
};
|
|
71
|
+
/** Sentry returned the requested result. */
|
|
72
|
+
declare const UpdateIssueStatusBranchUpdated: "updated";
|
|
73
|
+
/** The requested resource does not exist. */
|
|
74
|
+
declare const UpdateIssueStatusBranchNotFound: "notFound";
|
|
75
|
+
/** The provider definitively rejected the request. */
|
|
76
|
+
declare const UpdateIssueStatusBranchProviderRejected: "providerRejected";
|
|
77
|
+
/** The provider returned malformed or oversized JSON. */
|
|
78
|
+
declare const UpdateIssueStatusBranchInvalidResponse: "invalidResponse";
|
|
79
|
+
/** Local input or connection credentials are invalid. */
|
|
80
|
+
declare const UpdateIssueStatusBranchDefect: "defect";
|
|
81
|
+
/** Manifest definition for updateIssueStatus. */
|
|
82
|
+
declare const UpdateIssueStatusDefinition: MutationDefinition;
|
|
83
|
+
/** Manifest metadata for updateIssueStatus. */
|
|
84
|
+
declare const UpdateIssueStatusMetadata: {
|
|
85
|
+
readonly kind: "mutation";
|
|
86
|
+
readonly idempotency: "required";
|
|
87
|
+
readonly authorization: "required";
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/** Configuration for the listIssues connector Step. */
|
|
91
|
+
interface ListIssuesStepConfig<StepInput, OperationInput = ListIssuesInput, OperationOutput = IssuePage> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
92
|
+
/** Named connection supplying this operation. */
|
|
93
|
+
connection: Connection<{
|
|
94
|
+
listIssues(): Query<OperationInput, OperationOutput>;
|
|
95
|
+
}>;
|
|
96
|
+
/** Name matching the bound connection. */
|
|
97
|
+
connectionName: string;
|
|
98
|
+
/** Sentry returned the requested result. */
|
|
99
|
+
listed: StepTarget<QueryResult<OperationOutput>>;
|
|
100
|
+
/** The provider definitively rejected the request. */
|
|
101
|
+
providerRejected?: StepTarget<QueryResult<OperationOutput>>;
|
|
102
|
+
/** The provider returned malformed or oversized JSON. */
|
|
103
|
+
invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
|
|
104
|
+
/** Local input or connection credentials are invalid. */
|
|
105
|
+
defect?: StepTarget<QueryResult<OperationOutput>>;
|
|
106
|
+
}
|
|
107
|
+
/** Build the listIssues Step from a named connection. */
|
|
108
|
+
declare function newListIssuesStep<StepInput, OperationInput = ListIssuesInput, OperationOutput = IssuePage>(configuration: ListIssuesStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
|
|
109
|
+
/** Configuration for the getIssue connector Step. */
|
|
110
|
+
interface GetIssueStepConfig<StepInput, OperationInput = GetIssueInput, OperationOutput = Issue> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
111
|
+
/** Named connection supplying this operation. */
|
|
112
|
+
connection: Connection<{
|
|
113
|
+
getIssue(): Query<OperationInput, OperationOutput>;
|
|
114
|
+
}>;
|
|
115
|
+
/** Name matching the bound connection. */
|
|
116
|
+
connectionName: string;
|
|
117
|
+
/** Sentry returned the requested result. */
|
|
118
|
+
found: StepTarget<QueryResult<OperationOutput>>;
|
|
119
|
+
/** The requested resource does not exist. */
|
|
120
|
+
notFound?: StepTarget<QueryResult<OperationOutput>>;
|
|
121
|
+
/** The provider definitively rejected the request. */
|
|
122
|
+
providerRejected?: StepTarget<QueryResult<OperationOutput>>;
|
|
123
|
+
/** The provider returned malformed or oversized JSON. */
|
|
124
|
+
invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
|
|
125
|
+
/** Local input or connection credentials are invalid. */
|
|
126
|
+
defect?: StepTarget<QueryResult<OperationOutput>>;
|
|
127
|
+
}
|
|
128
|
+
/** Build the getIssue Step from a named connection. */
|
|
129
|
+
declare function newGetIssueStep<StepInput, OperationInput = GetIssueInput, OperationOutput = Issue>(configuration: GetIssueStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
|
|
130
|
+
/** Configuration for the updateIssueStatus connector Step. */
|
|
131
|
+
interface UpdateIssueStatusStepConfig<StepInput, OperationInput = UpdateIssueStatusInput, OperationOutput = Issue> extends Omit<MutationStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
132
|
+
/** Named connection supplying this operation. */
|
|
133
|
+
connection: Connection<{
|
|
134
|
+
updateIssueStatus(): Mutation<OperationInput, OperationOutput>;
|
|
135
|
+
}>;
|
|
136
|
+
/** Name matching the bound connection. */
|
|
137
|
+
connectionName: string;
|
|
138
|
+
/** Sentry returned the requested result. */
|
|
139
|
+
updated: StepTarget<MutationResult<OperationOutput>>;
|
|
140
|
+
/** The requested resource does not exist. */
|
|
141
|
+
notFound?: StepTarget<MutationResult<OperationOutput>>;
|
|
142
|
+
/** The provider definitively rejected the request. */
|
|
143
|
+
providerRejected?: StepTarget<MutationResult<OperationOutput>>;
|
|
144
|
+
/** The provider returned malformed or oversized JSON. */
|
|
145
|
+
invalidResponse?: StepTarget<MutationResult<OperationOutput>>;
|
|
146
|
+
/** Local input or connection credentials are invalid. */
|
|
147
|
+
defect?: StepTarget<MutationResult<OperationOutput>>;
|
|
148
|
+
}
|
|
149
|
+
/** Build the updateIssueStatus Step from a named connection. */
|
|
150
|
+
declare function newUpdateIssueStatusStep<StepInput, OperationInput = UpdateIssueStatusInput, OperationOutput = Issue>(configuration: UpdateIssueStatusStepConfig<StepInput, OperationInput, OperationOutput>): MutationStep<StepInput, OperationInput, OperationOutput>;
|
|
151
|
+
|
|
152
|
+
/** Query one organization issue page. */
|
|
153
|
+
declare class ListIssuesOperation implements Query<ListIssuesInput, IssuePage> {
|
|
154
|
+
private readonly client;
|
|
155
|
+
/** Bind one Sentry client. */ constructor(client: SentryClient);
|
|
156
|
+
/** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
157
|
+
/** Validate and invoke one list attempt. */
|
|
158
|
+
invoke(call: Call, input: ListIssuesInput): Promise<QueryAttempt<IssuePage>>;
|
|
159
|
+
}
|
|
160
|
+
/** Query one organization issue. */
|
|
161
|
+
declare class GetIssueOperation implements Query<GetIssueInput, Issue> {
|
|
162
|
+
private readonly client;
|
|
163
|
+
/** Bind one Sentry client. */ constructor(client: SentryClient);
|
|
164
|
+
/** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
165
|
+
/** Validate and invoke one detail attempt. */
|
|
166
|
+
invoke(call: Call, input: GetIssueInput): Promise<QueryAttempt<Issue>>;
|
|
167
|
+
}
|
|
168
|
+
/** Set one issue's absolute status. */
|
|
169
|
+
declare class UpdateIssueStatusOperation implements Mutation<UpdateIssueStatusInput, Issue> {
|
|
170
|
+
private readonly client;
|
|
171
|
+
/** Bind one Sentry client. */ constructor(client: SentryClient);
|
|
172
|
+
/** Return the manifest definition. */ definition(): _superdurable_connectors_sdk.QueryDefinition;
|
|
173
|
+
/** Derive the same stable key as Go from the Call ID. */ idempotencyKey(callId: string): string;
|
|
174
|
+
/** Validate and invoke one status update attempt. */
|
|
175
|
+
invoke(call: Call, input: UpdateIssueStatusInput): Promise<MutationAttempt<Issue>>;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/** HTTP sender injectable for deterministic provider tests. */
|
|
179
|
+
type SentryRequestSender = (request: ProviderRequest) => Promise<ProviderResponse>;
|
|
180
|
+
/** Dependencies for deterministic provider tests. */
|
|
181
|
+
interface SentryClientOptions {
|
|
182
|
+
/** Sender; omit to use the SDK's bounded, no-redirect transport. */
|
|
183
|
+
send?: SentryRequestSender;
|
|
184
|
+
/** Clock used to parse Retry-After. */
|
|
185
|
+
now?: () => Date;
|
|
186
|
+
}
|
|
187
|
+
/** Classified outcome of one provider exchange. */
|
|
188
|
+
type SentryExchange = {
|
|
189
|
+
body: Uint8Array;
|
|
190
|
+
} | {
|
|
191
|
+
branch: 'retry' | 'notFound' | 'providerRejected' | 'invalidResponse' | 'defect';
|
|
192
|
+
failure: Failure;
|
|
193
|
+
retryAfterMs: number;
|
|
194
|
+
};
|
|
195
|
+
/** Immutable Sentry HTTP settings with call-time credential resolution. */
|
|
196
|
+
declare class SentryClient {
|
|
197
|
+
private readonly credentials;
|
|
198
|
+
private readonly baseURL;
|
|
199
|
+
private readonly timeoutMs;
|
|
200
|
+
private readonly maxResponseBytes;
|
|
201
|
+
private readonly send;
|
|
202
|
+
private readonly now;
|
|
203
|
+
/** Validate configuration without contacting Sentry. */
|
|
204
|
+
constructor(config: Config, credentials: CredentialProvider<Credentials>, options?: SentryClientOptions);
|
|
205
|
+
/** Bind the issue list query. */ listIssues(): ListIssuesOperation;
|
|
206
|
+
/** Bind the issue detail query. */ getIssue(): GetIssueOperation;
|
|
207
|
+
/** Bind the absolute status mutation. */ updateIssueStatus(): UpdateIssueStatusOperation;
|
|
208
|
+
/** Send one request and classify Go-compatible provider failures. */
|
|
209
|
+
exchange(call: Call, operation: string, method: 'GET' | 'PUT', path: string, body?: Uint8Array, hasNotFoundBranch?: boolean): Promise<SentryExchange>;
|
|
210
|
+
private failure;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/** Open one named Sentry connection declared in a Dex project. */
|
|
214
|
+
declare function newProjectConnection(project: LoadedProject, connectionName: string, options?: SentryClientOptions): Connection<Operations>;
|
|
215
|
+
|
|
216
|
+
export { Config, Connection, ConnectorID, Credentials, GetIssueBranch, GetIssueBranchDefect, GetIssueBranchFound, GetIssueBranchInvalidResponse, GetIssueBranchNotFound, GetIssueBranchProviderRejected, GetIssueDefinition, GetIssueInput, GetIssueMetadata, GetIssueOperation, type GetIssueStepConfig, Issue, IssuePage, ListIssuesBranch, ListIssuesBranchDefect, ListIssuesBranchInvalidResponse, ListIssuesBranchListed, ListIssuesBranchProviderRejected, ListIssuesDefinition, ListIssuesInput, ListIssuesMetadata, ListIssuesOperation, type ListIssuesStepConfig, ProviderID, SentryClient, type SentryClientOptions, type SentryRequestSender, UpdateIssueStatusBranch, UpdateIssueStatusBranchDefect, UpdateIssueStatusBranchInvalidResponse, UpdateIssueStatusBranchNotFound, UpdateIssueStatusBranchProviderRejected, UpdateIssueStatusBranchUpdated, UpdateIssueStatusDefinition, UpdateIssueStatusInput, UpdateIssueStatusMetadata, UpdateIssueStatusOperation, type UpdateIssueStatusStepConfig, newGetIssueStep, newListIssuesStep, newProjectConnection, newUpdateIssueStatusStep };
|