@shipfox/client-integrations 4.0.0 → 6.0.1
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 +86 -0
- package/dist/application/complete-integration-callback.d.ts +13 -0
- package/dist/application/complete-integration-callback.d.ts.map +1 -0
- package/dist/application/complete-integration-callback.js +26 -0
- package/dist/application/complete-integration-callback.js.map +1 -0
- package/dist/components/connection-picker.d.ts +2 -2
- package/dist/components/connection-picker.d.ts.map +1 -1
- package/dist/components/connection-picker.js +4 -4
- package/dist/components/connection-picker.js.map +1 -1
- package/dist/components/installed-integrations-section.d.ts +8 -6
- package/dist/components/installed-integrations-section.d.ts.map +1 -1
- package/dist/components/installed-integrations-section.js +22 -15
- package/dist/components/installed-integrations-section.js.map +1 -1
- package/dist/components/integration-gallery-for-workspace.d.ts +2 -2
- package/dist/components/integration-gallery-for-workspace.d.ts.map +1 -1
- package/dist/components/integration-gallery-for-workspace.js +14 -7
- package/dist/components/integration-gallery-for-workspace.js.map +1 -1
- package/dist/components/integration-gallery.d.ts +2 -2
- package/dist/components/integration-gallery.d.ts.map +1 -1
- package/dist/components/integration-gallery.js.map +1 -1
- package/dist/components/integration-usage-events.d.ts +1 -3
- package/dist/components/integration-usage-events.d.ts.map +1 -1
- package/dist/components/integration-usage-events.js +1 -125
- package/dist/components/integration-usage-events.js.map +1 -1
- package/dist/components/integration-usage-modal.d.ts +2 -2
- package/dist/components/integration-usage-modal.d.ts.map +1 -1
- package/dist/components/integration-usage-modal.js +2 -2
- package/dist/components/integration-usage-modal.js.map +1 -1
- package/dist/components/provider-grid.d.ts +7 -4
- package/dist/components/provider-grid.d.ts.map +1 -1
- package/dist/components/provider-grid.js +15 -10
- package/dist/components/provider-grid.js.map +1 -1
- package/dist/components/redirect-install-page.d.ts +2 -3
- package/dist/components/redirect-install-page.d.ts.map +1 -1
- package/dist/components/redirect-install-page.js +1 -1
- package/dist/components/redirect-install-page.js.map +1 -1
- package/dist/components/repository-picker.d.ts +2 -2
- package/dist/components/repository-picker.d.ts.map +1 -1
- package/dist/components/repository-picker.js +4 -4
- package/dist/components/repository-picker.js.map +1 -1
- package/dist/components/webhook/webhook-create-modal.d.ts +2 -2
- package/dist/components/webhook/webhook-create-modal.d.ts.map +1 -1
- package/dist/components/webhook/webhook-create-modal.js +8 -8
- package/dist/components/webhook/webhook-create-modal.js.map +1 -1
- package/dist/components/webhook/webhook-modals.stories.d.ts.map +1 -1
- package/dist/components/webhook/webhook-modals.stories.js +7 -7
- package/dist/components/webhook/webhook-modals.stories.js.map +1 -1
- package/dist/components/webhook/webhook-usage-details.d.ts.map +1 -1
- package/dist/components/webhook/webhook-usage-details.js +2 -2
- package/dist/components/webhook/webhook-usage-details.js.map +1 -1
- package/dist/connection-status-badge.d.ts +2 -2
- package/dist/connection-status-badge.d.ts.map +1 -1
- package/dist/connection-status-badge.js +11 -15
- package/dist/connection-status-badge.js.map +1 -1
- package/dist/core/models.d.ts +66 -0
- package/dist/core/models.d.ts.map +1 -0
- package/dist/core/models.js +156 -0
- package/dist/core/models.js.map +1 -0
- package/dist/feature.d.ts +18 -0
- package/dist/feature.d.ts.map +1 -1
- package/dist/feature.js +16 -1
- package/dist/feature.js.map +1 -1
- package/dist/hooks/api/integration-mapper.d.ts +11 -0
- package/dist/hooks/api/integration-mapper.d.ts.map +1 -0
- package/dist/hooks/api/integration-mapper.js +54 -0
- package/dist/hooks/api/integration-mapper.js.map +1 -0
- package/dist/hooks/api/integrations.d.ts +47 -237
- package/dist/hooks/api/integrations.d.ts.map +1 -1
- package/dist/hooks/api/integrations.js +92 -42
- package/dist/hooks/api/integrations.js.map +1 -1
- package/dist/hooks/api/webhook-connections.d.ts +12 -64
- package/dist/hooks/api/webhook-connections.d.ts.map +1 -1
- package/dist/hooks/api/webhook-connections.js +17 -9
- package/dist/hooks/api/webhook-connections.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/linear-callback.d.ts +2 -1
- package/dist/linear-callback.d.ts.map +1 -1
- package/dist/linear-callback.js +14 -15
- package/dist/linear-callback.js.map +1 -1
- package/dist/pages/gitea-install-page.d.ts.map +1 -1
- package/dist/pages/gitea-install-page.js +1 -10
- package/dist/pages/gitea-install-page.js.map +1 -1
- package/dist/pages/linear-callback-page.d.ts.map +1 -1
- package/dist/pages/linear-callback-page.js +19 -32
- package/dist/pages/linear-callback-page.js.map +1 -1
- package/dist/pages/linear-install-page.d.ts.map +1 -1
- package/dist/pages/linear-install-page.js +2 -1
- package/dist/pages/linear-install-page.js.map +1 -1
- package/dist/pages/sentry-callback-page.d.ts.map +1 -1
- package/dist/pages/sentry-callback-page.js +22 -25
- package/dist/pages/sentry-callback-page.js.map +1 -1
- package/dist/pages/sentry-install-page.d.ts.map +1 -1
- package/dist/pages/sentry-install-page.js +2 -1
- package/dist/pages/sentry-install-page.js.map +1 -1
- package/dist/pages/slack-callback-page.d.ts.map +1 -1
- package/dist/pages/slack-callback-page.js +21 -28
- package/dist/pages/slack-callback-page.js.map +1 -1
- package/dist/pages/slack-install-page.d.ts.map +1 -1
- package/dist/pages/slack-install-page.js +2 -1
- package/dist/pages/slack-install-page.js.map +1 -1
- package/dist/pages/source-control-onboarding-page.d.ts.map +1 -1
- package/dist/pages/source-control-onboarding-page.js +5 -1
- package/dist/pages/source-control-onboarding-page.js.map +1 -1
- package/dist/provider-catalog.d.ts.map +1 -1
- package/dist/provider-catalog.js +7 -6
- package/dist/provider-catalog.js.map +1 -1
- package/dist/routes/github-callback.d.ts +16 -0
- package/dist/routes/github-callback.d.ts.map +1 -1
- package/dist/routes/github-callback.js +43 -21
- package/dist/routes/github-callback.js.map +1 -1
- package/dist/routes/integrations-settings.d.ts +6 -0
- package/dist/routes/integrations-settings.d.ts.map +1 -0
- package/dist/routes/integrations-settings.js +7 -0
- package/dist/routes/integrations-settings.js.map +1 -0
- package/dist/routes/linear-callback.d.ts +2 -0
- package/dist/routes/linear-callback.d.ts.map +1 -1
- package/dist/routes/linear-callback.js +2 -0
- package/dist/routes/linear-callback.js.map +1 -1
- package/dist/routes/sentry-callback.d.ts +2 -0
- package/dist/routes/sentry-callback.d.ts.map +1 -1
- package/dist/routes/sentry-callback.js +2 -0
- package/dist/routes/sentry-callback.js.map +1 -1
- package/dist/routes/slack-callback.d.ts +2 -0
- package/dist/routes/slack-callback.d.ts.map +1 -1
- package/dist/routes/slack-callback.js +2 -0
- package/dist/routes/slack-callback.js.map +1 -1
- package/dist/sentry-callback.d.ts +2 -1
- package/dist/sentry-callback.d.ts.map +1 -1
- package/dist/sentry-callback.js +16 -19
- package/dist/sentry-callback.js.map +1 -1
- package/dist/slack-callback.d.ts +2 -1
- package/dist/slack-callback.d.ts.map +1 -1
- package/dist/slack-callback.js +14 -15
- package/dist/slack-callback.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +17 -17
- package/src/application/complete-integration-callback.test.ts +41 -0
- package/src/application/complete-integration-callback.ts +39 -0
- package/src/components/connection-picker.tsx +7 -7
- package/src/components/installed-integrations-section.tsx +29 -24
- package/src/components/integration-gallery-for-workspace.tsx +23 -16
- package/src/components/integration-gallery.tsx +3 -3
- package/src/components/integration-usage-events.ts +1 -116
- package/src/components/integration-usage-modal.tsx +4 -4
- package/src/components/provider-grid.tsx +30 -18
- package/src/components/redirect-install-page.test.tsx +2 -6
- package/src/components/redirect-install-page.tsx +3 -2
- package/src/components/repository-picker.tsx +6 -6
- package/src/components/webhook/webhook-create-modal.tsx +12 -11
- package/src/components/webhook/webhook-modals.stories.tsx +10 -10
- package/src/components/webhook/webhook-usage-details.tsx +2 -4
- package/src/connection-status-badge.tsx +8 -14
- package/src/core/models.ts +200 -0
- package/src/feature.ts +17 -1
- package/src/hooks/api/integration-mapper.ts +64 -0
- package/src/hooks/api/integrations.test.ts +44 -22
- package/src/hooks/api/integrations.ts +258 -89
- package/src/hooks/api/webhook-connections.ts +58 -17
- package/src/index.ts +2 -1
- package/src/linear-callback.ts +21 -16
- package/src/pages/gitea-install-page.tsx +1 -10
- package/src/pages/linear-callback-page.test.tsx +1 -1
- package/src/pages/linear-callback-page.tsx +18 -29
- package/src/pages/linear-install-page.tsx +2 -1
- package/src/pages/sentry-callback-page.test.tsx +6 -2
- package/src/pages/sentry-callback-page.tsx +28 -25
- package/src/pages/sentry-install-page.tsx +2 -1
- package/src/pages/slack-callback-page.tsx +20 -25
- package/src/pages/slack-install-page.tsx +2 -1
- package/src/pages/source-control-onboarding-page.tsx +5 -1
- package/src/provider-catalog.ts +7 -6
- package/src/routes/github-callback.test.ts +35 -1
- package/src/routes/github-callback.tsx +47 -21
- package/src/routes/integrations-settings.tsx +4 -0
- package/src/routes/linear-callback.tsx +5 -1
- package/src/routes/sentry-callback.tsx +5 -1
- package/src/routes/slack-callback.tsx +6 -1
- package/src/sentry-callback.test.ts +2 -1
- package/src/sentry-callback.ts +28 -20
- package/src/slack-callback.ts +21 -16
- package/test/render.tsx +1 -5
- package/tsconfig.build.tsbuildinfo +1 -1
- package/vercel.json +5 -0
- package/dist/integration-icon.d.ts +0 -17
- package/dist/integration-icon.d.ts.map +0 -1
- package/dist/integration-icon.js +0 -22
- package/dist/integration-icon.js.map +0 -1
- package/src/integration-icon.react.test.tsx +0 -40
- package/src/integration-icon.test.ts +0 -19
- package/src/integration-icon.tsx +0 -26
package/vercel.json
CHANGED
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
"buildCommand": "turbo build && pnpm run storybook:build",
|
|
4
4
|
"devCommand": "pnpm run storybook",
|
|
5
5
|
"installCommand": "pnpm install",
|
|
6
|
+
"git": {
|
|
7
|
+
"deploymentEnabled": {
|
|
8
|
+
"changeset-release/main": false
|
|
9
|
+
}
|
|
10
|
+
},
|
|
6
11
|
"framework": null,
|
|
7
12
|
"outputDirectory": "./storybook-static"
|
|
8
13
|
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Icon, type IconName } from '@shipfox/react-ui/icon';
|
|
2
|
-
import type { ComponentProps } from 'react';
|
|
3
|
-
export declare const FALLBACK_INTEGRATION_ICON: IconName;
|
|
4
|
-
/**
|
|
5
|
-
* Accepts the source strings used by connections and events; unknown values use
|
|
6
|
-
* the neutral fallback icon.
|
|
7
|
-
*/
|
|
8
|
-
export declare function getIntegrationIcon(source: string | null | undefined): IconName;
|
|
9
|
-
export interface IntegrationIconProps extends Omit<ComponentProps<typeof Icon>, 'name'> {
|
|
10
|
-
source: string | null | undefined;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Preserves the base icon props so callers can decide whether the glyph is
|
|
14
|
-
* decorative or labeled.
|
|
15
|
-
*/
|
|
16
|
-
export declare function IntegrationIcon({ source, ...props }: IntegrationIconProps): import("react").JSX.Element;
|
|
17
|
-
//# sourceMappingURL=integration-icon.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"integration-icon.d.ts","sourceRoot":"","sources":["../src/integration-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAE,KAAK,QAAQ,EAAC,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,OAAO,CAAC;AAG1C,eAAO,MAAM,yBAAyB,EAAE,QAA0B,CAAC;AAEnE;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,QAAQ,CAG9E;AAED,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,EAAE,MAAM,CAAC;IACrF,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACnC;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAAC,MAAM,EAAE,GAAG,KAAK,EAAC,EAAE,oBAAoB,+BAEvE"}
|
package/dist/integration-icon.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Icon } from '@shipfox/react-ui/icon';
|
|
3
|
-
import { PROVIDER_CATALOG } from '#provider-catalog.js';
|
|
4
|
-
export const FALLBACK_INTEGRATION_ICON = 'componentLine';
|
|
5
|
-
/**
|
|
6
|
-
* Accepts the source strings used by connections and events; unknown values use
|
|
7
|
-
* the neutral fallback icon.
|
|
8
|
-
*/ export function getIntegrationIcon(source) {
|
|
9
|
-
if (!source) return FALLBACK_INTEGRATION_ICON;
|
|
10
|
-
return PROVIDER_CATALOG[source]?.iconName ?? FALLBACK_INTEGRATION_ICON;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Preserves the base icon props so callers can decide whether the glyph is
|
|
14
|
-
* decorative or labeled.
|
|
15
|
-
*/ export function IntegrationIcon({ source, ...props }) {
|
|
16
|
-
return /*#__PURE__*/ _jsx(Icon, {
|
|
17
|
-
name: getIntegrationIcon(source),
|
|
18
|
-
...props
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
//# sourceMappingURL=integration-icon.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/integration-icon.tsx"],"sourcesContent":["import {Icon, type IconName} from '@shipfox/react-ui/icon';\nimport type {ComponentProps} from 'react';\nimport {PROVIDER_CATALOG} from '#provider-catalog.js';\n\nexport const FALLBACK_INTEGRATION_ICON: IconName = 'componentLine';\n\n/**\n * Accepts the source strings used by connections and events; unknown values use\n * the neutral fallback icon.\n */\nexport function getIntegrationIcon(source: string | null | undefined): IconName {\n if (!source) return FALLBACK_INTEGRATION_ICON;\n return PROVIDER_CATALOG[source]?.iconName ?? FALLBACK_INTEGRATION_ICON;\n}\n\nexport interface IntegrationIconProps extends Omit<ComponentProps<typeof Icon>, 'name'> {\n source: string | null | undefined;\n}\n\n/**\n * Preserves the base icon props so callers can decide whether the glyph is\n * decorative or labeled.\n */\nexport function IntegrationIcon({source, ...props}: IntegrationIconProps) {\n return <Icon name={getIntegrationIcon(source)} {...props} />;\n}\n"],"names":["Icon","PROVIDER_CATALOG","FALLBACK_INTEGRATION_ICON","getIntegrationIcon","source","iconName","IntegrationIcon","props","name"],"mappings":";AAAA,SAAQA,IAAI,QAAsB,yBAAyB;AAE3D,SAAQC,gBAAgB,QAAO,uBAAuB;AAEtD,OAAO,MAAMC,4BAAsC,gBAAgB;AAEnE;;;CAGC,GACD,OAAO,SAASC,mBAAmBC,MAAiC;IAClE,IAAI,CAACA,QAAQ,OAAOF;IACpB,OAAOD,gBAAgB,CAACG,OAAO,EAAEC,YAAYH;AAC/C;AAMA;;;CAGC,GACD,OAAO,SAASI,gBAAgB,EAACF,MAAM,EAAE,GAAGG,OAA4B;IACtE,qBAAO,KAACP;QAAKQ,MAAML,mBAAmBC;QAAU,GAAGG,KAAK;;AAC1D"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// @vitest-environment jsdom
|
|
2
|
-
import '@testing-library/jest-dom/vitest';
|
|
3
|
-
import {render} from '@testing-library/react';
|
|
4
|
-
import {IntegrationIcon} from './integration-icon.js';
|
|
5
|
-
|
|
6
|
-
describe('IntegrationIcon', () => {
|
|
7
|
-
it('exposes a labeled icon to assistive tech when it is the sole identifier', () => {
|
|
8
|
-
const {container} = render(<IntegrationIcon source="github" aria-label="GitHub" />);
|
|
9
|
-
|
|
10
|
-
const svg = container.querySelector('svg');
|
|
11
|
-
expect(svg).toHaveAttribute('aria-label', 'GitHub');
|
|
12
|
-
expect(svg).not.toHaveAttribute('aria-hidden');
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it('hides the icon from assistive tech when marked decorative', () => {
|
|
16
|
-
const {container} = render(<IntegrationIcon source="github" aria-hidden />);
|
|
17
|
-
|
|
18
|
-
const svg = container.querySelector('svg');
|
|
19
|
-
expect(svg).toHaveAttribute('aria-hidden', 'true');
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('forwards class names so callers control sizing and color', () => {
|
|
23
|
-
const {container} = render(
|
|
24
|
-
<IntegrationIcon source="github" className="size-24 text-foreground-neutral-base" />,
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
const svg = container.querySelector('svg');
|
|
28
|
-
expect(svg).toHaveClass('size-24', 'text-foreground-neutral-base');
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it('forwards sizing and label to the neutral fallback glyph for an unknown source', () => {
|
|
32
|
-
const {container} = render(
|
|
33
|
-
<IntegrationIcon source="gitlab" aria-label="GitLab" className="size-24" />,
|
|
34
|
-
);
|
|
35
|
-
|
|
36
|
-
const svg = container.querySelector('svg');
|
|
37
|
-
expect(svg).toHaveAttribute('aria-label', 'GitLab');
|
|
38
|
-
expect(svg).toHaveClass('size-24');
|
|
39
|
-
});
|
|
40
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import {FALLBACK_INTEGRATION_ICON, getIntegrationIcon} from './integration-icon.js';
|
|
2
|
-
|
|
3
|
-
describe('getIntegrationIcon', () => {
|
|
4
|
-
it('resolves cataloged providers to the icon they declare', () => {
|
|
5
|
-
expect(getIntegrationIcon('github')).toBe('github');
|
|
6
|
-
expect(getIntegrationIcon('sentry')).toBe('sentry');
|
|
7
|
-
expect(getIntegrationIcon('linear')).toBe('linear');
|
|
8
|
-
expect(getIntegrationIcon('gitea')).toBe('gitea');
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
it('falls back for sources missing from the catalog', () => {
|
|
12
|
-
expect(getIntegrationIcon('gitlab')).toBe(FALLBACK_INTEGRATION_ICON);
|
|
13
|
-
expect(getIntegrationIcon('mystery')).toBe(FALLBACK_INTEGRATION_ICON);
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
it.each([['' as const], [null], [undefined]])('falls back for an empty source (%s)', (source) => {
|
|
17
|
-
expect(getIntegrationIcon(source)).toBe(FALLBACK_INTEGRATION_ICON);
|
|
18
|
-
});
|
|
19
|
-
});
|
package/src/integration-icon.tsx
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import {Icon, type IconName} from '@shipfox/react-ui/icon';
|
|
2
|
-
import type {ComponentProps} from 'react';
|
|
3
|
-
import {PROVIDER_CATALOG} from '#provider-catalog.js';
|
|
4
|
-
|
|
5
|
-
export const FALLBACK_INTEGRATION_ICON: IconName = 'componentLine';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Accepts the source strings used by connections and events; unknown values use
|
|
9
|
-
* the neutral fallback icon.
|
|
10
|
-
*/
|
|
11
|
-
export function getIntegrationIcon(source: string | null | undefined): IconName {
|
|
12
|
-
if (!source) return FALLBACK_INTEGRATION_ICON;
|
|
13
|
-
return PROVIDER_CATALOG[source]?.iconName ?? FALLBACK_INTEGRATION_ICON;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface IntegrationIconProps extends Omit<ComponentProps<typeof Icon>, 'name'> {
|
|
17
|
-
source: string | null | undefined;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Preserves the base icon props so callers can decide whether the glyph is
|
|
22
|
-
* decorative or labeled.
|
|
23
|
-
*/
|
|
24
|
-
export function IntegrationIcon({source, ...props}: IntegrationIconProps) {
|
|
25
|
-
return <Icon name={getIntegrationIcon(source)} {...props} />;
|
|
26
|
-
}
|