UNPKG

3.83 kBTypeScriptView Raw
1import type { CursorPaginatedCollectionProp, DeleteConceptSchemeParams, GetConceptSchemeParams, GetManyConceptSchemeParams, GetOrganizationParams, UpdateConceptSchemeParams } from '../../common-types';
2import type { ConceptSchemeProps, CreateConceptSchemeProps } from '../../entities/concept-scheme';
3import type { OpPatch } from 'json-patch';
4import type { SetOptional } from 'type-fest';
5export type ConceptSchemePlainClientAPI = {
6 /**
7 * Create Concept Scheme
8 * @returns the created Concept Scheme
9 * @throws if the request fails
10 * @see {@link https://www.contentful.com/developers/docs/references/content-management-api/#/reference/taxonomy/create-a-concept-scheme}
11 * @example
12 * ```javascript
13 * const concept = await client.conceptScheme.create({
14 * organizationId: '<organization_id>',
15 * }, conceptSchemeProps);
16 * ```
17 */
18 create(params: SetOptional<GetOrganizationParams, 'organizationId'>, payload: CreateConceptSchemeProps): Promise<ConceptSchemeProps>;
19 /**
20 * Update Concept Scheme
21 * @returns the updated Concept Scheme
22 * @throws if the request fails
23 * @see {@link https://www.contentful.com/developers/docs/references/content-management-api/#/reference/taxonomy/concept-scheme}
24 * @example
25 * ```javascript
26 * const updatedConcept = await client.conceptScheme.update({
27 * organizationId: '<organization_id>',
28 * }, conceptSchemePatch);
29 * ```
30 */
31 update(params: SetOptional<UpdateConceptSchemeParams, 'organizationId'>, payload: OpPatch[]): Promise<ConceptSchemeProps>;
32 /**
33 * Get Concept Scheme
34 * @returns the Concept Scheme
35 * @throws if the request fails
36 * @see {@link https://www.contentful.com/developers/docs/references/content-management-api/#/reference/taxonomy/concept-scheme}
37 * @example
38 * ```javascript
39 * const concept = await client.conceptScheme.get({
40 * organizationId: '<organization_id>',
41 * conceptSchemeId: '<concept_scheme_id>',
42 * });
43 * ```
44 */
45 get(params: SetOptional<GetConceptSchemeParams, 'organizationId'>): Promise<ConceptSchemeProps>;
46 /**
47 * Get many Concept Schemes
48 * @returns list of many Concept Schemes
49 * @throws if the request fails
50 * @see {@link https://www.contentful.com/developers/docs/references/content-management-api/#/reference/taxonomy/concept-scheme-collection}
51 * @example
52 * ```javascript
53 * const concepts = await client.conceptScheme.getMany({
54 * organizationId: '<organization_id>',
55 * });
56 * ```
57 */
58 getMany(params: SetOptional<GetManyConceptSchemeParams, 'organizationId'>): Promise<CursorPaginatedCollectionProp<ConceptSchemeProps>>;
59 /**
60 * Get number of total Concept Scheme
61 * @returns number of total Concept Scheme
62 * @throws if the request fails
63 * @see {@link https://www.contentful.com/developers/docs/references/content-management-api/#/reference/taxonomy/total-concept-schemes}
64 * @example
65 * ```javascript
66 * const {total} = await client.conceptScheme.getTotal({
67 * organizationId: '<organization_id>',
68 * });
69 * ```
70 */
71 getTotal(params: SetOptional<GetOrganizationParams, 'organizationId'>): Promise<{
72 total: number;
73 }>;
74 /**
75 * Delete Concept Scheme
76 * @returns nothing
77 * @throws if the request fails
78 * @see {@link https://www.contentful.com/developers/docs/references/content-management-api/#/reference/taxonomy/concept-scheme}
79 * @example
80 * ```javascript
81 * await client.conceptScheme.update({
82 * organizationId: '<organization_id>',
83 * conceptSchemeId: '<concept_scheme_id>',
84 * });
85 * ```
86 */
87 delete(params: SetOptional<DeleteConceptSchemeParams, 'organizationId'>): Promise<void>;
88};