Skip to content

Commit

Permalink
fix: Prettier formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelpineirocontentful committed Jan 16, 2025
1 parent c1e0e73 commit c8582f4
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 13 deletions.
5 changes: 2 additions & 3 deletions lib/adapters/REST/endpoints/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ import type { FunctionProps } from '../../../entities/function'
const getBaseUrl = (params: GetFunctionParams) =>
`/organizations/${params.organizationId}/app_definitions/${params.appDefinitionId}/functions`

const getFunctionUrl = (params: GetFunctionParams) =>
`${getBaseUrl(params)}/${params.functionId}`
const getFunctionUrl = (params: GetFunctionParams) => `${getBaseUrl(params)}/${params.functionId}`

const getFunctionsEnvURL = (params: GetFunctionForEnvParams) => {
return `/spaces/${params.spaceId}/environments/${params.environmentId}/app_installations/${params.appInstallationId}/functions`
return `/spaces/${params.spaceId}/environments/${params.environmentId}/app_installations/${params.appInstallationId}/functions`
}

export const get: RestEndpoint<'Function', 'get'> = (
Expand Down
16 changes: 12 additions & 4 deletions lib/common-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,10 @@ type MRInternal<UA extends boolean> = {

(opts: MROpts<'Function', 'get', UA>): MRReturn<'Function', 'get'>
(opts: MROpts<'Function', 'getMany', UA>): MRReturn<'Function', 'getMany'>
(opts: MROpts<'Function', 'getManyForEnvironment', UA>): MRReturn<'Function', 'getManyForEnvironment'>
(opts: MROpts<'Function', 'getManyForEnvironment', UA>): MRReturn<
'Function',
'getManyForEnvironment'
>

(opts: MROpts<'Locale', 'get', UA>): MRReturn<'Locale', 'get'>
(opts: MROpts<'Locale', 'getMany', UA>): MRReturn<'Locale', 'getMany'>
Expand Down Expand Up @@ -1547,7 +1550,10 @@ export type MRActions = {
Function: {
get: { params: GetFunctionParams; return: FunctionProps }
getMany: { params: GetFunctionParams; return: CollectionProp<FunctionProps> }
getManyForEnvironment: { params: GetFunctionForEnvParams; return: CollectionProp<FunctionProps> }
getManyForEnvironment: {
params: GetFunctionForEnvParams
return: CollectionProp<FunctionProps>
}
}
Locale: {
get: { params: GetSpaceEnvironmentParams & { localeId: string }; return: LocaleProps }
Expand Down Expand Up @@ -2142,8 +2148,10 @@ export type GetEditorInterfaceParams = GetSpaceEnvironmentParams & { contentType
export type GetEntryParams = GetSpaceEnvironmentParams & { entryId: string }
export type GetExtensionParams = GetSpaceEnvironmentParams & { extensionId: string }
export type GetEnvironmentTemplateParams = GetOrganizationParams & { environmentTemplateId: string }
export type GetFunctionParams = GetAppDefinitionParams & { functionId?: string}
export type GetFunctionForEnvParams = GetSpaceParams & { environmentId: string } & { appInstallationId: string }
export type GetFunctionParams = GetAppDefinitionParams & { functionId?: string }
export type GetFunctionForEnvParams = GetSpaceParams & { environmentId: string } & {
appInstallationId: string
}
export type GetOrganizationParams = { organizationId: string }
export type GetReleaseParams = GetSpaceEnvironmentParams & { releaseId: string }
export type GetSnapshotForContentTypeParams = GetSpaceEnvironmentParams & { contentTypeId: string }
Expand Down
2 changes: 1 addition & 1 deletion lib/entities/bulk-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export enum BulkActionStatus {
}

const STATUSES = Object.values(BulkActionStatus)
type BulkActionStatuses = (typeof STATUSES)[number]
type BulkActionStatuses = typeof STATUSES[number]

interface BulkActionFailedError {
sys: { type: 'Error'; id: 'BulkActionFailed' }
Expand Down
2 changes: 1 addition & 1 deletion lib/entities/resource-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type OptionalSysFields =

export type SpaceEnvResourceTypeProps = Pick<
ResourceTypeProps,
(typeof publicResourceTypeFields)[number]
typeof publicResourceTypeFields[number]
> & {
// we mark timestamps and users as optional to include system types like `Contentful:Entry` into the public response
sys: Partial<Pick<ResourceTypeProps['sys'], OptionalSysFields>> &
Expand Down
4 changes: 2 additions & 2 deletions lib/plain/entities/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export type FunctionPlainClientAPI = {
* ```
*/
get(params: OptionalDefaults<GetFunctionParams>): Promise<FunctionProps>

/**
* Fetches all functions for the given app
* @param params organization ID, app definition ID to identify the functions
Expand All @@ -40,7 +40,7 @@ export type FunctionPlainClientAPI = {
getMany(
params: OptionalDefaults<GetFunctionParams & QueryParams>
): Promise<CollectionProp<FunctionProps>>

/**
* Fetches all functions for the given environment
* @param params space ID, environment ID, app installation ID to identify the functions
Expand Down
2 changes: 1 addition & 1 deletion lib/plain/plain-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export const createPlainClient = (
function: {
get: wrap(wrapParams, 'Function', 'get'),
getMany: wrap(wrapParams, 'Function', 'getMany'),
getManyForEnvironment: wrap(wrapParams, 'Function', 'getManyForEnvironment')
getManyForEnvironment: wrap(wrapParams, 'Function', 'getManyForEnvironment'),
},
editorInterface: {
get: wrap(wrapParams, 'EditorInterface', 'get'),
Expand Down
2 changes: 1 addition & 1 deletion test/unit/mocks/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,7 @@ const mocks = {
workflowsChangelogEntry: workflowsChangelogEntryMock,
}

function cloneMock<T extends keyof typeof mocks>(name: T): (typeof mocks)[T] {
function cloneMock<T extends keyof typeof mocks>(name: T): typeof mocks[T] {
return cloneDeep(mocks[name])
}

Expand Down

0 comments on commit c8582f4

Please sign in to comment.