@frogbotai/piece-linear 0.22.0 → 0.23.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 +111 -0
- package/dist/actions/createComment.d.ts +48 -0
- package/dist/actions/createComment.d.ts.map +1 -0
- package/dist/actions/createComment.js +22 -0
- package/dist/actions/createComment.js.map +1 -0
- package/dist/actions/createIssue.d.ts +79 -0
- package/dist/actions/createIssue.d.ts.map +1 -0
- package/dist/actions/createIssue.js +37 -0
- package/dist/actions/createIssue.js.map +1 -0
- package/dist/actions/createProject.d.ts +49 -0
- package/dist/actions/createProject.d.ts.map +1 -0
- package/dist/actions/createProject.js +32 -0
- package/dist/actions/createProject.js.map +1 -0
- package/dist/actions/options.d.ts +35 -0
- package/dist/actions/options.d.ts.map +1 -0
- package/dist/actions/options.js +27 -0
- package/dist/actions/options.js.map +1 -0
- package/dist/actions/rawGraphqlQuery.d.ts +20 -0
- package/dist/actions/rawGraphqlQuery.d.ts.map +1 -0
- package/dist/actions/rawGraphqlQuery.js +16 -0
- package/dist/actions/rawGraphqlQuery.js.map +1 -0
- package/dist/actions/updateIssue.d.ts +88 -0
- package/dist/actions/updateIssue.d.ts.map +1 -0
- package/dist/actions/updateIssue.js +39 -0
- package/dist/actions/updateIssue.js.map +1 -0
- package/dist/actions/updateProject.d.ts +57 -0
- package/dist/actions/updateProject.d.ts.map +1 -0
- package/dist/actions/updateProject.js +33 -0
- package/dist/actions/updateProject.js.map +1 -0
- package/dist/client.d.ts +6 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +9 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +20 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +25 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +456 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +107 -30
- package/dist/index.js.map +1 -1
- package/dist/triggers/commentCreated.d.ts +12 -0
- package/dist/triggers/commentCreated.d.ts.map +1 -0
- package/dist/triggers/commentCreated.js +17 -0
- package/dist/triggers/commentCreated.js.map +1 -0
- package/dist/triggers/issueCreated.d.ts +11 -0
- package/dist/triggers/issueCreated.d.ts.map +1 -0
- package/dist/triggers/issueCreated.js +10 -0
- package/dist/triggers/issueCreated.js.map +1 -0
- package/dist/triggers/issueRemoved.d.ts +11 -0
- package/dist/triggers/issueRemoved.d.ts.map +1 -0
- package/dist/triggers/issueRemoved.js +10 -0
- package/dist/triggers/issueRemoved.js.map +1 -0
- package/dist/triggers/issueUpdated.d.ts +11 -0
- package/dist/triggers/issueUpdated.d.ts.map +1 -0
- package/dist/triggers/issueUpdated.js +10 -0
- package/dist/triggers/issueUpdated.js.map +1 -0
- package/dist/triggers/projectCreated.d.ts +9 -0
- package/dist/triggers/projectCreated.d.ts.map +1 -0
- package/dist/triggers/projectCreated.js +9 -0
- package/dist/triggers/projectCreated.js.map +1 -0
- package/dist/triggers/projectRemoved.d.ts +9 -0
- package/dist/triggers/projectRemoved.d.ts.map +1 -0
- package/dist/triggers/projectRemoved.js +9 -0
- package/dist/triggers/projectRemoved.js.map +1 -0
- package/dist/triggers/projectUpdated.d.ts +12 -0
- package/dist/triggers/projectUpdated.d.ts.map +1 -0
- package/dist/triggers/projectUpdated.js +15 -0
- package/dist/triggers/projectUpdated.js.map +1 -0
- package/dist/triggers/webhook.d.ts +34 -0
- package/dist/triggers/webhook.d.ts.map +1 -0
- package/dist/triggers/webhook.js +52 -0
- package/dist/triggers/webhook.js.map +1 -0
- package/dist/webhook.d.ts +4 -0
- package/dist/webhook.d.ts.map +1 -0
- package/dist/webhook.js +33 -0
- package/dist/webhook.js.map +1 -0
- package/package.json +6 -4
package/README.md
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# `@frogbotai/piece-linear`
|
|
2
|
+
|
|
3
|
+
Manage Linear issues, projects, comments, webhook events, and Agent Session conversations.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { createLinear } from '@frogbotai/piece-linear';
|
|
9
|
+
|
|
10
|
+
export const linear = createLinear({ auth: { apiKey: process.env.LINEAR_API_KEY! } });
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
API keys and OAuth access tokens use FrogBot's current connection resolution. OAuth application
|
|
14
|
+
credentials configure the connection flow; the resulting access token is the piece credential.
|
|
15
|
+
|
|
16
|
+
Enable the credential form with `connections: [{ piece: linear, secret: true }]`. Enter either
|
|
17
|
+
`apiKey` or `accessToken` and omit the unused field. A user-linked credential takes precedence over
|
|
18
|
+
factory auth for that user's action calls; channels continue using the fixed factory credential.
|
|
19
|
+
|
|
20
|
+
OAuth linking requires factory `oauth: { clientId, clientSecret }` and
|
|
21
|
+
`connections: [{ piece: linear, oauth: true }]`. The built-in recipe requests `actor=app`: a workspace
|
|
22
|
+
admin installs the application, and actions use the app's identity. It does not authorize actions
|
|
23
|
+
as the installing user. For actions as a person, link their API key or an externally obtained
|
|
24
|
+
user-actor OAuth access token through the credential form. Scope overrides remain an array of
|
|
25
|
+
individual scopes in `oauth.scopes`; FrogBot serializes them with commas for Linear.
|
|
26
|
+
|
|
27
|
+
## Channel setup
|
|
28
|
+
|
|
29
|
+
Agent Sessions are the primary channel mode. Create a Linear OAuth application under **Settings >
|
|
30
|
+
API > Applications**, enable Agent Session webhook events, and have a workspace admin install it
|
|
31
|
+
as an app actor with `read`, `write`, `comments:create`, `issues:create`, and `app:mentionable` scopes.
|
|
32
|
+
|
|
33
|
+
Set the OAuth application's webhook URL to this instance URL:
|
|
34
|
+
|
|
35
|
+
```text
|
|
36
|
+
https://<host>/api/webhooks/<piece-instance-slug>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Select **Agent session events** and copy the application's webhook signing secret. Configure the
|
|
40
|
+
installed OAuth access token and webhook secret:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
export const linear = createLinear({
|
|
44
|
+
auth: { accessToken: process.env.LINEAR_ACCESS_TOKEN! },
|
|
45
|
+
webhookSecret: process.env.LINEAR_WEBHOOK_SECRET!,
|
|
46
|
+
botUsername: 'FrogBot',
|
|
47
|
+
});
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Authorization-code OAuth access tokens expire after 24 hours. The channel adapter captures the
|
|
51
|
+
static `auth.accessToken` and does not use FrogBot's user-connection refresh flow. Renew it through
|
|
52
|
+
[Linear's refresh-token endpoint](https://linear.app/developers/oauth-2-0-authentication#refresh-an-access-token),
|
|
53
|
+
retain the replacement refresh token, update the configured access token, and restart the FrogBot
|
|
54
|
+
runtime before expiry. Pasting an OAuth token into a secret connection also stores a static token;
|
|
55
|
+
it does not enable automatic renewal.
|
|
56
|
+
|
|
57
|
+
For a personal API key bot that responds to issue comments, set `channelMode: 'comments'`, subscribe
|
|
58
|
+
an admin-created workspace webhook to **Comments**, and set `botUsername` to the name users mention.
|
|
59
|
+
Comment mode supports post-and-edit streaming, but not Agent Session thoughts or native activity streaming.
|
|
60
|
+
|
|
61
|
+
Linear signs the exact request body in `Linear-Signature` with HMAC-SHA256. FrogBot rejects missing,
|
|
62
|
+
invalid, or stale signed deliveries before channel or trigger dispatch. Channel replies are handled
|
|
63
|
+
by the adapter; the triggers below remain independent per-subscription workflows.
|
|
64
|
+
|
|
65
|
+
## Actions
|
|
66
|
+
|
|
67
|
+
| Upstream action slug | Previous wrapper export | Native action | Notes |
|
|
68
|
+
| ----------------------- | ----------------------- | ----------------- | ---------------------------------------------------- |
|
|
69
|
+
| `linear_create_issue` | `linearCreateIssue` | `createIssue` | |
|
|
70
|
+
| `linear_update_issue` | `linearUpdateIssue` | `updateIssue` | |
|
|
71
|
+
| `linear_create_project` | `linearCreateProject` | `createProject` | |
|
|
72
|
+
| `linear_update_project` | `linearUpdateProject` | `updateProject` | Previously exposed but omitted from `linearActions`. |
|
|
73
|
+
| `linear_create_comment` | `linearCreateComment` | `createComment` | |
|
|
74
|
+
| `rawGraphqlQuery` | `rawGraphqlQuery` | `rawGraphqlQuery` | |
|
|
75
|
+
|
|
76
|
+
## Triggers
|
|
77
|
+
|
|
78
|
+
Set the factory's optional `webhookSecret` to enable webhook triggers. Actions continue to work
|
|
79
|
+
without it; trigger subscription creation requires it. Each trigger registers its supplied
|
|
80
|
+
`/api/webhooks/<piece-instance-slug>/<subscription-id>` URL and does not send channel
|
|
81
|
+
replies.
|
|
82
|
+
|
|
83
|
+
The lifecycle creates and reads webhooks through Linear's API, which requires a workspace admin's
|
|
84
|
+
API key or a user-actor OAuth token with `admin` scope. Linear's `actor=app` tokens cannot request
|
|
85
|
+
`admin`, so the built-in OAuth recipe and Agent Session channel token cannot provision these
|
|
86
|
+
subscriptions. Use a separately named piece instance with an admin API key for triggers when the
|
|
87
|
+
channel uses app-actor OAuth; supply that instance's own webhook secret and subscription URLs.
|
|
88
|
+
See [Linear's webhook permissions](https://linear.app/developers/webhooks) and
|
|
89
|
+
[app-actor restrictions](https://linear.app/developers/agents#admin).
|
|
90
|
+
|
|
91
|
+
```ts
|
|
92
|
+
export const linearWebhooks = createLinear({
|
|
93
|
+
slug: 'linear-webhooks',
|
|
94
|
+
auth: { apiKey: process.env.LINEAR_ADMIN_API_KEY! },
|
|
95
|
+
webhookSecret: process.env.LINEAR_WEBHOOK_SECRET!,
|
|
96
|
+
});
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
FrogBot passes this secret to Linear when creating each webhook. Incoming requests must have a valid
|
|
100
|
+
`Linear-Signature` HMAC-SHA256 signature over the raw body and a current signed body
|
|
101
|
+
`webhookTimestamp`. Missing or invalid signatures, secrets, or timestamps are rejected.
|
|
102
|
+
|
|
103
|
+
| Upstream trigger slug | Native trigger | Type | Notes |
|
|
104
|
+
| --------------------- | ---------------- | --------- | ----------------------------------------------------- |
|
|
105
|
+
| `new_comment` | `commentCreated` | `webhook` | Optional team and author filters. |
|
|
106
|
+
| `new_issue` | `issueCreated` | `webhook` | Team-scoped. |
|
|
107
|
+
| `updated_issue` | `issueUpdated` | `webhook` | Optional team scope. |
|
|
108
|
+
| `removed_issue` | `issueRemoved` | `webhook` | Team-scoped. |
|
|
109
|
+
| `new_project` | `projectCreated` | `webhook` | Workspace-wide. |
|
|
110
|
+
| `updated_project` | `projectUpdated` | `webhook` | Status changes with optional team and status filters. |
|
|
111
|
+
| `removed_project` | `projectRemoved` | `webhook` | Workspace-wide. |
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type PieceRunArgs } from 'frogbot/pieces';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { Linear } from '../client.js';
|
|
4
|
+
declare const inputSchema: z.ZodObject<{
|
|
5
|
+
teamId: z.ZodString;
|
|
6
|
+
issueId: z.ZodString;
|
|
7
|
+
body: z.ZodString;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
export declare const createComment: {
|
|
10
|
+
slug: string;
|
|
11
|
+
description: string;
|
|
12
|
+
input: z.ZodObject<{
|
|
13
|
+
teamId: z.ZodString;
|
|
14
|
+
issueId: z.ZodString;
|
|
15
|
+
body: z.ZodString;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
output: z.ZodObject<{
|
|
18
|
+
success: z.ZodBoolean;
|
|
19
|
+
lastSyncId: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
}, z.core.$loose>;
|
|
21
|
+
idempotent: boolean;
|
|
22
|
+
options: {
|
|
23
|
+
teamId: ({ client }: {
|
|
24
|
+
client: Linear;
|
|
25
|
+
}) => Promise<{
|
|
26
|
+
label: string;
|
|
27
|
+
value: string;
|
|
28
|
+
}[]>;
|
|
29
|
+
issueId: ({ client, input }: {
|
|
30
|
+
client: Linear;
|
|
31
|
+
input: {
|
|
32
|
+
teamId?: string;
|
|
33
|
+
};
|
|
34
|
+
}) => Promise<{
|
|
35
|
+
label: string;
|
|
36
|
+
value: string;
|
|
37
|
+
}[]>;
|
|
38
|
+
};
|
|
39
|
+
run({ client, input }: PieceRunArgs<z.output<typeof inputSchema>, object, Linear>): Promise<{
|
|
40
|
+
success: boolean;
|
|
41
|
+
lastSyncId: number;
|
|
42
|
+
comment: {
|
|
43
|
+
id: string | undefined;
|
|
44
|
+
};
|
|
45
|
+
}>;
|
|
46
|
+
};
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=createComment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createComment.d.ts","sourceRoot":"","sources":["../../src/actions/createComment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,QAAA,MAAM,WAAW;;;;iBAA8D,CAAC;AAGhF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;sBAgBqc,CAAC;;;;;;;2BATjc,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC;;;;;;;CAQxF,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { teamId } from '../config.js';
|
|
3
|
+
import { teamOptions, teams } from './options.js';
|
|
4
|
+
const inputSchema = z.object({ teamId, issueId: z.string(), body: z.string() });
|
|
5
|
+
const output = z.object({ success: z.boolean(), lastSyncId: z.number().optional() }).passthrough();
|
|
6
|
+
export const createComment = {
|
|
7
|
+
slug: 'createComment',
|
|
8
|
+
description: 'Create a comment on a Linear issue.',
|
|
9
|
+
input: inputSchema,
|
|
10
|
+
output,
|
|
11
|
+
idempotent: false,
|
|
12
|
+
options: { teamId: teams, issueId: teamOptions('issues') },
|
|
13
|
+
async run({ client, input }) {
|
|
14
|
+
const response = await client.createComment({ issueId: input.issueId, body: input.body });
|
|
15
|
+
return {
|
|
16
|
+
success: response.success,
|
|
17
|
+
lastSyncId: response.lastSyncId,
|
|
18
|
+
comment: { id: response.commentId },
|
|
19
|
+
};
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=createComment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createComment.js","sourceRoot":"","sources":["../../src/actions/createComment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAChF,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;AAEnG,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,qCAAqC;IAClD,KAAK,EAAE,WAAW;IAClB,MAAM;IACN,UAAU,EAAE,KAAK;IACjB,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,CAAC,QAAQ,CAAC,EAAE;IAC1D,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,KAAK,EAA8D;QACrF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QAC1F,OAAO;YACL,OAAO,EAAE,QAAQ,CAAC,OAAO;YACzB,UAAU,EAAE,QAAQ,CAAC,UAAU;YAC/B,OAAO,EAAE,EAAE,EAAE,EAAE,QAAQ,CAAC,SAAS,EAAE;SACpC,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type PieceRunArgs } from 'frogbot/pieces';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { Linear } from '../client.js';
|
|
4
|
+
declare const inputSchema: z.ZodObject<{
|
|
5
|
+
teamId: z.ZodString;
|
|
6
|
+
title: z.ZodString;
|
|
7
|
+
description: z.ZodOptional<z.ZodString>;
|
|
8
|
+
stateId: z.ZodOptional<z.ZodString>;
|
|
9
|
+
labelIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
10
|
+
assigneeId: z.ZodOptional<z.ZodString>;
|
|
11
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
templateId: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare const createIssue: {
|
|
15
|
+
slug: string;
|
|
16
|
+
description: string;
|
|
17
|
+
input: z.ZodObject<{
|
|
18
|
+
teamId: z.ZodString;
|
|
19
|
+
title: z.ZodString;
|
|
20
|
+
description: z.ZodOptional<z.ZodString>;
|
|
21
|
+
stateId: z.ZodOptional<z.ZodString>;
|
|
22
|
+
labelIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
23
|
+
assigneeId: z.ZodOptional<z.ZodString>;
|
|
24
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
templateId: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
output: z.ZodObject<{
|
|
28
|
+
success: z.ZodBoolean;
|
|
29
|
+
lastSyncId: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
}, z.core.$loose>;
|
|
31
|
+
idempotent: false;
|
|
32
|
+
options: {
|
|
33
|
+
teamId: ({ client }: {
|
|
34
|
+
client: Linear;
|
|
35
|
+
}) => Promise<{
|
|
36
|
+
label: string;
|
|
37
|
+
value: string;
|
|
38
|
+
}[]>;
|
|
39
|
+
stateId: ({ client, input }: {
|
|
40
|
+
client: Linear;
|
|
41
|
+
input: {
|
|
42
|
+
teamId?: string;
|
|
43
|
+
};
|
|
44
|
+
}) => Promise<{
|
|
45
|
+
label: string;
|
|
46
|
+
value: string;
|
|
47
|
+
}[]>;
|
|
48
|
+
labelIds: ({ client, input }: {
|
|
49
|
+
client: Linear;
|
|
50
|
+
input: {
|
|
51
|
+
teamId?: string;
|
|
52
|
+
};
|
|
53
|
+
}) => Promise<{
|
|
54
|
+
label: string;
|
|
55
|
+
value: string;
|
|
56
|
+
}[]>;
|
|
57
|
+
assigneeId: ({ client }: {
|
|
58
|
+
client: Linear;
|
|
59
|
+
}) => Promise<{
|
|
60
|
+
label: string;
|
|
61
|
+
value: string;
|
|
62
|
+
}[]>;
|
|
63
|
+
priority: ({ client }: {
|
|
64
|
+
client: Linear;
|
|
65
|
+
}) => Promise<{
|
|
66
|
+
label: string;
|
|
67
|
+
value: string;
|
|
68
|
+
}[]>;
|
|
69
|
+
};
|
|
70
|
+
run({ client, input }: PieceRunArgs<z.output<typeof inputSchema>, object, Linear>): Promise<{
|
|
71
|
+
success: boolean;
|
|
72
|
+
lastSyncId: number;
|
|
73
|
+
issue: {
|
|
74
|
+
id: string | undefined;
|
|
75
|
+
};
|
|
76
|
+
}>;
|
|
77
|
+
};
|
|
78
|
+
export {};
|
|
79
|
+
//# sourceMappingURL=createIssue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createIssue.d.ts","sourceRoot":"","sources":["../../src/actions/createIssue.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,QAAA,MAAM,WAAW;;;;;;;;;iBASf,CAAC;AAGH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAsBoC,CAAC;;;;;;;;;sBAAD,CAAC;;;;;;;;;;;;;;;;;;;2BAT9B,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC;;;;;;;CAQL,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { teamId } from '../config.js';
|
|
3
|
+
import { priorities, teamOptions, teams, users } from './options.js';
|
|
4
|
+
const inputSchema = z.object({
|
|
5
|
+
teamId,
|
|
6
|
+
title: z.string(),
|
|
7
|
+
description: z.string().optional(),
|
|
8
|
+
stateId: z.string().optional(),
|
|
9
|
+
labelIds: z.array(z.string()).optional(),
|
|
10
|
+
assigneeId: z.string().optional(),
|
|
11
|
+
priority: z.number().int().min(0).max(4).optional(),
|
|
12
|
+
templateId: z.string().optional(),
|
|
13
|
+
});
|
|
14
|
+
const output = z.object({ success: z.boolean(), lastSyncId: z.number().optional() }).passthrough();
|
|
15
|
+
export const createIssue = {
|
|
16
|
+
slug: 'createIssue',
|
|
17
|
+
description: 'Create an issue in a Linear team.',
|
|
18
|
+
input: inputSchema,
|
|
19
|
+
output,
|
|
20
|
+
idempotent: false,
|
|
21
|
+
options: {
|
|
22
|
+
teamId: teams,
|
|
23
|
+
stateId: teamOptions('workflowStates'),
|
|
24
|
+
labelIds: teamOptions('issueLabels'),
|
|
25
|
+
assigneeId: users,
|
|
26
|
+
priority: priorities,
|
|
27
|
+
},
|
|
28
|
+
async run({ client, input }) {
|
|
29
|
+
const response = await client.createIssue(input);
|
|
30
|
+
return {
|
|
31
|
+
success: response.success,
|
|
32
|
+
lastSyncId: response.lastSyncId,
|
|
33
|
+
issue: { id: response.issueId },
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=createIssue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AAO,EAAE;QACP,MAAM,EAAE,KAAK;QACb,OAAO,EAAE,WAAW,CAAC,gBAAgB,CAAC;QACtC,QAAQ,EAAE,WAAW,CAAC,aAAa,CAAC;QACpC,UAAU,EAAE,KAAK;QACjB,QAAQ,EAAE,UAAU;KACrB;IACD,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,KAAK,EAA8D;QACrF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QACjD,OAAO;YACL,OAAO,EAAE,QAAQ,CAAC,OAAO;YACzB,UAAU,EAAE,QAAQ,CAAC,UAAU;YAC/B,KAAK,EAAE,EAAE,EAAE,EAAE,QAAQ,CAAC,OAAO,EAAE;SAChC,CAAC;IACJ,CAAC;CACiF,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type PieceRunArgs } from 'frogbot/pieces';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { Linear } from '../client.js';
|
|
4
|
+
declare const inputSchema: z.ZodObject<{
|
|
5
|
+
teamId: z.ZodString;
|
|
6
|
+
name: z.ZodString;
|
|
7
|
+
description: z.ZodOptional<z.ZodString>;
|
|
8
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
9
|
+
color: z.ZodOptional<z.ZodString>;
|
|
10
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
11
|
+
targetDate: z.ZodOptional<z.ZodString>;
|
|
12
|
+
statusId: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare const createProject: {
|
|
15
|
+
slug: string;
|
|
16
|
+
description: string;
|
|
17
|
+
input: z.ZodObject<{
|
|
18
|
+
teamId: z.ZodString;
|
|
19
|
+
name: z.ZodString;
|
|
20
|
+
description: z.ZodOptional<z.ZodString>;
|
|
21
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
22
|
+
color: z.ZodOptional<z.ZodString>;
|
|
23
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
24
|
+
targetDate: z.ZodOptional<z.ZodString>;
|
|
25
|
+
statusId: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
output: z.ZodObject<{
|
|
28
|
+
success: z.ZodBoolean;
|
|
29
|
+
lastSyncId: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
}, z.core.$loose>;
|
|
31
|
+
idempotent: boolean;
|
|
32
|
+
options: {
|
|
33
|
+
teamId: ({ client }: {
|
|
34
|
+
client: Linear;
|
|
35
|
+
}) => Promise<{
|
|
36
|
+
label: string;
|
|
37
|
+
value: string;
|
|
38
|
+
}[]>;
|
|
39
|
+
};
|
|
40
|
+
run({ client, input }: PieceRunArgs<z.output<typeof inputSchema>, object, Linear>): Promise<{
|
|
41
|
+
success: boolean;
|
|
42
|
+
lastSyncId: number;
|
|
43
|
+
project: {
|
|
44
|
+
id: string | undefined;
|
|
45
|
+
};
|
|
46
|
+
}>;
|
|
47
|
+
};
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=createProject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createProject.d.ts","sourceRoot":"","sources":["../../src/actions/createProject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,QAAA,MAAM,WAAW;;;;;;;;;iBASf,CAAC;AAGH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;2BAOK,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC;;;;;;;CASxF,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { teamId } from '../config.js';
|
|
3
|
+
import { teams } from './options.js';
|
|
4
|
+
const inputSchema = z.object({
|
|
5
|
+
teamId,
|
|
6
|
+
name: z.string(),
|
|
7
|
+
description: z.string().optional(),
|
|
8
|
+
icon: z.string().optional(),
|
|
9
|
+
color: z.string().optional(),
|
|
10
|
+
startDate: z.string().optional(),
|
|
11
|
+
targetDate: z.string().optional(),
|
|
12
|
+
statusId: z.string().optional(),
|
|
13
|
+
});
|
|
14
|
+
const output = z.object({ success: z.boolean(), lastSyncId: z.number().optional() }).passthrough();
|
|
15
|
+
export const createProject = {
|
|
16
|
+
slug: 'createProject',
|
|
17
|
+
description: 'Create a project in a Linear team.',
|
|
18
|
+
input: inputSchema,
|
|
19
|
+
output,
|
|
20
|
+
idempotent: false,
|
|
21
|
+
options: { teamId: teams },
|
|
22
|
+
async run({ client, input }) {
|
|
23
|
+
const { teamId, ...fields } = input;
|
|
24
|
+
const response = await client.createProject({ teamIds: [teamId], ...fields });
|
|
25
|
+
return {
|
|
26
|
+
success: response.success,
|
|
27
|
+
lastSyncId: response.lastSyncId,
|
|
28
|
+
project: { id: response.projectId },
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=createProject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createProject.js","sourceRoot":"","sources":["../../src/actions/createProject.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,MAAM;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EA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
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}[]>;
|
|
8
|
+
export declare const users: ({ client }: {
|
|
9
|
+
client: Linear;
|
|
10
|
+
}) => Promise<{
|
|
11
|
+
label: string;
|
|
12
|
+
value: string;
|
|
13
|
+
}[]>;
|
|
14
|
+
export declare const projects: ({ client }: {
|
|
15
|
+
client: Linear;
|
|
16
|
+
}) => Promise<{
|
|
17
|
+
label: string;
|
|
18
|
+
value: string;
|
|
19
|
+
}[]>;
|
|
20
|
+
export declare const priorities: ({ client }: {
|
|
21
|
+
client: Linear;
|
|
22
|
+
}) => Promise<{
|
|
23
|
+
label: string;
|
|
24
|
+
value: string;
|
|
25
|
+
}[]>;
|
|
26
|
+
export declare const teamOptions: (method: "issues" | "workflowStates" | "issueLabels") => ({ client, input }: {
|
|
27
|
+
client: Linear;
|
|
28
|
+
input: {
|
|
29
|
+
teamId?: string;
|
|
30
|
+
};
|
|
31
|
+
}) => Promise<{
|
|
32
|
+
label: string;
|
|
33
|
+
value: string;
|
|
34
|
+
}[]>;
|
|
35
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/actions/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAoB3C,eAAO,MAAM,KAAK,eAAgB;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;WAZpB,MAAM;WAAS,MAAM;IAa+B,CAAC;AACrF,eAAO,MAAM,KAAK,eAAgB;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;WAdpB,MAAM;WAAS,MAAM;IAe+B,CAAC;AACrF,eAAO,MAAM,QAAQ,eAAgB;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;WAhBvB,MAAM;WAAS,MAAM;IAiBkC,CAAC;AACxF,eAAO,MAAM,UAAU,eAAsB;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;;;IAI1D,CAAC;AACN,eAAO,MAAM,WAAW,WACb,QAAQ,GAAG,gBAAgB,GAAG,aAAa,yBAChC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE;WAzBpC,MAAM;WAAS,MAAM;IAmC1B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
async function loadOptions(load) {
|
|
2
|
+
const options = [];
|
|
3
|
+
let after;
|
|
4
|
+
do {
|
|
5
|
+
const page = await load(after);
|
|
6
|
+
for (const node of page.nodes) {
|
|
7
|
+
options.push({ label: node.name ?? node.title ?? node.id, value: node.id });
|
|
8
|
+
}
|
|
9
|
+
after = page.pageInfo.hasNextPage ? (page.pageInfo.endCursor ?? undefined) : undefined;
|
|
10
|
+
} while (after);
|
|
11
|
+
return options;
|
|
12
|
+
}
|
|
13
|
+
export const teams = ({ client }) => loadOptions((after) => client.teams({ first: 100, after }));
|
|
14
|
+
export const users = ({ client }) => loadOptions((after) => client.users({ first: 100, after }));
|
|
15
|
+
export const projects = ({ client }) => loadOptions((after) => client.projects({ first: 100, after }));
|
|
16
|
+
export const priorities = async ({ client }) => (await client.issuePriorityValues).map(({ label, priority }) => ({
|
|
17
|
+
label,
|
|
18
|
+
value: String(priority),
|
|
19
|
+
}));
|
|
20
|
+
export const teamOptions = (method) => ({ client, input }) => input.teamId
|
|
21
|
+
? loadOptions((after) => client[method]({
|
|
22
|
+
first: 100,
|
|
23
|
+
after,
|
|
24
|
+
filter: { team: { id: { eq: input.teamId } } },
|
|
25
|
+
}))
|
|
26
|
+
: Promise.resolve([]);
|
|
27
|
+
//# sourceMappingURL=options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/actions/options.ts"],"names":[],"mappings":"AAOA,KAAK,UAAU,WAAW,CAAC,IAA6C;IACtE,MAAM,OAAO,GAA4C,EAAE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,KAAK,EAAE,EAAE,MAAM,EAAsB,EAAE,EAAE,CACjE,CAAC,MAAM,MAAM,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/D,KAAK;IACL,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC;CACxB,CAAC,CAAC,CAAC;AACN,MAAM,CAAC,MAAM,WAAW,GACtB,CAAC,MAAmD,EAAE,EAAE,CACxD,CAAC,EAAE,MAAM,EAAE,KAAK,EAAkD,EAAE,EAAE,CACpE,KAAK,CAAC,MAAM;IACV,CAAC,CAAC,WAAW,CACT,CAAC,KAAK,EAAE,EAAE,CACR,MAAM,CAAC,MAAM,CAAC,CAAC;QACb,KAAK,EAAE,GAAG;QACV,KAAK;QACL,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE;KAC/C,CAAwB,CAC5B;IACH,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type PieceRunArgs } from 'frogbot/pieces';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { Linear } from '../client.js';
|
|
4
|
+
declare const inputSchema: z.ZodObject<{
|
|
5
|
+
query: z.ZodString;
|
|
6
|
+
variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare const rawGraphqlQuery: {
|
|
9
|
+
slug: string;
|
|
10
|
+
description: string;
|
|
11
|
+
input: z.ZodObject<{
|
|
12
|
+
query: z.ZodString;
|
|
13
|
+
variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
output: z.ZodUnknown;
|
|
16
|
+
idempotent: boolean;
|
|
17
|
+
run({ client, input }: PieceRunArgs<z.output<typeof inputSchema>, object, Linear>): Promise<import("@linear/sdk").LinearRawResponse<unknown>>;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=rawGraphqlQuery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rawGraphqlQuery.d.ts","sourceRoot":"","sources":["../../src/actions/rawGraphqlQuery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,QAAA,MAAM,WAAW;;;iBAGf,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;2BAMG,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC;CAGxF,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const inputSchema = z.object({
|
|
3
|
+
query: z.string(),
|
|
4
|
+
variables: z.record(z.string(), z.unknown()).optional(),
|
|
5
|
+
});
|
|
6
|
+
export const rawGraphqlQuery = {
|
|
7
|
+
slug: 'rawGraphqlQuery',
|
|
8
|
+
description: 'Perform a raw GraphQL query against Linear.',
|
|
9
|
+
input: inputSchema,
|
|
10
|
+
output: z.unknown(),
|
|
11
|
+
idempotent: false,
|
|
12
|
+
async run({ client, input }) {
|
|
13
|
+
return client.client.rawRequest(input.query, input.variables);
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=rawGraphqlQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rawGraphqlQuery.js","sourceRoot":"","sources":["../../src/actions/rawGraphqlQuery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;CACxD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,6CAA6C;IAC1D,KAAK,EAAE,WAAW;IAClB,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;IACnB,UAAU,EAAE,KAAK;IACjB,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,KAAK,EAA8D;QACrF,OAAO,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAChE,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { type PieceRunArgs } from 'frogbot/pieces';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { Linear } from '../client.js';
|
|
4
|
+
declare const inputSchema: z.ZodObject<{
|
|
5
|
+
teamId: z.ZodString;
|
|
6
|
+
issueId: z.ZodString;
|
|
7
|
+
title: z.ZodOptional<z.ZodString>;
|
|
8
|
+
description: z.ZodOptional<z.ZodString>;
|
|
9
|
+
stateId: z.ZodOptional<z.ZodString>;
|
|
10
|
+
labelIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
11
|
+
assigneeId: z.ZodOptional<z.ZodString>;
|
|
12
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare const updateIssue: {
|
|
15
|
+
slug: string;
|
|
16
|
+
description: string;
|
|
17
|
+
input: z.ZodObject<{
|
|
18
|
+
teamId: z.ZodString;
|
|
19
|
+
issueId: z.ZodString;
|
|
20
|
+
title: z.ZodOptional<z.ZodString>;
|
|
21
|
+
description: z.ZodOptional<z.ZodString>;
|
|
22
|
+
stateId: z.ZodOptional<z.ZodString>;
|
|
23
|
+
labelIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
24
|
+
assigneeId: z.ZodOptional<z.ZodString>;
|
|
25
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
output: z.ZodObject<{
|
|
28
|
+
success: z.ZodBoolean;
|
|
29
|
+
lastSyncId: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
}, z.core.$loose>;
|
|
31
|
+
idempotent: boolean;
|
|
32
|
+
options: {
|
|
33
|
+
teamId: ({ client }: {
|
|
34
|
+
client: Linear;
|
|
35
|
+
}) => Promise<{
|
|
36
|
+
label: string;
|
|
37
|
+
value: string;
|
|
38
|
+
}[]>;
|
|
39
|
+
issueId: ({ client, input }: {
|
|
40
|
+
client: Linear;
|
|
41
|
+
input: {
|
|
42
|
+
teamId?: string;
|
|
43
|
+
};
|
|
44
|
+
}) => Promise<{
|
|
45
|
+
label: string;
|
|
46
|
+
value: string;
|
|
47
|
+
}[]>;
|
|
48
|
+
stateId: ({ client, input }: {
|
|
49
|
+
client: Linear;
|
|
50
|
+
input: {
|
|
51
|
+
teamId?: string;
|
|
52
|
+
};
|
|
53
|
+
}) => Promise<{
|
|
54
|
+
label: string;
|
|
55
|
+
value: string;
|
|
56
|
+
}[]>;
|
|
57
|
+
labelIds: ({ client, input }: {
|
|
58
|
+
client: Linear;
|
|
59
|
+
input: {
|
|
60
|
+
teamId?: string;
|
|
61
|
+
};
|
|
62
|
+
}) => Promise<{
|
|
63
|
+
label: string;
|
|
64
|
+
value: string;
|
|
65
|
+
}[]>;
|
|
66
|
+
assigneeId: ({ client }: {
|
|
67
|
+
client: Linear;
|
|
68
|
+
}) => Promise<{
|
|
69
|
+
label: string;
|
|
70
|
+
value: string;
|
|
71
|
+
}[]>;
|
|
72
|
+
priority: ({ client }: {
|
|
73
|
+
client: Linear;
|
|
74
|
+
}) => Promise<{
|
|
75
|
+
label: string;
|
|
76
|
+
value: string;
|
|
77
|
+
}[]>;
|
|
78
|
+
};
|
|
79
|
+
run({ client, input }: PieceRunArgs<z.output<typeof inputSchema>, object, Linear>): Promise<{
|
|
80
|
+
success: boolean;
|
|
81
|
+
lastSyncId: number;
|
|
82
|
+
issue: {
|
|
83
|
+
id: string | undefined;
|
|
84
|
+
};
|
|
85
|
+
}>;
|
|
86
|
+
};
|
|
87
|
+
export {};
|
|
88
|
+
//# sourceMappingURL=updateIssue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateIssue.d.ts","sourceRoot":"","sources":["../../src/actions/updateIssue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,QAAA,MAAM,WAAW;;;;;;;;;iBASf,CAAC;AAGH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAwBqD,CAAC;;;;;;;;;sBAAD,CAAC;;;;;;;;;sBAAD,CAAC;;;;;;;;;;;;;;;;;;;2BAV/C,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC;;;;;;;CASxF,CAAC"}
|