@contember/client-content 2.1.0-rc.3 → 2.2.0-alpha.10
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/dist/development/src/ContentClient.cjs.map +1 -1
- package/dist/development/src/ContentClient.js.map +1 -1
- package/dist/development/src/ContentQueryBuilder.cjs.map +1 -1
- package/dist/development/src/ContentQueryBuilder.js.map +1 -1
- package/dist/development/src/MutationFailedError.cjs.map +1 -1
- package/dist/development/src/MutationFailedError.js.map +1 -1
- package/dist/development/src/nodes/ContentEntitySelection.cjs.map +1 -1
- package/dist/development/src/nodes/ContentEntitySelection.js.map +1 -1
- package/dist/development/src/utils/createListArgs.cjs.map +1 -1
- package/dist/development/src/utils/createListArgs.js.map +1 -1
- package/dist/development/src/utils/createMutationOperationSet.cjs.map +1 -1
- package/dist/development/src/utils/createMutationOperationSet.js.map +1 -1
- package/dist/development/src/utils/createQueryOperationSet.cjs.map +1 -1
- package/dist/development/src/utils/createQueryOperationSet.js.map +1 -1
- package/dist/production/src/ContentClient.cjs.map +1 -1
- package/dist/production/src/ContentClient.js.map +1 -1
- package/dist/production/src/ContentQueryBuilder.cjs.map +1 -1
- package/dist/production/src/ContentQueryBuilder.js.map +1 -1
- package/dist/production/src/MutationFailedError.cjs.map +1 -1
- package/dist/production/src/MutationFailedError.js.map +1 -1
- package/dist/production/src/nodes/ContentEntitySelection.cjs.map +1 -1
- package/dist/production/src/nodes/ContentEntitySelection.js.map +1 -1
- package/dist/production/src/utils/createListArgs.cjs.map +1 -1
- package/dist/production/src/utils/createListArgs.js.map +1 -1
- package/dist/production/src/utils/createMutationOperationSet.cjs.map +1 -1
- package/dist/production/src/utils/createMutationOperationSet.js.map +1 -1
- package/dist/production/src/utils/createQueryOperationSet.cjs.map +1 -1
- package/dist/production/src/utils/createQueryOperationSet.js.map +1 -1
- package/dist/types/ContentClient.d.ts +2 -2
- package/dist/types/ContentClient.d.ts.map +1 -1
- package/dist/types/ContentQueryBuilder.d.ts +2 -2
- package/dist/types/ContentQueryBuilder.d.ts.map +1 -1
- package/dist/types/MutationFailedError.d.ts +2 -2
- package/dist/types/MutationFailedError.d.ts.map +1 -1
- package/dist/types/TypedContentQueryBuilder.d.ts +3 -3
- package/dist/types/TypedContentQueryBuilder.d.ts.map +1 -1
- package/dist/types/index.d.ts +6 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/nodes/ContentEntitySelection.d.ts +1 -1
- package/dist/types/nodes/ContentEntitySelection.d.ts.map +1 -1
- package/dist/types/nodes/ContentOperation.d.ts.map +1 -1
- package/dist/types/nodes/TypedEntitySelection.d.ts +3 -3
- package/dist/types/nodes/TypedEntitySelection.d.ts.map +1 -1
- package/dist/types/nodes/index.d.ts +3 -3
- package/dist/types/nodes/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/types/Input.d.ts +1 -1
- package/dist/types/types/Input.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +3 -3
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/utils/ContentOperationSet.d.ts.map +1 -1
- package/dist/types/utils/createListArgs.d.ts +2 -2
- package/dist/types/utils/createListArgs.d.ts.map +1 -1
- package/dist/types/utils/createMutationOperationSet.d.ts +2 -2
- package/dist/types/utils/createMutationOperationSet.d.ts.map +1 -1
- package/dist/types/utils/createQueryOperationSet.d.ts +2 -2
- package/dist/types/utils/createQueryOperationSet.d.ts.map +1 -1
- package/dist/types/utils/createTypedArgs.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/ContentClient.ts +6 -6
- package/src/ContentQueryBuilder.ts +5 -5
- package/src/MutationFailedError.ts +2 -2
- package/src/TypedContentQueryBuilder.ts +3 -3
- package/src/index.ts +6 -6
- package/src/nodes/ContentEntitySelection.ts +2 -2
- package/src/nodes/TypedEntitySelection.ts +3 -3
- package/src/nodes/index.ts +3 -3
- package/src/types/Input.ts +1 -1
- package/src/types/index.ts +3 -3
- package/src/utils/createListArgs.ts +1 -1
- package/src/utils/createMutationOperationSet.ts +2 -2
- package/src/utils/createQueryOperationSet.ts +2 -2
- package/tests/cases/unit/mutation.test.ts +2 -2
- package/tests/cases/unit/query.test.ts +2 -2
- package/tests/cases/unit/types.test.ts +11 -2
- package/tests/client/entities.ts +1 -1
- package/tests/client/index.ts +5 -5
- package/tests/client/names.ts +2 -2
- package/tests/generate.ts +1 -1
- package/tests/lib.ts +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ContentClientInput, MutationResult, SchemaTypeLike, TransactionResult } from './types'
|
|
2
|
-
import { ContentMutation, ContentQuery, TypedEntitySelection, TypedEntitySelectionCallback } from './nodes'
|
|
3
|
-
import { MutationTransactionOptions } from './ContentQueryBuilder'
|
|
1
|
+
import { ContentClientInput, MutationResult, SchemaTypeLike, TransactionResult } from './types/index.js'
|
|
2
|
+
import { ContentMutation, ContentQuery, TypedEntitySelection, TypedEntitySelectionCallback } from './nodes/index.js'
|
|
3
|
+
import { MutationTransactionOptions } from './ContentQueryBuilder.js'
|
|
4
4
|
|
|
5
5
|
export type TypedContentEntitySelectionOrCallback<TSchema extends SchemaTypeLike, TEntityName extends keyof TSchema['entities'] & string, TValue> =
|
|
6
6
|
| TypedEntitySelection<TSchema, TEntityName, TSchema['entities'][TEntityName], TValue>
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './ContentClient'
|
|
2
|
-
export * from './TypedContentQueryBuilder'
|
|
3
|
-
export * from './ContentQueryBuilder'
|
|
4
|
-
export * from './nodes'
|
|
5
|
-
export * from './types'
|
|
6
|
-
export * from './utils/mutationFragments'
|
|
1
|
+
export * from './ContentClient.js'
|
|
2
|
+
export * from './TypedContentQueryBuilder.js'
|
|
3
|
+
export * from './ContentQueryBuilder.js'
|
|
4
|
+
export * from './nodes/index.js'
|
|
5
|
+
export * from './types/index.js'
|
|
6
|
+
export * from './utils/mutationFragments.js'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createListArgs } from '../utils/createListArgs'
|
|
2
|
-
import { ContentClientInput, SchemaEntityNames, SchemaNames } from '../types'
|
|
1
|
+
import { createListArgs } from '../utils/createListArgs.js'
|
|
2
|
+
import { ContentClientInput, SchemaEntityNames, SchemaNames } from '../types/index.js'
|
|
3
3
|
import { Input } from '@contember/schema'
|
|
4
4
|
import { GraphQlField, GraphQlFieldTypedArgs, GraphQlSelectionSet } from '@contember/graphql-builder'
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { EntityTypeLike, SchemaTypeLike } from '../types'
|
|
2
|
-
import { ContentClientInput } from '../types'
|
|
3
|
-
import { ContentEntitySelectionContext } from './ContentEntitySelection'
|
|
1
|
+
import { EntityTypeLike, SchemaTypeLike } from '../types/index.js'
|
|
2
|
+
import { ContentClientInput } from '../types/index.js'
|
|
3
|
+
import { ContentEntitySelectionContext } from './ContentEntitySelection.js'
|
|
4
4
|
|
|
5
5
|
export interface TypedEntitySelection<TSchema extends SchemaTypeLike, TEntityName extends string, TEntity extends EntityTypeLike, TValue> {
|
|
6
6
|
/** @internal */
|
package/src/nodes/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './ContentEntitySelection'
|
|
2
|
-
export * from './ContentOperation'
|
|
3
|
-
export * from './TypedEntitySelection'
|
|
1
|
+
export * from './ContentEntitySelection.js'
|
|
2
|
+
export * from './ContentOperation.js'
|
|
3
|
+
export * from './TypedEntitySelection.js'
|
package/src/types/Input.ts
CHANGED
package/src/types/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './Input'
|
|
2
|
-
export * from './Result'
|
|
3
|
-
export * from './Schema'
|
|
1
|
+
export * from './Input.js'
|
|
2
|
+
export * from './Result.js'
|
|
3
|
+
export * from './Schema.js'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ContentMutation, ContentOperation, ContentQuery } from '../nodes'
|
|
1
|
+
import { ContentMutation, ContentOperation, ContentQuery } from '../nodes/index.js'
|
|
2
2
|
import { GraphQlField } from '@contember/graphql-builder'
|
|
3
|
-
import { ContentOperationSet } from './ContentOperationSet'
|
|
3
|
+
import { ContentOperationSet } from './ContentOperationSet.js'
|
|
4
4
|
|
|
5
5
|
export const createMutationOperationSet = (
|
|
6
6
|
input:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ContentOperation, ContentQuery } from '../nodes'
|
|
2
|
-
import { ContentOperationSet } from './ContentOperationSet'
|
|
1
|
+
import { ContentOperation, ContentQuery } from '../nodes/index.js'
|
|
2
|
+
import { ContentOperationSet } from './ContentOperationSet.js'
|
|
3
3
|
import { GraphQlField } from '@contember/graphql-builder'
|
|
4
4
|
|
|
5
5
|
export const createQueryOperationSet = (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, test } from 'bun:test'
|
|
2
|
-
import { createClient } from '../../lib'
|
|
3
|
-
import { queryBuilder } from '../../client'
|
|
2
|
+
import { createClient } from '../../lib.js'
|
|
3
|
+
import { queryBuilder } from '../../client/index.js'
|
|
4
4
|
import { expectTypeOf } from 'expect-type'
|
|
5
5
|
|
|
6
6
|
const qb = queryBuilder
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { describe, expect, test } from 'bun:test'
|
|
2
|
-
import { createClient } from '../../lib'
|
|
2
|
+
import { createClient } from '../../lib.js'
|
|
3
3
|
import { Input } from '@contember/schema'
|
|
4
4
|
import OrderDirection = Input.OrderDirection
|
|
5
|
-
import { queryBuilder } from '../../client'
|
|
5
|
+
import { queryBuilder } from '../../client/index.js'
|
|
6
6
|
|
|
7
7
|
describe('queries', () => {
|
|
8
8
|
const qb = queryBuilder
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
2
|
import { describe, expect, test } from 'bun:test'
|
|
3
|
-
import { ContentClientInput } from '../../../src'
|
|
4
|
-
import { ContemberClientEntities, FragmentOf, FragmentType, PostStatus, queryBuilder } from '../../client'
|
|
3
|
+
import { ContentClientInput } from '../../../src/index.js'
|
|
4
|
+
import { ContemberClientEntities, FragmentOf, FragmentType, PostStatus, queryBuilder } from '../../client/index.js'
|
|
5
5
|
import { expectTypeOf } from 'expect-type'
|
|
6
|
+
import { Input, JSONValue, Value } from '@contember/schema'
|
|
6
7
|
|
|
7
8
|
const qb = queryBuilder
|
|
8
9
|
describe('ts types', () => {
|
|
@@ -146,4 +147,12 @@ describe('ts types', () => {
|
|
|
146
147
|
type fragmentType = FragmentType<typeof fragment>
|
|
147
148
|
expectTypeOf<fragmentType>().toEqualTypeOf<{ id: string; status: PostStatus | null }>()
|
|
148
149
|
})
|
|
150
|
+
|
|
151
|
+
test('includes condition', async () => {
|
|
152
|
+
expectTypeOf<Input.Condition<string[]>['includes']>().toEqualTypeOf<string | undefined>()
|
|
153
|
+
expectTypeOf<Input.Condition<readonly string[]>['includes']>().toEqualTypeOf<string | undefined>()
|
|
154
|
+
expectTypeOf<Input.Condition<JSONValue | null>['includes']>().toEqualTypeOf<JSONValue | undefined>()
|
|
155
|
+
expectTypeOf<Input.Condition['includes']>().toEqualTypeOf<Value.FieldValue | undefined>()
|
|
156
|
+
expectTypeOf<Input.Condition<string>['includes']>().toEqualTypeOf<undefined>()
|
|
157
|
+
})
|
|
149
158
|
})
|
package/tests/client/entities.ts
CHANGED
package/tests/client/index.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
import { ContemberClientNames } from './names'
|
|
3
|
-
import type { ContemberClientSchema } from './entities'
|
|
2
|
+
import { ContemberClientNames } from './names.js'
|
|
3
|
+
import type { ContemberClientSchema } from './entities.js'
|
|
4
4
|
import { ContentQueryBuilder, TypedContentQueryBuilder, TypedEntitySelection } from '@contember/client-content'
|
|
5
|
-
export * from './names'
|
|
6
|
-
export * from './enums'
|
|
7
|
-
export * from './entities'
|
|
5
|
+
export * from './names.js'
|
|
6
|
+
export * from './enums.js'
|
|
7
|
+
export * from './entities.js'
|
|
8
8
|
|
|
9
9
|
export const queryBuilder = new ContentQueryBuilder(ContemberClientNames) as unknown as TypedContentQueryBuilder<ContemberClientSchema>
|
|
10
10
|
|
package/tests/client/names.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SchemaNames, SchemaEntityNames } from '@contember/client-content'
|
|
2
|
-
import type { ContemberClientEntities } from './entities'
|
|
3
|
-
import type { ContemberClientEnums } from './enums'
|
|
2
|
+
import type { ContemberClientEntities } from './entities.js'
|
|
3
|
+
import type { ContemberClientEnums } from './enums.js'
|
|
4
4
|
export const ContemberClientNames = {
|
|
5
5
|
entities: {
|
|
6
6
|
"Locale": {
|
package/tests/generate.ts
CHANGED
package/tests/lib.ts
CHANGED