@shipfox/api-integration-linear-dto 12.0.0 → 14.0.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +20 -0
- package/dist/event-catalog.d.ts +23 -0
- package/dist/event-catalog.d.ts.map +1 -0
- package/dist/event-catalog.js +48 -0
- package/dist/event-catalog.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/schemas/index.d.ts +11 -11
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/event-catalog.test.ts +20 -0
- package/src/event-catalog.ts +65 -0
- package/src/index.ts +1 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
$ shipfox-swc
|
|
2
|
-
Successfully compiled:
|
|
2
|
+
Successfully compiled: 3 files with swc (362.77ms)
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @shipfox/api-integration-linear-dto
|
|
2
2
|
|
|
3
|
+
## 14.0.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 2323e2e: Adds event catalog exports to the Linear, Slack, and Jira DTO packages.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [18e9bad]
|
|
12
|
+
- Updated dependencies [c44641f]
|
|
13
|
+
- Updated dependencies [1b71a66]
|
|
14
|
+
- @shipfox/api-integration-core-dto@14.0.0
|
|
15
|
+
|
|
16
|
+
## 12.2.0
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies [7901a60]
|
|
21
|
+
- @shipfox/api-integration-core-dto@12.2.0
|
|
22
|
+
|
|
3
23
|
## 12.0.0
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const linearEventCatalog: {
|
|
2
|
+
readonly provider: 'Linear';
|
|
3
|
+
readonly events: readonly ({
|
|
4
|
+
name: string;
|
|
5
|
+
summary: string;
|
|
6
|
+
emittedWhen: string;
|
|
7
|
+
payloadKind: 'raw-provider';
|
|
8
|
+
payloadDocUrl: string;
|
|
9
|
+
} | {
|
|
10
|
+
summary: 'A Linear agent session is created.';
|
|
11
|
+
emittedWhen: 'Linear creates an agent session after a user mentions or delegates to the app.';
|
|
12
|
+
name: "agentSession.created" | "agentSession.prompted";
|
|
13
|
+
payloadKind: 'raw-provider';
|
|
14
|
+
payloadDocUrl: string;
|
|
15
|
+
} | {
|
|
16
|
+
summary: 'A user adds a prompt to a Linear agent session.';
|
|
17
|
+
emittedWhen: 'Linear sends an AgentSessionEvent webhook with the prompted action.';
|
|
18
|
+
name: "agentSession.created" | "agentSession.prompted";
|
|
19
|
+
payloadKind: 'raw-provider';
|
|
20
|
+
payloadDocUrl: string;
|
|
21
|
+
})[];
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=event-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-catalog.d.ts","sourceRoot":"","sources":["../src/event-catalog.ts"],"names":[],"mappings":"AAyCA,eAAO,MAAM,kBAAkB;uBACnB,QAAQ;;;;;qBAOC,cAAc;;;iBAvBtB,oCAAoC;qBAChC,gFAAgF;;qBA6B9E,cAAc;;;iBA1BpB,iDAAiD;qBAC7C,qEAAqE;;qBAyBnE,cAAc;;;CAIW,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { linearAgentSessionWebhookEventNames, linearWebhookActions, linearWebhookResourceTypes } from './schemas/index.js';
|
|
2
|
+
const linearWebhookDocsUrl = 'https://linear.app/developers/webhooks';
|
|
3
|
+
const linearAgentInteractionDocsUrl = 'https://linear.app/developers/agent-interaction';
|
|
4
|
+
const resourceLabels = {
|
|
5
|
+
Issue: 'issue',
|
|
6
|
+
Comment: 'comment',
|
|
7
|
+
IssueLabel: 'issue label',
|
|
8
|
+
Project: 'project',
|
|
9
|
+
Cycle: 'cycle'
|
|
10
|
+
};
|
|
11
|
+
const dataEventSummaryByAction = {
|
|
12
|
+
create: 'is created.',
|
|
13
|
+
update: 'changes.',
|
|
14
|
+
remove: 'is removed.'
|
|
15
|
+
};
|
|
16
|
+
const agentSessionDetails = {
|
|
17
|
+
'agentSession.created': {
|
|
18
|
+
summary: 'A Linear agent session is created.',
|
|
19
|
+
emittedWhen: 'Linear creates an agent session after a user mentions or delegates to the app.'
|
|
20
|
+
},
|
|
21
|
+
'agentSession.prompted': {
|
|
22
|
+
summary: 'A user adds a prompt to a Linear agent session.',
|
|
23
|
+
emittedWhen: 'Linear sends an AgentSessionEvent webhook with the prompted action.'
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
export const linearEventCatalog = {
|
|
27
|
+
provider: 'Linear',
|
|
28
|
+
events: [
|
|
29
|
+
...linearWebhookResourceTypes.flatMap((type)=>linearWebhookActions.map((action)=>({
|
|
30
|
+
name: `${type}.${action}`,
|
|
31
|
+
summary: dataEventSummary(resourceLabels[type], action),
|
|
32
|
+
emittedWhen: `Linear sends a webhook for ${type} with the ${action} action.`,
|
|
33
|
+
payloadKind: 'raw-provider',
|
|
34
|
+
payloadDocUrl: linearWebhookDocsUrl
|
|
35
|
+
}))),
|
|
36
|
+
...linearAgentSessionWebhookEventNames.map((name)=>({
|
|
37
|
+
name,
|
|
38
|
+
...agentSessionDetails[name],
|
|
39
|
+
payloadKind: 'raw-provider',
|
|
40
|
+
payloadDocUrl: linearAgentInteractionDocsUrl
|
|
41
|
+
}))
|
|
42
|
+
]
|
|
43
|
+
};
|
|
44
|
+
function dataEventSummary(resource, action) {
|
|
45
|
+
return `A Linear ${resource} ${dataEventSummaryByAction[action]}`;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=event-catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/event-catalog.ts"],"sourcesContent":["import type {IntegrationEventCatalog} from '@shipfox/api-integration-core-dto';\nimport {\n linearAgentSessionWebhookEventNames,\n linearWebhookActions,\n linearWebhookResourceTypes,\n} from './schemas/index.js';\n\nconst linearWebhookDocsUrl = 'https://linear.app/developers/webhooks';\nconst linearAgentInteractionDocsUrl = 'https://linear.app/developers/agent-interaction';\n\nconst resourceLabels = {\n Issue: 'issue',\n Comment: 'comment',\n IssueLabel: 'issue label',\n Project: 'project',\n Cycle: 'cycle',\n} as const satisfies Record<(typeof linearWebhookResourceTypes)[number], string>;\n\nconst dataEventSummaryByAction = {\n create: 'is created.',\n update: 'changes.',\n remove: 'is removed.',\n} as const satisfies Record<(typeof linearWebhookActions)[number], string>;\n\nconst agentSessionDetails = {\n 'agentSession.created': {\n summary: 'A Linear agent session is created.',\n emittedWhen: 'Linear creates an agent session after a user mentions or delegates to the app.',\n },\n 'agentSession.prompted': {\n summary: 'A user adds a prompt to a Linear agent session.',\n emittedWhen: 'Linear sends an AgentSessionEvent webhook with the prompted action.',\n },\n} as const satisfies Record<\n (typeof linearAgentSessionWebhookEventNames)[number],\n {\n summary: string;\n emittedWhen: string;\n }\n>;\n\nexport const linearEventCatalog = {\n provider: 'Linear',\n events: [\n ...linearWebhookResourceTypes.flatMap((type) =>\n linearWebhookActions.map((action) => ({\n name: `${type}.${action}`,\n summary: dataEventSummary(resourceLabels[type], action),\n emittedWhen: `Linear sends a webhook for ${type} with the ${action} action.`,\n payloadKind: 'raw-provider' as const,\n payloadDocUrl: linearWebhookDocsUrl,\n })),\n ),\n ...linearAgentSessionWebhookEventNames.map((name) => ({\n name,\n ...agentSessionDetails[name],\n payloadKind: 'raw-provider' as const,\n payloadDocUrl: linearAgentInteractionDocsUrl,\n })),\n ],\n} as const satisfies IntegrationEventCatalog;\n\nfunction dataEventSummary(resource: string, action: (typeof linearWebhookActions)[number]): string {\n return `A Linear ${resource} ${dataEventSummaryByAction[action]}`;\n}\n"],"names":["linearAgentSessionWebhookEventNames","linearWebhookActions","linearWebhookResourceTypes","linearWebhookDocsUrl","linearAgentInteractionDocsUrl","resourceLabels","Issue","Comment","IssueLabel","Project","Cycle","dataEventSummaryByAction","create","update","remove","agentSessionDetails","summary","emittedWhen","linearEventCatalog","provider","events","flatMap","type","map","action","name","dataEventSummary","payloadKind","payloadDocUrl","resource"],"mappings":"AACA,SACEA,mCAAmC,EACnCC,oBAAoB,EACpBC,0BAA0B,QACrB,qBAAqB;AAE5B,MAAMC,uBAAuB;AAC7B,MAAMC,gCAAgC;AAEtC,MAAMC,iBAAiB;IACrBC,OAAO;IACPC,SAAS;IACTC,YAAY;IACZC,SAAS;IACTC,OAAO;AACT;AAEA,MAAMC,2BAA2B;IAC/BC,QAAQ;IACRC,QAAQ;IACRC,QAAQ;AACV;AAEA,MAAMC,sBAAsB;IAC1B,wBAAwB;QACtBC,SAAS;QACTC,aAAa;IACf;IACA,yBAAyB;QACvBD,SAAS;QACTC,aAAa;IACf;AACF;AAQA,OAAO,MAAMC,qBAAqB;IAChCC,UAAU;IACVC,QAAQ;WACHlB,2BAA2BmB,OAAO,CAAC,CAACC,OACrCrB,qBAAqBsB,GAAG,CAAC,CAACC,SAAY,CAAA;oBACpCC,MAAM,GAAGH,KAAK,CAAC,EAAEE,QAAQ;oBACzBR,SAASU,iBAAiBrB,cAAc,CAACiB,KAAK,EAAEE;oBAChDP,aAAa,CAAC,2BAA2B,EAAEK,KAAK,UAAU,EAAEE,OAAO,QAAQ,CAAC;oBAC5EG,aAAa;oBACbC,eAAezB;gBACjB,CAAA;WAECH,oCAAoCuB,GAAG,CAAC,CAACE,OAAU,CAAA;gBACpDA;gBACA,GAAGV,mBAAmB,CAACU,KAAK;gBAC5BE,aAAa;gBACbC,eAAexB;YACjB,CAAA;KACD;AACH,EAA6C;AAE7C,SAASsB,iBAAiBG,QAAgB,EAAEL,MAA6C;IACvF,OAAO,CAAC,SAAS,EAAEK,SAAS,CAAC,EAAElB,wBAAwB,CAACa,OAAO,EAAE;AACnE"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './schemas/index.js';\n"],"names":[],"mappings":"AAAA,cAAc,qBAAqB"}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './event-catalog.js';\nexport * from './schemas/index.js';\n"],"names":[],"mappings":"AAAA,cAAc,qBAAqB;AACnC,cAAc,qBAAqB"}
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const LINEAR_PROVIDER = "linear";
|
|
3
3
|
export type LinearProvider = typeof LINEAR_PROVIDER;
|
|
4
|
-
export declare const linearWebhookResourceTypes: readonly [
|
|
5
|
-
export declare const linearWebhookActions: readonly [
|
|
6
|
-
export declare const linearAgentSessionWebhookActions: readonly [
|
|
4
|
+
export declare const linearWebhookResourceTypes: readonly ['Issue', 'Comment', 'IssueLabel', 'Project', 'Cycle'];
|
|
5
|
+
export declare const linearWebhookActions: readonly ['create', 'update', 'remove'];
|
|
6
|
+
export declare const linearAgentSessionWebhookActions: readonly ['created', 'prompted'];
|
|
7
7
|
export declare const linearAgentSessionWebhookEventNames: ("agentSession.created" | "agentSession.prompted")[];
|
|
8
|
-
export declare const linearWebhookEventNames: readonly ("
|
|
8
|
+
export declare const linearWebhookEventNames: readonly ("Comment.create" | "Comment.remove" | "Comment.update" | "Cycle.create" | "Cycle.remove" | "Cycle.update" | "Issue.create" | "Issue.remove" | "Issue.update" | "IssueLabel.create" | "IssueLabel.remove" | "IssueLabel.update" | "Project.create" | "Project.remove" | "Project.update" | "agentSession.created" | "agentSession.prompted")[];
|
|
9
9
|
export type LinearWebhookResourceType = (typeof linearWebhookResourceTypes)[number];
|
|
10
10
|
export type LinearWebhookAction = (typeof linearWebhookActions)[number];
|
|
11
11
|
export type LinearAgentSessionWebhookAction = (typeof linearAgentSessionWebhookActions)[number];
|
|
@@ -35,15 +35,15 @@ export type LinearAgentSessionWebhookEnvelopeDto = z.infer<typeof linearAgentSes
|
|
|
35
35
|
export declare const linearWebhookEnvelopeSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
36
36
|
action: z.ZodEnum<{
|
|
37
37
|
create: "create";
|
|
38
|
-
update: "update";
|
|
39
38
|
remove: "remove";
|
|
39
|
+
update: "update";
|
|
40
40
|
}>;
|
|
41
41
|
type: z.ZodEnum<{
|
|
42
|
-
Issue: "Issue";
|
|
43
42
|
Comment: "Comment";
|
|
43
|
+
Cycle: "Cycle";
|
|
44
|
+
Issue: "Issue";
|
|
44
45
|
IssueLabel: "IssueLabel";
|
|
45
46
|
Project: "Project";
|
|
46
|
-
Cycle: "Cycle";
|
|
47
47
|
}>;
|
|
48
48
|
organizationId: z.ZodString;
|
|
49
49
|
webhookTimestamp: z.ZodNumber;
|
|
@@ -100,13 +100,13 @@ export declare const linearCallbackResponseSchema: z.ZodObject<{
|
|
|
100
100
|
slug: z.ZodString;
|
|
101
101
|
display_name: z.ZodString;
|
|
102
102
|
lifecycle_status: z.ZodEnum<{
|
|
103
|
-
error: "error";
|
|
104
103
|
active: "active";
|
|
105
104
|
disabled: "disabled";
|
|
105
|
+
error: "error";
|
|
106
106
|
}>;
|
|
107
107
|
capabilities: z.ZodArray<z.ZodEnum<{
|
|
108
|
-
source_control: "source_control";
|
|
109
108
|
agent_tools: "agent_tools";
|
|
109
|
+
source_control: "source_control";
|
|
110
110
|
}>>;
|
|
111
111
|
external_url: z.ZodOptional<z.ZodString>;
|
|
112
112
|
created_at: z.ZodString;
|
|
@@ -131,13 +131,13 @@ export declare const createE2eLinearConnectionResponseSchema: z.ZodObject<{
|
|
|
131
131
|
slug: z.ZodString;
|
|
132
132
|
display_name: z.ZodString;
|
|
133
133
|
lifecycle_status: z.ZodEnum<{
|
|
134
|
-
error: "error";
|
|
135
134
|
active: "active";
|
|
136
135
|
disabled: "disabled";
|
|
136
|
+
error: "error";
|
|
137
137
|
}>;
|
|
138
138
|
capabilities: z.ZodArray<z.ZodEnum<{
|
|
139
|
-
source_control: "source_control";
|
|
140
139
|
agent_tools: "agent_tools";
|
|
140
|
+
source_control: "source_control";
|
|
141
141
|
}>>;
|
|
142
142
|
external_url: z.ZodOptional<z.ZodString>;
|
|
143
143
|
created_at: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,eAAe,WAAW,CAAC;AAExC,MAAM,MAAM,cAAc,GAAG,OAAO,eAAe,CAAC;AAEpD,eAAO,MAAM,0BAA0B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,eAAe,WAAW,CAAC;AAExC,MAAM,MAAM,cAAc,GAAG,OAAO,eAAe,CAAC;AAEpD,eAAO,MAAM,0BAA0B,YACrC,OAAO,EACP,SAAS,EACT,YAAY,EACZ,SAAS,EACT,OAAO,CACC,CAAC;AACX,e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