@shipfox/api-integration-core 11.0.0 → 12.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 +4 -4
- package/CHANGELOG.md +62 -0
- package/dist/core/providers/source-control.d.ts +1 -1
- package/dist/core/providers/source-control.d.ts.map +1 -1
- package/dist/core/providers/source-control.js.map +1 -1
- package/dist/core/source-control-service.d.ts +7 -1
- package/dist/core/source-control-service.d.ts.map +1 -1
- package/dist/core/source-control-service.js +11 -0
- package/dist/core/source-control-service.js.map +1 -1
- package/dist/db/connections.d.ts +6 -0
- package/dist/db/connections.d.ts.map +1 -1
- package/dist/db/connections.js +6 -0
- package/dist/db/connections.js.map +1 -1
- package/dist/db/webhook-deliveries.d.ts +18 -1
- package/dist/db/webhook-deliveries.d.ts.map +1 -1
- package/dist/db/webhook-deliveries.js +65 -19
- package/dist/db/webhook-deliveries.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/presentation/inter-module.d.ts.map +1 -1
- package/dist/presentation/inter-module.js +10 -1
- package/dist/presentation/inter-module.js.map +1 -1
- package/dist/providers/github.d.ts.map +1 -1
- package/dist/providers/github.js +2 -1
- package/dist/providers/github.js.map +1 -1
- package/dist/providers/jira.d.ts.map +1 -1
- package/dist/providers/jira.js +35 -12
- package/dist/providers/jira.js.map +1 -1
- package/dist/providers/types.d.ts +1 -1
- package/dist/providers/types.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +20 -20
- package/src/core/agent-tool-selection.test.ts +1 -0
- package/src/core/providers/registry.test.ts +1 -0
- package/src/core/providers/source-control.ts +1 -0
- package/src/core/source-control-service.test.ts +25 -0
- package/src/core/source-control-service.ts +21 -0
- package/src/db/connections.test.ts +18 -0
- package/src/db/connections.ts +25 -0
- package/src/db/webhook-deliveries.test.ts +77 -0
- package/src/db/webhook-deliveries.ts +110 -21
- package/src/index.ts +13 -3
- package/src/presentation/inter-module.ts +11 -1
- package/src/presentation/routes/list-repositories.test.ts +1 -0
- package/src/providers/github.ts +2 -0
- package/src/providers/jira.test.ts +2 -0
- package/src/providers/jira.ts +38 -12
- package/src/providers/types.ts +1 -1
- package/test/env.ts +0 -1
- package/test/route-utils.ts +1 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/src/providers/jira.ts
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
upsertIntegrationConnection,
|
|
14
14
|
} from '#db/connections.js';
|
|
15
15
|
import {db} from '#db/db.js';
|
|
16
|
+
import {publishIntegrationEventReceived, recordDeliveryOnly} from '#db/webhook-deliveries.js';
|
|
16
17
|
import {retryConnectionSlugCollision, slugifyConnectionSlug} from '#providers/connection-slug.js';
|
|
17
18
|
import type {IntegrationModuleParts, IntegrationProviderModule} from '#providers/types.js';
|
|
18
19
|
|
|
@@ -140,19 +141,44 @@ async function loadJiraModuleParts(
|
|
|
140
141
|
});
|
|
141
142
|
const pendingStore = createJiraPendingSelectionStore({secrets});
|
|
142
143
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
144
|
+
const integrationProvider = createJiraIntegrationProvider({
|
|
145
|
+
routes: {
|
|
146
|
+
tokenStore,
|
|
147
|
+
pendingStore,
|
|
148
|
+
getExistingJiraConnection,
|
|
149
|
+
connectJiraInstallation,
|
|
150
|
+
disconnectJiraInstallation,
|
|
151
|
+
coreDb: db,
|
|
152
|
+
publishIntegrationEventReceived,
|
|
153
|
+
recordDeliveryOnly,
|
|
154
|
+
getIntegrationConnectionById,
|
|
155
|
+
markConnectionActive: async ({connectionId, tx}) => {
|
|
156
|
+
await updateIntegrationConnectionLifecycleStatus(
|
|
157
|
+
{
|
|
158
|
+
id: connectionId,
|
|
159
|
+
lifecycleStatus: 'active',
|
|
160
|
+
},
|
|
161
|
+
tx === undefined ? {} : {tx: tx as IntegrationTx},
|
|
162
|
+
);
|
|
154
163
|
},
|
|
155
|
-
|
|
164
|
+
markConnectionError: async ({connectionId, tx}) => {
|
|
165
|
+
await updateIntegrationConnectionLifecycleStatus(
|
|
166
|
+
{
|
|
167
|
+
id: connectionId,
|
|
168
|
+
lifecycleStatus: 'error',
|
|
169
|
+
},
|
|
170
|
+
tx === undefined ? {} : {tx: tx as IntegrationTx},
|
|
171
|
+
);
|
|
172
|
+
},
|
|
173
|
+
...(options.requireActiveWorkspaceMembership
|
|
174
|
+
? {requireActiveWorkspaceMembership: options.requireActiveWorkspaceMembership}
|
|
175
|
+
: {}),
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
return {
|
|
180
|
+
provider: integrationProvider,
|
|
181
|
+
webhookProcessors: integrationProvider.webhookProcessors,
|
|
156
182
|
database: {db: jiraDb, migrationsPath, databaseNamespace: 'integrations_jira'},
|
|
157
183
|
};
|
|
158
184
|
}
|
package/src/providers/types.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type {IntegrationProvider} from '#core/entities/provider.js';
|
|
|
10
10
|
* and one-shot boot-time tasks. Providers that own none of these simply omit them.
|
|
11
11
|
*
|
|
12
12
|
* A startup task is run once after modules are initialized (migrations done). The
|
|
13
|
-
* provider owns its own wiring
|
|
13
|
+
* provider owns its own wiring: core runs each task generically and isolates
|
|
14
14
|
* failures so a task can never gate API boot.
|
|
15
15
|
*/
|
|
16
16
|
export interface IntegrationModuleParts {
|
package/test/env.ts
CHANGED
|
@@ -15,7 +15,6 @@ process.env.GITHUB_INSTALL_STATE_SECRET = 'test-install-state-secret';
|
|
|
15
15
|
process.env.JIRA_OAUTH_CLIENT_ID = 'test-client-id';
|
|
16
16
|
process.env.JIRA_OAUTH_CLIENT_SECRET = 'test-client-secret';
|
|
17
17
|
process.env.JIRA_OAUTH_REDIRECT_URL = 'https://shipfox.example.com/integrations/jira/callback';
|
|
18
|
-
process.env.JIRA_WEBHOOK_SIGNING_SECRET = 'test-webhook-secret';
|
|
19
18
|
process.env.JIRA_WEBHOOK_BASE_URL = 'https://shipfox.example.com';
|
|
20
19
|
process.env.JIRA_API_BASE_URL = 'https://jira.example.com/api';
|
|
21
20
|
process.env.JIRA_AUTH_BASE_URL = 'https://jira.example.com/auth';
|