Skip to content

Commit 5cd929a

Browse files
Merge pull request #268 from auth0/refactor/align-type-names-with-sdk
refactor(core): align re-exported type names with sdk types
2 parents 41c6b47 + 9af8df9 commit 5cd929a

33 files changed

Lines changed: 190 additions & 180 deletions

File tree

IdentityProvidersConfigStrategyBase

Whitespace-only changes.

examples/next-rwa/src/app/idp-management/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client';
22

3-
import { SsoProviderTable, type IdentityProvider } from '@auth0/universal-components-react';
3+
import { SsoProviderTable, type IdpKnownResponse } from '@auth0/universal-components-react';
44
import { useRouter } from 'next/navigation';
55
import { useCallback, useMemo } from 'react';
66

@@ -11,7 +11,7 @@ export default function IdpManagementPage() {
1111
}, [router]);
1212

1313
const handleEdit = useCallback(
14-
(provider: IdentityProvider): void => {
14+
(provider: IdpKnownResponse): void => {
1515
router.push(`/idp-management/edit/${provider.id}`);
1616
},
1717
[router],

examples/react-spa-npm/src/views/sso-provider-page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SsoProviderTable, type IdentityProvider } from '@auth0/universal-components-react';
1+
import { SsoProviderTable, type IdpKnownResponse } from '@auth0/universal-components-react';
22
import { useCallback, useMemo } from 'react';
33
import { useNavigate } from 'react-router-dom';
44

@@ -10,7 +10,7 @@ const SsoProviderPage = () => {
1010
}, [navigate]);
1111

