@superdurable/connector-atlassian-bitbucket 0.1.0 → 0.2.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/README.md +4 -4
- package/dex-connector.json +1367 -4
- package/dist/chunk-4VFVRU2P.js +1020 -0
- package/dist/connection-DtDaG9sh.d.ts +641 -0
- package/dist/index.d.ts +1335 -10
- package/dist/index.js +1821 -35
- package/dist/mock.d.ts +388 -7
- package/dist/mock.js +968 -13
- package/package.json +6 -4
- package/dist/chunk-WKSBYF2I.js +0 -151
- package/dist/connection-DbC0QPe8.d.ts +0 -147
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdurable/connector-atlassian-bitbucket",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"description": "Bitbucket read
|
|
5
|
+
"description": "Bitbucket read operations and signed repository webhooks for Dex Flows",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/superdurable/dex-connectors-library.git",
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"./mock": {
|
|
27
27
|
"types": "./dist/mock.d.ts",
|
|
28
28
|
"import": "./dist/mock.js"
|
|
29
|
-
}
|
|
29
|
+
},
|
|
30
|
+
"./dex-connector.json": "./dex-connector.json"
|
|
30
31
|
},
|
|
31
32
|
"files": [
|
|
32
33
|
"dist",
|
|
@@ -45,8 +46,9 @@
|
|
|
45
46
|
"example:list:start": "npm run build && tsx examples/resource-read/start.ts"
|
|
46
47
|
},
|
|
47
48
|
"dependencies": {
|
|
48
|
-
"@superdurable/connectors-sdk": "0.
|
|
49
|
+
"@superdurable/connectors-sdk": "0.13.0",
|
|
49
50
|
"@superdurable/dex": ">=1.28.0",
|
|
51
|
+
"jsonc-parser": "3.3.1",
|
|
50
52
|
"zod": "^4.1.0"
|
|
51
53
|
},
|
|
52
54
|
"devDependencies": {
|
package/dist/chunk-WKSBYF2I.js
DELETED
|
@@ -1,151 +0,0 @@
|
|
|
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 ListRepositoriesInputSchema = z.strictObject({
|
|
9
|
-
"workspace": z.string()
|
|
10
|
-
});
|
|
11
|
-
var RepositorySchema = z.strictObject({
|
|
12
|
-
"uuid": z.string(),
|
|
13
|
-
"name": z.string(),
|
|
14
|
-
"full_name": z.string(),
|
|
15
|
-
"is_private": z.boolean()
|
|
16
|
-
});
|
|
17
|
-
var RepositoryPageSchema = z.strictObject({
|
|
18
|
-
"values": z.array(RepositorySchema).nullable(),
|
|
19
|
-
"next": z.string(),
|
|
20
|
-
"page": z.number().int(),
|
|
21
|
-
"pagelen": z.number().int()
|
|
22
|
-
});
|
|
23
|
-
var ListPullRequestsInputSchema = z.strictObject({
|
|
24
|
-
"workspace": z.string(),
|
|
25
|
-
"repository": z.string()
|
|
26
|
-
});
|
|
27
|
-
var PullRequestSchema = z.strictObject({
|
|
28
|
-
"id": z.number().int(),
|
|
29
|
-
"title": z.string(),
|
|
30
|
-
"state": z.string()
|
|
31
|
-
});
|
|
32
|
-
var PullRequestPageSchema = z.strictObject({
|
|
33
|
-
"values": z.array(PullRequestSchema).nullable(),
|
|
34
|
-
"next": z.string(),
|
|
35
|
-
"page": z.number().int(),
|
|
36
|
-
"pagelen": z.number().int()
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
// src/generated/definitions.ts
|
|
40
|
-
var ConnectorID = "bitbucket";
|
|
41
|
-
var ProviderID = "bitbucket";
|
|
42
|
-
var ListRepositoriesBranch = {
|
|
43
|
-
Listed: "listed",
|
|
44
|
-
NotFound: "notFound",
|
|
45
|
-
ProviderRejected: "providerRejected",
|
|
46
|
-
InvalidResponse: "invalidResponse",
|
|
47
|
-
Defect: "defect"
|
|
48
|
-
};
|
|
49
|
-
var ListRepositoriesBranchListed = ListRepositoriesBranch.Listed;
|
|
50
|
-
var ListRepositoriesBranchNotFound = ListRepositoriesBranch.NotFound;
|
|
51
|
-
var ListRepositoriesBranchProviderRejected = ListRepositoriesBranch.ProviderRejected;
|
|
52
|
-
var ListRepositoriesBranchInvalidResponse = ListRepositoriesBranch.InvalidResponse;
|
|
53
|
-
var ListRepositoriesBranchDefect = ListRepositoriesBranch.Defect;
|
|
54
|
-
var ListRepositoriesDefinition = {
|
|
55
|
-
operation: { connectorId: ConnectorID, operationId: "listRepositories" },
|
|
56
|
-
branches: [
|
|
57
|
-
{ id: "listed", description: "List repositories owned by a Bitbucket workspace." },
|
|
58
|
-
{ id: "notFound", description: "The requested resource was not found.", optional: true },
|
|
59
|
-
{ id: "providerRejected", description: "The provider conclusively rejected the request.", optional: true },
|
|
60
|
-
{ id: "invalidResponse", description: "The provider returned malformed or oversized JSON.", optional: true },
|
|
61
|
-
{ id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
|
|
62
|
-
],
|
|
63
|
-
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
64
|
-
};
|
|
65
|
-
var ListRepositoriesMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
66
|
-
var ListPullRequestsBranch = {
|
|
67
|
-
Listed: "listed",
|
|
68
|
-
NotFound: "notFound",
|
|
69
|
-
ProviderRejected: "providerRejected",
|
|
70
|
-
InvalidResponse: "invalidResponse",
|
|
71
|
-
Defect: "defect"
|
|
72
|
-
};
|
|
73
|
-
var ListPullRequestsBranchListed = ListPullRequestsBranch.Listed;
|
|
74
|
-
var ListPullRequestsBranchNotFound = ListPullRequestsBranch.NotFound;
|
|
75
|
-
var ListPullRequestsBranchProviderRejected = ListPullRequestsBranch.ProviderRejected;
|
|
76
|
-
var ListPullRequestsBranchInvalidResponse = ListPullRequestsBranch.InvalidResponse;
|
|
77
|
-
var ListPullRequestsBranchDefect = ListPullRequestsBranch.Defect;
|
|
78
|
-
var ListPullRequestsDefinition = {
|
|
79
|
-
operation: { connectorId: ConnectorID, operationId: "listPullRequests" },
|
|
80
|
-
branches: [
|
|
81
|
-
{ id: "listed", description: "List pull requests for a Bitbucket repository." },
|
|
82
|
-
{ id: "notFound", description: "The requested resource was not found.", optional: true },
|
|
83
|
-
{ id: "providerRejected", description: "The provider conclusively rejected the request.", optional: true },
|
|
84
|
-
{ id: "invalidResponse", description: "The provider returned malformed or oversized JSON.", optional: true },
|
|
85
|
-
{ id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
|
|
86
|
-
],
|
|
87
|
-
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
88
|
-
};
|
|
89
|
-
var ListPullRequestsMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
90
|
-
|
|
91
|
-
// src/generated/connection.ts
|
|
92
|
-
import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
|
|
93
|
-
var Connection = class {
|
|
94
|
-
/** Stable provider and connection name. */
|
|
95
|
-
reference;
|
|
96
|
-
/** Bound provider operations. */
|
|
97
|
-
operations;
|
|
98
|
-
/** Validate a reference and bind operations. */
|
|
99
|
-
constructor(reference, operations) {
|
|
100
|
-
this.reference = ConnectionRefSchema.parse(reference);
|
|
101
|
-
if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
|
|
102
|
-
if (!operations) throw new TypeError("connector operations are required");
|
|
103
|
-
this.operations = operations;
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
function newConnection(client, reference) {
|
|
107
|
-
if (!client) throw new TypeError("connector client is required");
|
|
108
|
-
return new Connection(reference, client);
|
|
109
|
-
}
|
|
110
|
-
function newConnectionWithOperations(operations, reference) {
|
|
111
|
-
return new Connection(reference, operations);
|
|
112
|
-
}
|
|
113
|
-
function newProjectConnection(project, connectionName, createClient) {
|
|
114
|
-
if (!project) throw new TypeError("loaded project is required");
|
|
115
|
-
const reference = ConnectionRefSchema.parse({ provider: ProviderID, name: connectionName });
|
|
116
|
-
const selected = project.configuration.connections.find((entry) => entry.connectorId === ConnectorID && entry.connectionName === connectionName);
|
|
117
|
-
if (!selected || selected.provider !== ProviderID) throw new TypeError("project connection is not configured");
|
|
118
|
-
return newConnection(createClient(project, connectionName), reference);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export {
|
|
122
|
-
ConfigSchema,
|
|
123
|
-
ListRepositoriesInputSchema,
|
|
124
|
-
RepositorySchema,
|
|
125
|
-
RepositoryPageSchema,
|
|
126
|
-
ListPullRequestsInputSchema,
|
|
127
|
-
PullRequestSchema,
|
|
128
|
-
PullRequestPageSchema,
|
|
129
|
-
ConnectorID,
|
|
130
|
-
ProviderID,
|
|
131
|
-
ListRepositoriesBranch,
|
|
132
|
-
ListRepositoriesBranchListed,
|
|
133
|
-
ListRepositoriesBranchNotFound,
|
|
134
|
-
ListRepositoriesBranchProviderRejected,
|
|
135
|
-
ListRepositoriesBranchInvalidResponse,
|
|
136
|
-
ListRepositoriesBranchDefect,
|
|
137
|
-
ListRepositoriesDefinition,
|
|
138
|
-
ListRepositoriesMetadata,
|
|
139
|
-
ListPullRequestsBranch,
|
|
140
|
-
ListPullRequestsBranchListed,
|
|
141
|
-
ListPullRequestsBranchNotFound,
|
|
142
|
-
ListPullRequestsBranchProviderRejected,
|
|
143
|
-
ListPullRequestsBranchInvalidResponse,
|
|
144
|
-
ListPullRequestsBranchDefect,
|
|
145
|
-
ListPullRequestsDefinition,
|
|
146
|
-
ListPullRequestsMetadata,
|
|
147
|
-
Connection,
|
|
148
|
-
newConnection,
|
|
149
|
-
newConnectionWithOperations,
|
|
150
|
-
newProjectConnection
|
|
151
|
-
};
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { SecretString, CredentialProvider, Query, ConnectionRef } from '@superdurable/connectors-sdk';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
/** Connector configuration; omitted fields use manifest defaults. */
|
|
5
|
-
interface Config {
|
|
6
|
-
/** Fixed provider API URL; blank uses the displayed default. Override only for a compatible gateway or loopback test server. */
|
|
7
|
-
baseUrl?: string;
|
|
8
|
-
/** Maximum duration of one provider HTTP request as a positive Go duration, such as 15s or 1m. Blank uses the displayed default; override for slow network paths. Runtime value in milliseconds. */
|
|
9
|
-
timeoutMs?: number;
|
|
10
|
-
/** Maximum provider JSON response size in bytes as a positive integer. Blank uses the displayed default; raise only for larger result 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 Bitbucket workspace access token from https://bitbucket.org > workspace Settings > Access tokens > Create access token. Grant Repositories > Read and Pull requests > Read; copy the opaque token once into this secret field. Blank prevents calls. */
|
|
22
|
-
accessToken: SecretString;
|
|
23
|
-
}
|
|
24
|
-
/** Host-owned source of private connector credentials. */
|
|
25
|
-
type CredentialSource = CredentialProvider<Credentials>;
|
|
26
|
-
/** ListRepositoriesInput identifies the workspace whose repositories are read. */
|
|
27
|
-
interface ListRepositoriesInput {
|
|
28
|
-
/** Workspace is the Bitbucket workspace slug. */
|
|
29
|
-
"workspace": string;
|
|
30
|
-
}
|
|
31
|
-
/** Repository is a minimal Bitbucket repository summary. */
|
|
32
|
-
interface Repository {
|
|
33
|
-
/** UUID is the provider repository ID. */
|
|
34
|
-
"uuid": string;
|
|
35
|
-
/** Name is its display name. */
|
|
36
|
-
"name": string;
|
|
37
|
-
/** FullName combines workspace and repository slug. */
|
|
38
|
-
"full_name": string;
|
|
39
|
-
/** IsPrivate reports repository visibility. */
|
|
40
|
-
"is_private": boolean;
|
|
41
|
-
}
|
|
42
|
-
/** RepositoryPage is one Bitbucket repository page. */
|
|
43
|
-
interface RepositoryPage {
|
|
44
|
-
/** Values contains repositories, possibly none. */
|
|
45
|
-
"values": Array<Repository> | null;
|
|
46
|
-
/** Next is the provider's next page URL, if any; applications must treat it as untrusted. */
|
|
47
|
-
"next": string;
|
|
48
|
-
/** Page is the one-based page number. */
|
|
49
|
-
"page": number;
|
|
50
|
-
/** PageLength is the provider page length. */
|
|
51
|
-
"pagelen": number;
|
|
52
|
-
}
|
|
53
|
-
/** ListPullRequestsInput identifies a repository within a workspace. */
|
|
54
|
-
interface ListPullRequestsInput {
|
|
55
|
-
/** Workspace is the Bitbucket workspace slug. */
|
|
56
|
-
"workspace": string;
|
|
57
|
-
/** Repository is the repository slug within the workspace. */
|
|
58
|
-
"repository": string;
|
|
59
|
-
}
|
|
60
|
-
/** PullRequest is a minimal Bitbucket pull request summary. */
|
|
61
|
-
interface PullRequest {
|
|
62
|
-
/** ID is the repository-local numeric pull request ID. */
|
|
63
|
-
"id": number;
|
|
64
|
-
/** Title is the pull request title. */
|
|
65
|
-
"title": string;
|
|
66
|
-
/** State is the provider state such as OPEN. */
|
|
67
|
-
"state": string;
|
|
68
|
-
}
|
|
69
|
-
/** PullRequestPage is one Bitbucket pull request page. */
|
|
70
|
-
interface PullRequestPage {
|
|
71
|
-
/** Values contains pull requests, possibly none. */
|
|
72
|
-
"values": Array<PullRequest> | null;
|
|
73
|
-
/** Next is the provider's next page URL, if any; applications must treat it as untrusted. */
|
|
74
|
-
"next": string;
|
|
75
|
-
/** Page is the one-based page number. */
|
|
76
|
-
"page": number;
|
|
77
|
-
/** PageLength is the provider page length. */
|
|
78
|
-
"pagelen": number;
|
|
79
|
-
}
|
|
80
|
-
/** Runtime validator for ListRepositoriesInput. */
|
|
81
|
-
declare const ListRepositoriesInputSchema: z.ZodObject<{
|
|
82
|
-
workspace: z.ZodString;
|
|
83
|
-
}, z.core.$strict>;
|
|
84
|
-
/** Runtime validator for Repository. */
|
|
85
|
-
declare const RepositorySchema: z.ZodObject<{
|
|
86
|
-
uuid: z.ZodString;
|
|
87
|
-
name: z.ZodString;
|
|
88
|
-
full_name: z.ZodString;
|
|
89
|
-
is_private: z.ZodBoolean;
|
|
90
|
-
}, z.core.$strict>;
|
|
91
|
-
/** Runtime validator for RepositoryPage. */
|
|
92
|
-
declare const RepositoryPageSchema: z.ZodObject<{
|
|
93
|
-
values: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
94
|
-
uuid: z.ZodString;
|
|
95
|
-
name: z.ZodString;
|
|
96
|
-
full_name: z.ZodString;
|
|
97
|
-
is_private: z.ZodBoolean;
|
|
98
|
-
}, z.core.$strict>>>;
|
|
99
|
-
next: z.ZodString;
|
|
100
|
-
page: z.ZodNumber;
|
|
101
|
-
pagelen: z.ZodNumber;
|
|
102
|
-
}, z.core.$strict>;
|
|
103
|
-
/** Runtime validator for ListPullRequestsInput. */
|
|
104
|
-
declare const ListPullRequestsInputSchema: z.ZodObject<{
|
|
105
|
-
workspace: z.ZodString;
|
|
106
|
-
repository: z.ZodString;
|
|
107
|
-
}, z.core.$strict>;
|
|
108
|
-
/** Runtime validator for PullRequest. */
|
|
109
|
-
declare const PullRequestSchema: z.ZodObject<{
|
|
110
|
-
id: z.ZodNumber;
|
|
111
|
-
title: z.ZodString;
|
|
112
|
-
state: z.ZodString;
|
|
113
|
-
}, z.core.$strict>;
|
|
114
|
-
/** Runtime validator for PullRequestPage. */
|
|
115
|
-
declare const PullRequestPageSchema: z.ZodObject<{
|
|
116
|
-
values: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
117
|
-
id: z.ZodNumber;
|
|
118
|
-
title: z.ZodString;
|
|
119
|
-
state: z.ZodString;
|
|
120
|
-
}, z.core.$strict>>>;
|
|
121
|
-
next: z.ZodString;
|
|
122
|
-
page: z.ZodNumber;
|
|
123
|
-
pagelen: z.ZodNumber;
|
|
124
|
-
}, z.core.$strict>;
|
|
125
|
-
|
|
126
|
-
/** Typed operations supplied by a client or mock. */
|
|
127
|
-
interface Operations {
|
|
128
|
-
/** Invoke listRepositories through this connection. */
|
|
129
|
-
listRepositories(): Query<ListRepositoriesInput, RepositoryPage>;
|
|
130
|
-
/** Invoke listPullRequests through this connection. */
|
|
131
|
-
listPullRequests(): Query<ListPullRequestsInput, PullRequestPage>;
|
|
132
|
-
}
|
|
133
|
-
/** Named connector connection kept outside Flow state. */
|
|
134
|
-
declare class Connection<BoundOperations = Operations> {
|
|
135
|
-
/** Stable provider and connection name. */
|
|
136
|
-
readonly reference: ConnectionRef;
|
|
137
|
-
/** Bound provider operations. */
|
|
138
|
-
readonly operations: BoundOperations;
|
|
139
|
-
/** Validate a reference and bind operations. */
|
|
140
|
-
constructor(reference: ConnectionRef, operations: BoundOperations);
|
|
141
|
-
}
|
|
142
|
-
/** Bind a client to a named connection. */
|
|
143
|
-
declare function newConnection(client: Operations, reference: ConnectionRef): Connection;
|
|
144
|
-
/** Bind scripted operations to a named connection. */
|
|
145
|
-
declare function newConnectionWithOperations(operations: Operations, reference: ConnectionRef): Connection;
|
|
146
|
-
|
|
147
|
-
export { Connection as C, type ListPullRequestsInput as L, type Operations as O, type PullRequestPage as P, type RepositoryPage as R, type ListRepositoriesInput as a, type Config as b, type Credentials as c, ConfigSchema as d, type CredentialSource as e, ListPullRequestsInputSchema as f, ListRepositoriesInputSchema as g, type PullRequest as h, PullRequestPageSchema as i, PullRequestSchema as j, type Repository as k, RepositoryPageSchema as l, RepositorySchema as m, newConnection as n, newConnectionWithOperations as o };
|