@shipfox/api-integration-linear 3.0.0 → 4.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shipfox/api-integration-linear",
3
3
  "license": "MIT",
4
- "version": "3.0.0",
4
+ "version": "4.0.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/ShipfoxHQ/shipfox.git",
@@ -39,15 +39,15 @@
39
39
  "@shipfox/api-auth-context": "3.0.0",
40
40
  "@shipfox/api-integration-core-dto": "3.0.0",
41
41
  "@shipfox/api-integration-linear-dto": "3.0.0",
42
- "@shipfox/api-workspaces": "3.0.0",
42
+ "@shipfox/api-workspaces": "4.0.0",
43
43
  "@shipfox/config": "1.2.1",
44
- "@shipfox/node-drizzle": "0.2.1",
44
+ "@shipfox/node-drizzle": "0.3.0",
45
45
  "@shipfox/node-fastify": "0.2.2",
46
46
  "@shipfox/node-opentelemetry": "0.5.1",
47
47
  "@shipfox/node-postgres": "0.4.1"
48
48
  },
49
49
  "peerDependencies": {
50
- "@shipfox/api-secrets": "3.0.0"
50
+ "@shipfox/api-secrets": "4.0.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/pg": "^8.15.5",
@@ -57,8 +57,8 @@
57
57
  "@shipfox/biome": "1.8.1",
58
58
  "@shipfox/swc": "1.2.5",
59
59
  "@shipfox/ts-config": "1.3.8",
60
- "@shipfox/typescript": "1.1.6",
61
- "@shipfox/vitest": "1.2.2"
60
+ "@shipfox/vitest": "1.2.2",
61
+ "@shipfox/typescript": "1.1.6"
62
62
  },
63
63
  "scripts": {
64
64
  "build": "shipfox-swc",
@@ -1,3 +1,4 @@
1
+ import {isUniqueViolation} from '@shipfox/node-drizzle';
1
2
  import {pgClient} from '@shipfox/node-postgres';
2
3
  import {eq} from 'drizzle-orm';
3
4
  import {
@@ -41,12 +42,6 @@ export interface UpdateLinearInstallationTokenExpiryParams {
41
42
  type LinearDb = ReturnType<typeof db>;
42
43
  type LinearTx = Parameters<Parameters<LinearDb['transaction']>[0]>[0];
43
44
 
44
- interface PostgresErrorFields {
45
- code?: unknown;
46
- constraint?: unknown;
47
- cause?: unknown;
48
- }
49
-
50
45
  export async function upsertLinearInstallation(
51
46
  params: UpsertLinearInstallationParams,
52
47
  options: {tx?: unknown} = {},
@@ -93,18 +88,6 @@ export async function upsertLinearInstallation(
93
88
  return toLinearInstallation(row);
94
89
  }
95
90
 
96
- function isUniqueViolation(error: unknown, constraint: string): boolean {
97
- let current = error;
98
- while (typeof current === 'object' && current !== null) {
99
- const postgresError = current as PostgresErrorFields;
100
- if (postgresError.code === '23505' && postgresError.constraint === constraint) {
101
- return true;
102
- }
103
- current = postgresError.cause;
104
- }
105
- return false;
106
- }
107
-
108
91
  export async function getLinearInstallationByConnectionId(
109
92
  connectionId: string,
110
93
  options: {tx?: unknown} = {},