Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/adapters/REST/endpoints/concept-scheme.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { RawAxiosRequestHeaders } from 'axios'
import type { AxiosInstance } from 'contentful-sdk-core'
import type { OpPatch } from 'json-patch'
import type {
OpPatch,
CursorPaginatedCollectionProp,
DeleteConceptSchemeParams,
GetConceptSchemeParams,
Expand Down
2 changes: 1 addition & 1 deletion lib/adapters/REST/endpoints/concept.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { RawAxiosRequestHeaders } from 'axios'
import type { AxiosInstance } from 'contentful-sdk-core'
import type { OpPatch } from 'json-patch'
import type {
OpPatch,
CursorPaginatedCollectionProp,
DeleteConceptParams,
GetConceptDescendantsParams,
Expand Down
2 changes: 1 addition & 1 deletion lib/adapters/REST/endpoints/entry.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { RawAxiosRequestHeaders } from 'axios'
import type { AxiosInstance } from 'contentful-sdk-core'
import copy from 'fast-copy'
import type { OpPatch } from 'json-patch'
import type { SetOptional } from 'type-fest'
import type {
OpPatch,
CollectionProp,
CreateReleaseEntryParams,
CreateWithIdReleaseEntryParams,
Expand Down
2 changes: 1 addition & 1 deletion lib/adapters/REST/endpoints/release-entry.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { RawAxiosRequestHeaders } from 'axios'
import type { AxiosInstance } from 'contentful-sdk-core'
import copy from 'fast-copy'
import type { OpPatch } from 'json-patch'
import type { SetOptional } from 'type-fest'
import type {
OpPatch,
CollectionProp,
CreateReleaseEntryParams,
CreateWithIdReleaseEntryParams,
Expand Down
3 changes: 1 addition & 2 deletions lib/adapters/REST/make-request.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { AxiosInstance } from 'contentful-sdk-core'
import type { MakeRequestOptions, MakeRequestPayload } from '../../common-types'
import type { OpPatch } from 'json-patch'
import type { OpPatch, MakeRequestOptions, MakeRequestPayload } from '../../common-types'
import type { RawAxiosRequestHeaders } from 'axios'
import endpoints from './endpoints'

Expand Down
28 changes: 28 additions & 0 deletions lib/common-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,34 @@ export interface Adapter {
makeRequest: MakeRequestWithUserAgent
}

export type OpPatch = AddPatch | RemovePatch | ReplacePatch | MovePatch | CopyPatch | TestPatch
interface Patch {
path: string
}
interface AddPatch extends Patch {
op: 'add'
value: any
}
interface RemovePatch extends Patch {
op: 'remove'
}
interface ReplacePatch extends Patch {
op: 'replace'
value: any
}
interface MovePatch extends Patch {
op: 'move'
from: string
}
interface CopyPatch extends Patch {
op: 'copy'
from: string
}
interface TestPatch extends Patch {
op: 'test'
value: any
}

/**
* @private
*/
Expand Down
3 changes: 1 addition & 2 deletions lib/create-entry-api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { OpPatch } from 'json-patch'
import type { MakeRequest } from './common-types'
import type { MakeRequest, OpPatch } from './common-types'
import type { CreateCommentParams, CreateCommentProps } from './entities/comment'
import type { Entry, EntryProps, EntryReferenceOptionsProps } from './entities/entry'
import type { CreateTaskProps } from './entities/task'
Expand Down
2 changes: 1 addition & 1 deletion lib/plain/common-types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { RawAxiosRequestConfig, RawAxiosRequestHeaders } from 'axios'
import type { OpPatch } from 'json-patch'
import type {
OpPatch,
BasicCursorPaginationOptions,
CollectionProp,
CreateReleaseAssetParams,
Expand Down
2 changes: 1 addition & 1 deletion lib/plain/entities/concept-scheme.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type {
OpPatch,
CursorPaginatedCollectionProp,
DeleteConceptSchemeParams,
GetConceptSchemeParams,
Expand All @@ -7,7 +8,6 @@ import type {
UpdateConceptSchemeParams,
} from '../../common-types'
import type { ConceptSchemeProps, CreateConceptSchemeProps } from '../../entities/concept-scheme'
import type { OpPatch } from 'json-patch'
import type { SetOptional } from 'type-fest'

export type ConceptSchemePlainClientAPI = {
Expand Down
2 changes: 1 addition & 1 deletion lib/plain/entities/concept.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type {
OpPatch,
CursorPaginatedCollectionProp,
DeleteConceptParams,
GetConceptDescendantsParams,
Expand All @@ -8,7 +9,6 @@ import type {
UpdateConceptParams,
} from '../../common-types'
import type { ConceptProps, CreateConceptProps } from '../../entities/concept'
import type { OpPatch } from 'json-patch'
import type { SetOptional } from 'type-fest'

export type ConceptPlainClientAPI = {
Expand Down
9 changes: 0 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
"@rollup/plugin-typescript": "^12.3.0",
"@semantic-release/changelog": "^6.0.3",
"@size-limit/file": "^11.1.6",
"@types/json-patch": "0.0.30",
"@types/lodash": "^4.14.168",
"@types/node": "^20.12.13",
"@vitest/browser": "^2.1.5",
Expand All @@ -100,7 +99,6 @@
"express": "^4.21.1",
"husky": "^9.1.7",
"in-publish": "^2.0.1",
"json-patch": "^0.7.0",
"jsonwebtoken": "^9.0.2",
"lint-staged": "^15.2.5",
"lodash": "^4.17.20",
Expand Down
Loading