1212
const handleEdit = useCallback(
13-
(provider: IdentityProvider) => {
13+
(provider: IdpKnownResponse) => {
1414
navigate(`/sso-provider/edit/${provider.id}`);
1515
},
1616
[navigate],

packages/core/src/services/my-organization/config/config-types.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ import type { MyOrganization } from '@auth0/myorganization-js';
77

88
export type GetConfigurationResponseContent = MyOrganization.GetConfigurationResponseContent;
99

10-
export type IdpConfig = MyOrganization.GetIdpConfigurationResponseContent;
11-
export type IdpConfigStrategyBase = MyOrganization.IdentityProvidersConfigStrategyBase;
10+
export type GetIdpConfigurationResponseContent = MyOrganization.GetIdpConfigurationResponseContent;
11+
export type IdentityProvidersConfigStrategyBase =
12+
MyOrganization.IdentityProvidersConfigStrategyBase;

packages/core/src/services/my-organization/idp-management/sso-provider/sso-provider-types.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type {
1212

1313
export type ListIdentityProvidersResponseContent =
1414
MyOrganization.ListIdentityProvidersResponseContent;
15-
export type IdentityProvider = MyOrganization.IdpKnownResponse;
15+
export type IdpKnownResponse = MyOrganization.IdpKnownResponse;
1616
export type CreateIdentityProviderRequestContent =
1717
MyOrganization.CreateIdentityProviderRequestContent;
1818
export type CreateIdentityProviderResponseContent =
@@ -39,9 +39,9 @@ export type CreateIdpDomainResponseContent = MyOrganization.CreateIdpDomainRespo
3939

4040
export type IdpStrategy = MyOrganization.IdpStrategyEnum;
4141

42-
export type IdentityProviderCreate = Omit<IdentityProvider, 'id'>;
42+
export type IdentityProviderCreate = Omit<IdpKnownResponse, 'id'>;
4343

44-
export type IdentityProviderAssociatedWithDomain = IdentityProvider & {
44+
export type IdentityProviderAssociatedWithDomain = IdpKnownResponse & {
4545
is_associated: boolean;
4646
};
4747

@@ -56,5 +56,5 @@ export type SCIMTokenCreate = MyOrganization.CreateIdpProvisioningScimTokenReque
5656

5757
export type SCIMToken = MyOrganization.IdpScimTokenCreate;
5858

59-
export type IdpUserAttributeMap = MyOrganization.IdpUserAttributeMapItem[];
60-
export type IdpBaseUserAttributeItem = MyOrganization.BaseUserAttributeMapItem;
59+
export type IdpUserAttributeMapItem = MyOrganization.IdpUserAttributeMapItem;
60+
export type BaseUserAttributeMapItem = MyOrganization.BaseUserAttributeMapItem;

packages/core/src/services/my-organization/idp-management/sso-provisioning/sso-provisioning-types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ export type CreateIdpProvisioningScimTokenRequestContent =
1717
MyOrganization.CreateIdpProvisioningScimTokenRequestContent;
1818
export type IdpProvisioningConfig = MyOrganization.IdpProvisioningConfig;
1919
export type IdpScimTokenBase = MyOrganization.IdpScimTokenBase;
20-
export type IdpProvisioningUserAttributeMap = MyOrganization.IdpProvisioningUserAttributeMapItem[];
20+
export type IdpProvisioningUserAttributeMapItem =
21+
MyOrganization.IdpProvisioningUserAttributeMapItem;

packages/react/src/components/auth0/my-organization/__tests__/sso-provider-create.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
AVAILABLE_STRATEGY_LIST,
33
type ComponentAction,
4-
type IdentityProvider,
4+
type IdpKnownResponse,
55
type CreateIdentityProviderRequestContentPrivate,
66
} from '@auth0/universal-components-core';
77
import type { QueryClient } from '@tanstack/react-query';
@@ -55,7 +55,7 @@ const createMockSsoProviderCreateProps = (
5555

5656
const createMockCreateAction = (): ComponentAction<
5757
CreateIdentityProviderRequestContentPrivate,
58-
IdentityProvider
58+
IdpKnownResponse
5959
> => ({
6060
disabled: false,
6161
onBefore: vi.fn(() => true),

packages/react/src/components/auth0/my-organization/__tests__/sso-provider-table.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ComponentAction, IdentityProvider } from '@auth0/universal-components-core';
1+
import type { ComponentAction, IdpKnownResponse } from '@auth0/universal-components-core';
22
import type { QueryClient } from '@tanstack/react-query';
33
import { screen, waitFor } from '@testing-library/react';
44
import userEvent from '@testing-library/user-event';
@@ -55,19 +55,19 @@ const createMockCreateAction = (): ComponentAction<void> => ({
5555
onAfter: vi.fn(),
5656
});
5757

58-
const createMockEditAction = (): ComponentAction<IdentityProvider> => ({
58+
const createMockEditAction = (): ComponentAction<IdpKnownResponse> => ({
5959
disabled: false,
6060
onBefore: vi.fn(() => true),
6161
onAfter: vi.fn(),
6262
});
6363

64-
const createMockDeleteAction = (): ComponentAction<IdentityProvider> => ({
64+
const createMockDeleteAction = (): ComponentAction<IdpKnownResponse> => ({
6565
disabled: false,
6666
onBefore: vi.fn(() => true),
6767
onAfter: vi.fn(),
6868
});
6969

70-
const createMockDeleteFromOrganizationAction = (): ComponentAction<IdentityProvider> => ({
70+
const createMockDeleteFromOrganizationAction = (): ComponentAction<IdpKnownResponse> => ({
7171
disabled: false,
7272
onBefore: vi.fn(() => true),
7373
onAfter: vi.fn(),

packages/react/src/components/auth0/my-organization/shared/idp-management/sso-provider-create/provider-configure/common-configure-fields.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
* @internal
55
*/
66

7-
import type { IdpConfig } from '@auth0/universal-components-core';
7+
import type { GetIdpConfigurationResponseContent } from '@auth0/universal-components-core';
88
import { useFormContext } from 'react-hook-form';
99

1010
import { Checkbox } from '@/components/ui/checkbox';
1111
import { FormField, FormItem, FormLabel, FormControl, FormDescription } from '@/components/ui/form';
1212
import { useTranslator } from '@/hooks/shared/use-translator';
1313

1414
interface CommonConfigureFieldsProps {
15-
idpConfig: IdpConfig | null;
15+
idpConfig: GetIdpConfigurationResponseContent | null;
1616
readOnly?: boolean;
1717
customMessages?: Partial<Record<string, unknown>>;
1818
}

packages/react/src/components/auth0/my-organization/shared/idp-management/sso-provider-edit/sso-provider-attribute-mappings.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import {
88
STRATEGY_DISPLAY_NAMES,
9-
type IdpBaseUserAttributeItem,
9+
type BaseUserAttributeMapItem,
1010
} from '@auth0/universal-components-core';
1111
import { Info } from 'lucide-react';
1212
import * as React from 'react';
@@ -20,7 +20,7 @@ import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip
2020
import { useTranslator } from '@/hooks/shared/use-translator';
2121
import type { SsoProviderAttributeMappingsProps } from '@/types/my-organization/idp-management/sso-provider/sso-provider-edit-types';
2222

23-
type AttributeItem = IdpBaseUserAttributeItem & { provisioning_field?: string };
23+
type AttributeItem = BaseUserAttributeMapItem & { provisioning_field?: string };
2424

2525
const SCIM_NAMESPACE = 'urn:ietf:params:scim:schemas:core:2.0:User';
2626

@@ -38,7 +38,7 @@ const STATUS_VARIANTS: Record<ChangeStatus, 'info' | 'warning' | 'default'> = {
3838
[CHANGE_STATUS.NEW]: 'default',
3939
};
4040

41-
const getChangeStatus = (item: IdpBaseUserAttributeItem): ChangeStatus | null => {
41+
const getChangeStatus = (item: BaseUserAttributeMapItem): ChangeStatus | null => {
4242
const { is_extra: isRemoved, is_missing: isNew } = item;
4343

4444
if (isRemoved && isNew) return CHANGE_STATUS.UPDATED;
@@ -53,7 +53,7 @@ const AttributeNameCell = ({
5353
section,
5454
t,
5555
}: {
56-
item: IdpBaseUserAttributeItem;
56+
item: BaseUserAttributeMapItem;
5757
section: 'required' | 'optional';
5858
t: (key: string) => string;
5959
}) => {

0 commit comments

Comments
 (0)