@datocms/cma-client 5.1.16 → 5.1.17
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/cjs/generated/Client.js +1 -1
- package/dist/cjs/generated/resources/Item.js.map +1 -1
- package/dist/cjs/utilities/itemInstancesHrefSchema.js +3 -0
- package/dist/cjs/utilities/itemInstancesHrefSchema.js.map +1 -0
- package/dist/esm/generated/ApiTypes.d.ts +4 -6
- package/dist/esm/generated/Client.js +1 -1
- package/dist/esm/generated/RawApiTypes.d.ts +4 -6
- package/dist/esm/generated/resources/Item.d.ts +7 -7
- package/dist/esm/generated/resources/Item.js.map +1 -1
- package/dist/esm/utilities/itemDefinition.d.ts +30 -0
- package/dist/esm/utilities/itemInstancesHrefSchema.d.ts +256 -0
- package/dist/esm/utilities/itemInstancesHrefSchema.js +2 -0
- package/dist/esm/utilities/itemInstancesHrefSchema.js.map +1 -0
- package/dist/types/generated/ApiTypes.d.ts +4 -6
- package/dist/types/generated/RawApiTypes.d.ts +4 -6
- package/dist/types/generated/resources/Item.d.ts +7 -7
- package/dist/types/utilities/itemDefinition.d.ts +30 -0
- package/dist/types/utilities/itemInstancesHrefSchema.d.ts +256 -0
- package/package.json +2 -2
- package/src/generated/ApiTypes.ts +7 -5
- package/src/generated/Client.ts +1 -1
- package/src/generated/RawApiTypes.ts +7 -5
- package/src/generated/resources/Item.ts +10 -10
- package/src/utilities/itemDefinition.ts +92 -0
- package/src/utilities/itemInstancesHrefSchema.ts +308 -0
|
@@ -88,7 +88,7 @@ class Client {
|
|
|
88
88
|
return this.config.baseUrl || Client.defaultBaseUrl;
|
|
89
89
|
}
|
|
90
90
|
request(options) {
|
|
91
|
-
return (0, rest_client_utils_1.request)(Object.assign(Object.assign(Object.assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v5.1.
|
|
91
|
+
return (0, rest_client_utils_1.request)(Object.assign(Object.assign(Object.assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v5.1.17', baseUrl: this.baseUrl, preCallStack: new Error().stack, extraHeaders: Object.assign(Object.assign(Object.assign({}, (this.config.extraHeaders || {})), (this.config.environment
|
|
92
92
|
? { 'X-Environment': this.config.environment }
|
|
93
93
|
: {})), { 'X-API-Version': '3' }), fetchJobResult: (jobId) => {
|
|
94
94
|
return this.jobResultsFetcher
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../src/generated/resources/Item.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kEAAoD;AACpD,sEAA8C;AAO9C,MAAqB,IAAK,SAAQ,sBAAY;IAmB5C;;;;;;;OAOG;IACH,IAAI,CACF,
|
|
1
|
+
{"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../src/generated/resources/Item.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kEAAoD;AACpD,sEAA8C;AAO9C,MAAqB,IAAK,SAAQ,sBAAY;IAmB5C;;;;;;;OAOG;IACH,IAAI,CACF,WAAiD;QAEjD,OAAO,IAAI,CAAC,OAAO,CAAI,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAChD,KAAK,CAAC,uBAAuB,CAAC,IAAI,CAAC,CACpC,CAAC;IACJ,CAAC;IAqBD;;;;;;;OAOG;IACH,OAAO,CACL,WAAoD;QAEpD,OAAO,IAAI,CAAC,MAAM;aACf,OAAO,CAAC;YACP,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,QAAQ;YACb,WAAW;SACZ,CAAC;aACD,IAAI,CACH,KAAK,CAAC,mCAAmC,CAC1C,CAAC;IACN,CAAC;IAED;;;;;;;OAOG;IACI,iBAAiB,CACtB,WAGC,EACD,eAAuC;;;;gBAEvC,KAA4B,eAAA,KAAA,cAAA,IAA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AAuB,CAC3B,IAAI,CACL,CACF,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,kBAAkB,CAChB,IAA2C;QAE3C,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAA2C;YACnE,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,2BAA2B;YAChC,IAAI;SACL,CAAC,CAAC;IACL,CAAC;;AAh2BH,uBAi2BC;AAh2BiB,SAAI,GAAG,MAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"itemInstancesHrefSchema.js","sourceRoot":"","sources":["../../../src/utilities/itemInstancesHrefSchema.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FieldCreateConfig, FieldUpdateConfig, GenericFieldAttributes } from '../fieldTypes/schema';
|
|
2
|
-
import type { ItemTypeDefinition, ToItemAttributes, ToItemAttributesInNestedResponse, ToItemAttributesInRequest } from '../utilities/itemDefinition';
|
|
2
|
+
import type { ItemTypeDefinition, ToItemAttributes, ToItemAttributesInNestedResponse, ToItemAttributesInRequest, ToItemHrefSchemaField, ToItemHrefSchemaOrderBy } from '../utilities/itemDefinition';
|
|
3
3
|
export type Field = GenericFieldAttributes<FieldStableShell>;
|
|
4
4
|
export type FieldAttributes = GenericFieldAttributes<FieldAttributesStableShell>;
|
|
5
5
|
export type FieldCreateSchema = FieldCreateConfig<FieldCreateSchemaStableShell>;
|
|
@@ -800,7 +800,7 @@ export type ItemInstancesTargetSchema<D extends ItemTypeDefinition = ItemTypeDef
|
|
|
800
800
|
* This interface was referenced by `Item`'s JSON-Schema
|
|
801
801
|
* via the `instances.hrefSchema` link.
|
|
802
802
|
*/
|
|
803
|
-
export type ItemInstancesHrefSchema = {
|
|
803
|
+
export type ItemInstancesHrefSchema<D extends ItemTypeDefinition = ItemTypeDefinition> = {
|
|
804
804
|
/**
|
|
805
805
|
* For Modular Content, Structured Text and Single Block fields. If set, returns full payload for nested blocks instead of IDs
|
|
806
806
|
*/
|
|
@@ -824,9 +824,7 @@ export type ItemInstancesHrefSchema = {
|
|
|
824
824
|
/**
|
|
825
825
|
* Same as [GraphQL API records filters](/docs/content-delivery-api/filtering-records): you must use square brackets to indicate nesting levels. E.g. if you wanna [filter by parent record](/docs/content-delivery-api/filtering-records#parent) in a tree of records, you must use `filter[fields][parent][eq]=<ID_VALUE>`. Use snake_case for fields names. If `locale` is defined, search within that locale. Otherwise environment's main locale will be used.
|
|
826
826
|
*/
|
|
827
|
-
fields?:
|
|
828
|
-
[k: string]: unknown;
|
|
829
|
-
};
|
|
827
|
+
fields?: ToItemHrefSchemaField<D>;
|
|
830
828
|
/**
|
|
831
829
|
* When set, only valid records are included in the results.
|
|
832
830
|
*/
|
|
@@ -853,7 +851,7 @@ export type ItemInstancesHrefSchema = {
|
|
|
853
851
|
/**
|
|
854
852
|
* Fields used to order results. You **must** specify also `filter[type]` with one element only to be able use this option. Format: `<field_name>_(ASC|DESC)`, where `<field_name>` can be either the API key of a model's field, or one of the following meta columns: `id`, `_updated_at`, `_created_at`, `_status`, `_published_at`, `_first_published_at`, `_publication_scheduled_at`, `_unpublishing_scheduled_at`, `_is_valid`, `position` (only for sortable models). You can pass multiple comma separated rules.
|
|
855
853
|
*/
|
|
856
|
-
order_by?:
|
|
854
|
+
order_by?: ToItemHrefSchemaOrderBy<D>;
|
|
857
855
|
/**
|
|
858
856
|
* Whether you want the currently published versions (`published`, default) of your records, or the latest available (`current`)
|
|
859
857
|
*/
|
|
@@ -62,7 +62,7 @@ export class Client {
|
|
|
62
62
|
return this.config.baseUrl || Client.defaultBaseUrl;
|
|
63
63
|
}
|
|
64
64
|
request(options) {
|
|
65
|
-
return request(Object.assign(Object.assign(Object.assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v5.1.
|
|
65
|
+
return request(Object.assign(Object.assign(Object.assign({}, this.config), options), { logFn: this.config.logFn || console.log, userAgent: '@datocms/cma-client v5.1.17', baseUrl: this.baseUrl, preCallStack: new Error().stack, extraHeaders: Object.assign(Object.assign(Object.assign({}, (this.config.extraHeaders || {})), (this.config.environment
|
|
66
66
|
? { 'X-Environment': this.config.environment }
|
|
67
67
|
: {})), { 'X-API-Version': '3' }), fetchJobResult: (jobId) => {
|
|
68
68
|
return this.jobResultsFetcher
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FieldCreateConfig, FieldUpdateConfig, GenericFieldAttributes } from '../fieldTypes/schema';
|
|
2
|
-
import type { ItemTypeDefinition, ToItemAttributes, ToItemAttributesInNestedResponse, ToItemAttributesInRequest } from '../utilities/itemDefinition';
|
|
2
|
+
import type { ItemTypeDefinition, ToItemAttributes, ToItemAttributesInNestedResponse, ToItemAttributesInRequest, ToItemHrefSchemaField, ToItemHrefSchemaOrderBy } from '../utilities/itemDefinition';
|
|
3
3
|
export type Field = FieldStableShell;
|
|
4
4
|
export type FieldAttributes = GenericFieldAttributes<FieldAttributesStableShell>;
|
|
5
5
|
export type FieldCreateSchema = Omit<FieldCreateSchemaStableShell, 'data'> & {
|
|
@@ -624,7 +624,7 @@ export type BuildEventInstancesHrefSchema = {
|
|
|
624
624
|
* This interface was referenced by `Item`'s JSON-Schema
|
|
625
625
|
* via the `instances.hrefSchema` link.
|
|
626
626
|
*/
|
|
627
|
-
export type ItemInstancesHrefSchema = {
|
|
627
|
+
export type ItemInstancesHrefSchema<D extends ItemTypeDefinition = ItemTypeDefinition> = {
|
|
628
628
|
/**
|
|
629
629
|
* For Modular Content, Structured Text and Single Block fields. If set, returns full payload for nested blocks instead of IDs
|
|
630
630
|
*/
|
|
@@ -648,9 +648,7 @@ export type ItemInstancesHrefSchema = {
|
|
|
648
648
|
/**
|
|
649
649
|
* Same as [GraphQL API records filters](/docs/content-delivery-api/filtering-records): you must use square brackets to indicate nesting levels. E.g. if you wanna [filter by parent record](/docs/content-delivery-api/filtering-records#parent) in a tree of records, you must use `filter[fields][parent][eq]=<ID_VALUE>`. Use snake_case for fields names. If `locale` is defined, search within that locale. Otherwise environment's main locale will be used.
|
|
650
650
|
*/
|
|
651
|
-
fields?:
|
|
652
|
-
[k: string]: unknown;
|
|
653
|
-
};
|
|
651
|
+
fields?: ToItemHrefSchemaField<D>;
|
|
654
652
|
/**
|
|
655
653
|
* When set, only valid records are included in the results.
|
|
656
654
|
*/
|
|
@@ -677,7 +675,7 @@ export type ItemInstancesHrefSchema = {
|
|
|
677
675
|
/**
|
|
678
676
|
* Fields used to order results. You **must** specify also `filter[type]` with one element only to be able use this option. Format: `<field_name>_(ASC|DESC)`, where `<field_name>` can be either the API key of a model's field, or one of the following meta columns: `id`, `_updated_at`, `_created_at`, `_status`, `_published_at`, `_first_published_at`, `_publication_scheduled_at`, `_unpublishing_scheduled_at`, `_is_valid`, `position` (only for sortable models). You can pass multiple comma separated rules.
|
|
679
677
|
*/
|
|
680
|
-
order_by?:
|
|
678
|
+
order_by?: ToItemHrefSchemaOrderBy<D>;
|
|
681
679
|
/**
|
|
682
680
|
* Whether you want the currently published versions (`published`, default) of your records, or the latest available (`current`)
|
|
683
681
|
*/
|
|
@@ -14,10 +14,10 @@ export default class Item extends BaseResource {
|
|
|
14
14
|
* @throws {ApiError}
|
|
15
15
|
* @throws {TimeoutError}
|
|
16
16
|
*/
|
|
17
|
-
list<D extends ItemTypeDefinition = ItemTypeDefinition>(queryParams: ApiTypes.ItemInstancesHrefSchema & {
|
|
17
|
+
list<D extends ItemTypeDefinition = ItemTypeDefinition>(queryParams: ApiTypes.ItemInstancesHrefSchema<D> & {
|
|
18
18
|
nested: true;
|
|
19
19
|
}): Promise<ApiTypes.ItemInstancesTargetSchema<NoInfer<D>, true>>;
|
|
20
|
-
list<D extends ItemTypeDefinition = ItemTypeDefinition>(queryParams?: ApiTypes.ItemInstancesHrefSchema & {
|
|
20
|
+
list<D extends ItemTypeDefinition = ItemTypeDefinition>(queryParams?: ApiTypes.ItemInstancesHrefSchema<D> & {
|
|
21
21
|
nested?: false | undefined;
|
|
22
22
|
}): Promise<ApiTypes.ItemInstancesTargetSchema<NoInfer<D>, false>>;
|
|
23
23
|
/**
|
|
@@ -28,13 +28,13 @@ export default class Item extends BaseResource {
|
|
|
28
28
|
* @throws {ApiError}
|
|
29
29
|
* @throws {TimeoutError}
|
|
30
30
|
*/
|
|
31
|
-
rawList<D extends ItemTypeDefinition = ItemTypeDefinition>(queryParams: RawApiTypes.ItemInstancesHrefSchema & {
|
|
31
|
+
rawList<D extends ItemTypeDefinition = ItemTypeDefinition>(queryParams: RawApiTypes.ItemInstancesHrefSchema<D> & {
|
|
32
32
|
nested: true;
|
|
33
33
|
}): Promise<RawApiTypes.ItemInstancesTargetSchema<NoInfer<D>, true>>;
|
|
34
|
-
rawList<D extends ItemTypeDefinition = ItemTypeDefinition>(queryParams?: RawApiTypes.ItemInstancesHrefSchema & {
|
|
34
|
+
rawList<D extends ItemTypeDefinition = ItemTypeDefinition>(queryParams?: RawApiTypes.ItemInstancesHrefSchema<D> & {
|
|
35
35
|
nested?: false | undefined;
|
|
36
36
|
}): Promise<RawApiTypes.ItemInstancesTargetSchema<NoInfer<D>, false>>;
|
|
37
|
-
rawList<D extends ItemTypeDefinition = ItemTypeDefinition>(queryParams?: RawApiTypes.ItemInstancesHrefSchema): Promise<RawApiTypes.ItemInstancesTargetSchema<NoInfer<D>, true>>;
|
|
37
|
+
rawList<D extends ItemTypeDefinition = ItemTypeDefinition>(queryParams?: RawApiTypes.ItemInstancesHrefSchema<D>): Promise<RawApiTypes.ItemInstancesTargetSchema<NoInfer<D>, true>>;
|
|
38
38
|
/**
|
|
39
39
|
* Async iterator to auto-paginate over elements returned by list()
|
|
40
40
|
*
|
|
@@ -43,7 +43,7 @@ export default class Item extends BaseResource {
|
|
|
43
43
|
* @throws {ApiError}
|
|
44
44
|
* @throws {TimeoutError}
|
|
45
45
|
*/
|
|
46
|
-
listPagedIterator<D extends ItemTypeDefinition = ItemTypeDefinition>(queryParams?: Utils.OmitFromKnownKeys<ApiTypes.ItemInstancesHrefSchema
|
|
46
|
+
listPagedIterator<D extends ItemTypeDefinition = ItemTypeDefinition>(queryParams?: Utils.OmitFromKnownKeys<ApiTypes.ItemInstancesHrefSchema<D>, 'page'>, iteratorOptions?: Utils.IteratorOptions): AsyncGenerator<ApiTypes.ItemInNestedResponse<NoInfer<D>>, void, unknown>;
|
|
47
47
|
/**
|
|
48
48
|
* Async iterator to auto-paginate over elements returned by rawList()
|
|
49
49
|
*
|
|
@@ -52,7 +52,7 @@ export default class Item extends BaseResource {
|
|
|
52
52
|
* @throws {ApiError}
|
|
53
53
|
* @throws {TimeoutError}
|
|
54
54
|
*/
|
|
55
|
-
rawListPagedIterator<D extends ItemTypeDefinition = ItemTypeDefinition>(queryParams?: Utils.OmitFromKnownKeys<RawApiTypes.ItemInstancesHrefSchema
|
|
55
|
+
rawListPagedIterator<D extends ItemTypeDefinition = ItemTypeDefinition>(queryParams?: Utils.OmitFromKnownKeys<RawApiTypes.ItemInstancesHrefSchema<D>, 'page'>, iteratorOptions?: Utils.IteratorOptions): AsyncGenerator<RawApiTypes.ItemInNestedResponse<NoInfer<D>>, void, unknown>;
|
|
56
56
|
/**
|
|
57
57
|
* Validates an existing record field
|
|
58
58
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../src/generated/resources/Item.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,4BAA4B,CAAC;AACpD,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAO9C,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,YAAY;IAmB5C;;;;;;;OAOG;IACH,IAAI,CACF,
|
|
1
|
+
{"version":3,"file":"Item.js","sourceRoot":"","sources":["../../../../src/generated/resources/Item.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,4BAA4B,CAAC;AACpD,OAAO,YAAY,MAAM,oBAAoB,CAAC;AAO9C,MAAM,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E,EAAE,CACd,KAAK,CAAC,uBAAuB,CAAoC,IAAI,CAAC,CACvE,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,cAAc,CACZ,IAAuC;QAEvC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAuC;YAC/D,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,qBAAqB;YAC1B,IAAI;SACL,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,eAAe,CAAC,IAAwC;QACtD,OAAO,IAAI,CAAC,kBAAkB,CAC5B,KAAK,CAAC,oBAAoB,CAAwC,IAAI,EAAE;YACtE,IAAI,EAAE,mCAAmC;YACzC,UAAU,EAAE,CAAC,OAAO,CAAC;YACrB,aAAa,EAAE,CAAC,OAAO,CAAC;SACzB,CAAC,CACH,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CACd,KAAK,CAAC,uBAAuB,CAC3B,IAAI,CACL,CACF,CAAC;IACJ,CAAC;IAED;;;;;;;OAOG;IACH,kBAAkB,CAChB,IAA2C;QAE3C,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAA2C;YACnE,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,2BAA2B;YAChC,IAAI;SACL,CAAC,CAAC;IACL,CAAC;;AA/1Be,SAAI,GAAG,MAAe,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BlockInNestedResponse, BlockInRequest, BooleanFieldValue, ColorFieldValue, DateFieldValue, DateTimeFieldValue, FileFieldValue, FileFieldValueInRequest, FloatFieldValue, GalleryFieldValue, GalleryFieldValueInRequest, IntegerFieldValue, JsonFieldValue, LatLonFieldValue, LinkFieldValue, LinksFieldValue, RichTextFieldValue, RichTextFieldValueInNestedResponse, RichTextFieldValueInRequest, SeoFieldValue, SingleBlockFieldValue, SingleBlockFieldValueInNestedResponse, SingleBlockFieldValueInRequest, SlugFieldValue, StringFieldValue, StructuredTextFieldValue, StructuredTextFieldValueInNestedResponse, StructuredTextFieldValueInRequest, TextFieldValue, VideoFieldValue } from '../fieldTypes';
|
|
2
|
+
import type { BooleanHrefFilter, ColorHrefFilter, DateHrefFilter, DateTimeHrefFilter, FileHrefFilter, FloatHrefFilter, GalleryHrefFilter, IntegerHrefFilter, ItemMetaFilter, ItemMetaOrderBy, JsonHrefFilter, LatLonHrefFilter, LinkHrefFilter, LinksHrefFilter, ParentIdFilter, PositionFilter, RichTextHrefFilter, SeoHrefFilter, SingleBlockHrefFilter, SlugHrefFilter, StringHrefFilter, StructuredTextHrefFilter, TextHrefFilter, VideoHrefFilter } from './itemInstancesHrefSchema';
|
|
2
3
|
import type { LocalizedFieldValue } from './normalizedFieldValues';
|
|
3
4
|
/** Base field definition */
|
|
4
5
|
type BaseFieldDefinition<Type extends string> = {
|
|
@@ -75,6 +76,29 @@ type FieldTypeToValueInRequest = {
|
|
|
75
76
|
video: VideoFieldValue;
|
|
76
77
|
unknown: unknown;
|
|
77
78
|
};
|
|
79
|
+
type FieldTypeToHrefFilter = {
|
|
80
|
+
boolean: BooleanHrefFilter;
|
|
81
|
+
color: ColorHrefFilter;
|
|
82
|
+
date: DateHrefFilter;
|
|
83
|
+
date_time: DateTimeHrefFilter;
|
|
84
|
+
file: FileHrefFilter;
|
|
85
|
+
float: FloatHrefFilter;
|
|
86
|
+
gallery: GalleryHrefFilter;
|
|
87
|
+
integer: IntegerHrefFilter;
|
|
88
|
+
json: JsonHrefFilter;
|
|
89
|
+
lat_lon: LatLonHrefFilter;
|
|
90
|
+
link: LinkHrefFilter;
|
|
91
|
+
links: LinksHrefFilter;
|
|
92
|
+
rich_text: RichTextHrefFilter;
|
|
93
|
+
seo: SeoHrefFilter;
|
|
94
|
+
single_block: SingleBlockHrefFilter;
|
|
95
|
+
slug: SlugHrefFilter;
|
|
96
|
+
string: StringHrefFilter;
|
|
97
|
+
structured_text: StructuredTextHrefFilter;
|
|
98
|
+
text: TextHrefFilter;
|
|
99
|
+
video: VideoHrefFilter;
|
|
100
|
+
unknown: unknown;
|
|
101
|
+
};
|
|
78
102
|
/** Localized wrapper */
|
|
79
103
|
type LocalizeIfNeeded<T extends FieldDefinition, Value, Locales extends string> = T extends {
|
|
80
104
|
localized: true;
|
|
@@ -102,6 +126,12 @@ export type ToItemAttributesInRequest<T extends ItemTypeDefinition<any, any, any
|
|
|
102
126
|
export type ToItemAttributesInNestedResponse<T extends ItemTypeDefinition<any, any, any>> = T extends ItemTypeDefinition<infer Settings, infer ItemTypeId, infer Fields> ? keyof Fields extends never ? Record<string, unknown> : {
|
|
103
127
|
[K in keyof Fields]: Fields[K] extends FieldDefinition ? FieldDefinitionToFieldValueInNestedResponse<Fields[K], Settings['locales']> : never;
|
|
104
128
|
} : never;
|
|
129
|
+
export type ToItemHrefSchemaField<T extends ItemTypeDefinition<any, any, any>> = T extends ItemTypeDefinition<infer Settings, infer ItemTypeId, infer Fields> ? keyof Fields extends never ? Record<string, unknown> : ItemMetaFilter & Partial<{
|
|
130
|
+
[K in keyof Fields]: K extends 'position' ? PositionFilter : K extends 'parent_id' ? ParentIdFilter : Fields[K] extends FieldDefinition ? FieldTypeToHrefFilter[Fields[K]['type']] : never;
|
|
131
|
+
}> : never;
|
|
132
|
+
export type ToItemHrefSchemaOrderBy<T extends ItemTypeDefinition<any, any, any>> = (T extends ItemTypeDefinition<infer Settings, infer ItemTypeId, infer Fields> ? keyof Fields extends never ? string : {
|
|
133
|
+
[K in keyof Fields]: Fields[K] extends FieldDefinition ? Fields[K]['type'] extends 'boolean' | 'date' | 'date_time' | 'float' | 'integer' | 'string' ? `${K & string}_ASC` | `${K & string}_DESC` : never : never;
|
|
134
|
+
}[keyof Fields] : never) | ItemMetaOrderBy;
|
|
105
135
|
type NestedItemTypeDefinitions<T extends ItemTypeDefinition<any, any, any>, Seen extends string = never> = T extends ItemTypeDefinition<any, infer Id, infer Fields> ? Id extends Seen ? never : {
|
|
106
136
|
[K in keyof Fields]: Fields[K] extends RichTextFieldDefinition<infer B> ? B | NestedItemTypeDefinitions<B, Seen | Id> : Fields[K] extends SingleBlockFieldDefinition<infer B> ? B | NestedItemTypeDefinitions<B, Seen | Id> : Fields[K] extends StructuredTextFieldDefinition<infer B, infer I> ? B | I | NestedItemTypeDefinitions<B, Seen | Id> | NestedItemTypeDefinitions<I, Seen | Id> : never;
|
|
107
137
|
}[keyof Fields] : never;
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
export type StringMatchesFilter = {
|
|
2
|
+
/** Pattern to match against */
|
|
3
|
+
pattern: string;
|
|
4
|
+
/** Whether the match should be case sensitive */
|
|
5
|
+
case_sensitive?: boolean;
|
|
6
|
+
/** Whether to treat the pattern as a regular expression */
|
|
7
|
+
regexp?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type LatLonNearFilter = {
|
|
10
|
+
/** Latitude coordinate */
|
|
11
|
+
latitude: number;
|
|
12
|
+
/** Longitude coordinate */
|
|
13
|
+
longitude: number;
|
|
14
|
+
/** Radius in meters */
|
|
15
|
+
radius: number;
|
|
16
|
+
};
|
|
17
|
+
export type BooleanHrefFilter = {
|
|
18
|
+
/** Search for records with an exact match */
|
|
19
|
+
eq?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type IntegerHrefFilter = {
|
|
22
|
+
/** Filter records with a value that's strictly greater than the one specified */
|
|
23
|
+
gt?: number;
|
|
24
|
+
/** Filter records with a value that's less than the one specified */
|
|
25
|
+
lt?: number;
|
|
26
|
+
/** Filter records with a value that's greater than or equal to the one specified */
|
|
27
|
+
gte?: number;
|
|
28
|
+
/** Filter records with a value that's less or equal than the one specified */
|
|
29
|
+
lte?: number;
|
|
30
|
+
/** Filter records with the specified field defined (i.e. with any value) or not */
|
|
31
|
+
exists?: boolean;
|
|
32
|
+
/** Search for records with an exact match */
|
|
33
|
+
eq?: number;
|
|
34
|
+
/** Exclude records with an exact match */
|
|
35
|
+
neq?: number;
|
|
36
|
+
};
|
|
37
|
+
export type FloatHrefFilter = {
|
|
38
|
+
/** Filter records with a value that's strictly greater than the one specified */
|
|
39
|
+
gt?: number;
|
|
40
|
+
/** Filter records with a value that's less than the one specified */
|
|
41
|
+
lt?: number;
|
|
42
|
+
/** Filter records with a value that's greater than or equal to the one specified */
|
|
43
|
+
gte?: number;
|
|
44
|
+
/** Filter records with a value that's less or equal than the one specified */
|
|
45
|
+
lte?: number;
|
|
46
|
+
/** Filter records with the specified field defined (i.e. with any value) or not */
|
|
47
|
+
exists?: boolean;
|
|
48
|
+
/** Search for records with an exact match */
|
|
49
|
+
eq?: number;
|
|
50
|
+
/** Exclude records with an exact match */
|
|
51
|
+
neq?: number;
|
|
52
|
+
};
|
|
53
|
+
export type DateHrefFilter = {
|
|
54
|
+
/** Filter records with a value that's strictly greater than the one specified */
|
|
55
|
+
gt?: string;
|
|
56
|
+
/** Filter records with a value that's less than the one specified */
|
|
57
|
+
lt?: string;
|
|
58
|
+
/** Filter records with a value that's greater than or equal to the one specified */
|
|
59
|
+
gte?: string;
|
|
60
|
+
/** Filter records with a value that's less or equal than the one specified */
|
|
61
|
+
lte?: string;
|
|
62
|
+
/** Filter records with the specified field defined (i.e. with any value) or not */
|
|
63
|
+
exists?: boolean;
|
|
64
|
+
/** Search for records with an exact match */
|
|
65
|
+
eq?: string;
|
|
66
|
+
/** Exclude records with an exact match */
|
|
67
|
+
neq?: string;
|
|
68
|
+
};
|
|
69
|
+
export type ColorHrefFilter = {
|
|
70
|
+
/** Filter records with the specified field defined (i.e. with any value) or not */
|
|
71
|
+
exists?: boolean;
|
|
72
|
+
};
|
|
73
|
+
export type StringHrefFilter = {
|
|
74
|
+
/** Filter records based on a regular expression */
|
|
75
|
+
matches?: StringMatchesFilter;
|
|
76
|
+
/** Exclude records based on a regular expression */
|
|
77
|
+
not_matches?: StringMatchesFilter;
|
|
78
|
+
/** Filter records with the specified field set as blank (null or empty string) */
|
|
79
|
+
is_blank?: boolean;
|
|
80
|
+
/** Filter records with the specified field present (neither null, nor empty string) */
|
|
81
|
+
is_present?: boolean;
|
|
82
|
+
/** Search for records with an exact match */
|
|
83
|
+
eq?: string;
|
|
84
|
+
/** Exclude records with an exact match */
|
|
85
|
+
neq?: string;
|
|
86
|
+
/** Filter records that equal one of the specified values */
|
|
87
|
+
in?: string[];
|
|
88
|
+
/** Filter records that do not equal one of the specified values */
|
|
89
|
+
not_in?: string[];
|
|
90
|
+
/** @deprecated Use is_present instead. Filter records with the specified field defined (i.e. with any value) or not */
|
|
91
|
+
exists?: boolean;
|
|
92
|
+
};
|
|
93
|
+
export type DateTimeHrefFilter = {
|
|
94
|
+
/** Filter records with a value that's strictly greater than the one specified. Seconds and milliseconds are truncated from the argument. */
|
|
95
|
+
gt?: string;
|
|
96
|
+
/** Filter records with a value that's less than the one specified. Seconds and milliseconds are truncated from the argument. */
|
|
97
|
+
lt?: string;
|
|
98
|
+
/** Filter records with a value that's greater than or equal to than the one specified. Seconds and milliseconds are truncated from the argument. */
|
|
99
|
+
gte?: string;
|
|
100
|
+
/** Filter records with a value that's less or equal than the one specified. Seconds and milliseconds are truncated from the argument. */
|
|
101
|
+
lte?: string;
|
|
102
|
+
/** Filter records with a value that's within the specified minute range. Seconds and milliseconds are truncated from the argument. */
|
|
103
|
+
eq?: string;
|
|
104
|
+
/** Filter records with a value that's outside the specified minute range. Seconds and milliseconds are truncated from the argument. */
|
|
105
|
+
neq?: string;
|
|
106
|
+
/** Filter records with the specified field defined (i.e. with any value) or not */
|
|
107
|
+
exists?: boolean;
|
|
108
|
+
};
|
|
109
|
+
export type JsonHrefFilter = {
|
|
110
|
+
/** Filter records with the specified field defined (i.e. with any value) or not */
|
|
111
|
+
exists?: boolean;
|
|
112
|
+
};
|
|
113
|
+
export type LatLonHrefFilter = {
|
|
114
|
+
/** Filter records within the specified radius in meters */
|
|
115
|
+
near?: LatLonNearFilter;
|
|
116
|
+
/** Filter records with the specified field defined (i.e. with any value) or not */
|
|
117
|
+
exists?: boolean;
|
|
118
|
+
};
|
|
119
|
+
export type SlugHrefFilter = {
|
|
120
|
+
/** Search for records with an exact match */
|
|
121
|
+
eq?: string;
|
|
122
|
+
/** Exclude records with an exact match */
|
|
123
|
+
neq?: string;
|
|
124
|
+
/** Filter records that have one of the specified slugs */
|
|
125
|
+
in?: string[];
|
|
126
|
+
/** Filter records that do not have one of the specified slugs */
|
|
127
|
+
not_in?: string[];
|
|
128
|
+
};
|
|
129
|
+
export type VideoHrefFilter = {
|
|
130
|
+
/** Filter records with the specified field defined (i.e. with any value) or not */
|
|
131
|
+
exists?: boolean;
|
|
132
|
+
};
|
|
133
|
+
export type SeoHrefFilter = {
|
|
134
|
+
/** Filter records with the specified field defined (i.e. with any value) or not */
|
|
135
|
+
exists?: boolean;
|
|
136
|
+
};
|
|
137
|
+
export type FileHrefFilter = {
|
|
138
|
+
/** Search for records with an exact match. The specified value must be an Upload ID */
|
|
139
|
+
eq?: string;
|
|
140
|
+
/** Exclude records with an exact match. The specified value must be an Upload ID */
|
|
141
|
+
neq?: string;
|
|
142
|
+
/** Filter records that have one of the specified uploads */
|
|
143
|
+
in?: string[];
|
|
144
|
+
/** Filter records that do not have one of the specified uploads */
|
|
145
|
+
not_in?: string[];
|
|
146
|
+
/** Filter records with the specified field defined (i.e. with any value) or not */
|
|
147
|
+
exists?: boolean;
|
|
148
|
+
};
|
|
149
|
+
export type GalleryHrefFilter = {
|
|
150
|
+
/** Search for records with an exact match. The specified values must be Upload IDs */
|
|
151
|
+
eq?: string[];
|
|
152
|
+
/** Filter records that have all of the specified uploads. The specified values must be Upload IDs */
|
|
153
|
+
all_in?: string[];
|
|
154
|
+
/** Filter records that have one of the specified uploads. The specified values must be Upload IDs */
|
|
155
|
+
any_in?: string[];
|
|
156
|
+
/** Filter records that do not have any of the specified uploads. The specified values must be Upload IDs */
|
|
157
|
+
not_in?: string[];
|
|
158
|
+
/** Filter records with the specified field defined (i.e. with any value) or not */
|
|
159
|
+
exists?: boolean;
|
|
160
|
+
};
|
|
161
|
+
export type LinkHrefFilter = {
|
|
162
|
+
/** Search for records with an exact match. The specified value must be a Record ID */
|
|
163
|
+
eq?: string;
|
|
164
|
+
/** Exclude records with an exact match. The specified value must be a Record ID */
|
|
165
|
+
neq?: string;
|
|
166
|
+
/** Filter records linked to one of the specified records */
|
|
167
|
+
in?: string[];
|
|
168
|
+
/** Filter records not linked to one of the specified records */
|
|
169
|
+
not_in?: string[];
|
|
170
|
+
/** Filter records with the specified field defined (i.e. with any value) or not */
|
|
171
|
+
exists?: boolean;
|
|
172
|
+
};
|
|
173
|
+
export type LinksHrefFilter = {
|
|
174
|
+
/** Search for records with an exact match. The specified values must be Record IDs */
|
|
175
|
+
eq?: string[];
|
|
176
|
+
/** Filter records linked to all of the specified records. The specified values must be Record IDs */
|
|
177
|
+
all_in?: string[];
|
|
178
|
+
/** Filter records linked to at least one of the specified records. The specified values must be Record IDs */
|
|
179
|
+
any_in?: string[];
|
|
180
|
+
/** Filter records not linked to any of the specified records. The specified values must be Record IDs */
|
|
181
|
+
not_in?: string[];
|
|
182
|
+
/** Filter records with the specified field defined (i.e. with any value) or not */
|
|
183
|
+
exists?: boolean;
|
|
184
|
+
};
|
|
185
|
+
export type RichTextHrefFilter = Record<string, never>;
|
|
186
|
+
export type StructuredTextHrefFilter = {
|
|
187
|
+
/** Filter records based on a regular expression */
|
|
188
|
+
matches?: StringMatchesFilter;
|
|
189
|
+
/** Exclude records based on a regular expression */
|
|
190
|
+
not_matches?: StringMatchesFilter;
|
|
191
|
+
};
|
|
192
|
+
export type SingleBlockHrefFilter = Record<string, never>;
|
|
193
|
+
export type TextHrefFilter = {
|
|
194
|
+
/** Filter records based on a regular expression */
|
|
195
|
+
matches?: StringMatchesFilter;
|
|
196
|
+
/** Exclude records based on a regular expression */
|
|
197
|
+
not_matches?: StringMatchesFilter;
|
|
198
|
+
/** Filter records with the specified field set as blank (null or empty string) */
|
|
199
|
+
is_blank?: boolean;
|
|
200
|
+
/** Filter records with the specified field present (neither null, nor empty string) */
|
|
201
|
+
is_present?: boolean;
|
|
202
|
+
/** @deprecated Use is_present instead. Filter records with the specified field defined (i.e. with any value) or not */
|
|
203
|
+
exists?: boolean;
|
|
204
|
+
};
|
|
205
|
+
export type StatusFilter = {
|
|
206
|
+
/** Search the record with the specified status */
|
|
207
|
+
eq?: 'draft' | 'updated' | 'published';
|
|
208
|
+
/** Exclude the record with the specified status */
|
|
209
|
+
neq?: 'draft' | 'updated' | 'published';
|
|
210
|
+
/** Search records with the specified statuses */
|
|
211
|
+
in?: ('draft' | 'updated' | 'published')[];
|
|
212
|
+
/** Search records without the specified statuses */
|
|
213
|
+
notIn?: ('draft' | 'updated' | 'published')[];
|
|
214
|
+
};
|
|
215
|
+
export type ItemIdFilter = {
|
|
216
|
+
/** Search the record with the specified ID */
|
|
217
|
+
eq?: string;
|
|
218
|
+
/** Exclude the record with the specified ID */
|
|
219
|
+
neq?: string;
|
|
220
|
+
/** Search records with the specified IDs */
|
|
221
|
+
in?: string[];
|
|
222
|
+
/** Search records that do not have the specified IDs */
|
|
223
|
+
notIn?: string[];
|
|
224
|
+
};
|
|
225
|
+
export type ParentIdFilter = {
|
|
226
|
+
/** Filter records children of the specified record. Value must be a Record ID */
|
|
227
|
+
eq?: string;
|
|
228
|
+
/** Filter records with a parent record or not */
|
|
229
|
+
exists?: boolean;
|
|
230
|
+
};
|
|
231
|
+
export type PositionFilter = {
|
|
232
|
+
/** Filter records with a value that's strictly greater than the one specified */
|
|
233
|
+
gt?: number;
|
|
234
|
+
/** Filter records with a value that's less than the one specified */
|
|
235
|
+
lt?: number;
|
|
236
|
+
/** Filter records with a value that's greater than or equal to the one specified */
|
|
237
|
+
gte?: number;
|
|
238
|
+
/** Filter records with a value that's less or equal than the one specified */
|
|
239
|
+
lte?: number;
|
|
240
|
+
/** Search for records with an exact match */
|
|
241
|
+
eq?: number;
|
|
242
|
+
/** Exclude records with an exact match */
|
|
243
|
+
neq?: number;
|
|
244
|
+
};
|
|
245
|
+
export type ItemMetaFilter = {
|
|
246
|
+
_created_at?: DateTimeHrefFilter;
|
|
247
|
+
_first_published_at?: DateTimeHrefFilter;
|
|
248
|
+
_is_valid?: BooleanHrefFilter;
|
|
249
|
+
_publication_scheduled_at?: DateTimeHrefFilter;
|
|
250
|
+
_published_at?: DateTimeHrefFilter;
|
|
251
|
+
_status?: StatusFilter;
|
|
252
|
+
_unpublishing_scheduled_at?: DateTimeHrefFilter;
|
|
253
|
+
_updated_at?: DateTimeHrefFilter;
|
|
254
|
+
id?: ItemIdFilter;
|
|
255
|
+
};
|
|
256
|
+
export type ItemMetaOrderBy = '_created_at_ASC' | '_created_at_DESC' | 'id_ASC' | 'id_DESC' | '_first_published_at_ASC' | '_first_published_at_DESC' | '_publication_scheduled_at_ASC' | '_publication_scheduled_at_DESC' | '_unpublishing_scheduled_at_ASC' | '_unpublishing_scheduled_at_DESC' | '_published_at_ASC' | '_published_at_DESC' | '_status_ASC' | '_status_DESC' | '_updated_at_ASC' | '_updated_at_DESC' | '_is_valid_ASC' | '_is_valid_DESC';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"itemInstancesHrefSchema.js","sourceRoot":"","sources":["../../../src/utilities/itemInstancesHrefSchema.ts"],"names":[],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FieldCreateConfig, FieldUpdateConfig, GenericFieldAttributes } from '../fieldTypes/schema';
|
|
2
|
-
import type { ItemTypeDefinition, ToItemAttributes, ToItemAttributesInNestedResponse, ToItemAttributesInRequest } from '../utilities/itemDefinition';
|
|
2
|
+
import type { ItemTypeDefinition, ToItemAttributes, ToItemAttributesInNestedResponse, ToItemAttributesInRequest, ToItemHrefSchemaField, ToItemHrefSchemaOrderBy } from '../utilities/itemDefinition';
|
|
3
3
|
export type Field = GenericFieldAttributes<FieldStableShell>;
|
|
4
4
|
export type FieldAttributes = GenericFieldAttributes<FieldAttributesStableShell>;
|
|
5
5
|
export type FieldCreateSchema = FieldCreateConfig<FieldCreateSchemaStableShell>;
|
|
@@ -800,7 +800,7 @@ export type ItemInstancesTargetSchema<D extends ItemTypeDefinition = ItemTypeDef
|
|
|
800
800
|
* This interface was referenced by `Item`'s JSON-Schema
|
|
801
801
|
* via the `instances.hrefSchema` link.
|
|
802
802
|
*/
|
|
803
|
-
export type ItemInstancesHrefSchema = {
|
|
803
|
+
export type ItemInstancesHrefSchema<D extends ItemTypeDefinition = ItemTypeDefinition> = {
|
|
804
804
|
/**
|
|
805
805
|
* For Modular Content, Structured Text and Single Block fields. If set, returns full payload for nested blocks instead of IDs
|
|
806
806
|
*/
|
|
@@ -824,9 +824,7 @@ export type ItemInstancesHrefSchema = {
|
|
|
824
824
|
/**
|
|
825
825
|
* Same as [GraphQL API records filters](/docs/content-delivery-api/filtering-records): you must use square brackets to indicate nesting levels. E.g. if you wanna [filter by parent record](/docs/content-delivery-api/filtering-records#parent) in a tree of records, you must use `filter[fields][parent][eq]=<ID_VALUE>`. Use snake_case for fields names. If `locale` is defined, search within that locale. Otherwise environment's main locale will be used.
|
|
826
826
|
*/
|
|
827
|
-
fields?:
|
|
828
|
-
[k: string]: unknown;
|
|
829
|
-
};
|
|
827
|
+
fields?: ToItemHrefSchemaField<D>;
|
|
830
828
|
/**
|
|
831
829
|
* When set, only valid records are included in the results.
|
|
832
830
|
*/
|
|
@@ -853,7 +851,7 @@ export type ItemInstancesHrefSchema = {
|
|
|
853
851
|
/**
|
|
854
852
|
* Fields used to order results. You **must** specify also `filter[type]` with one element only to be able use this option. Format: `<field_name>_(ASC|DESC)`, where `<field_name>` can be either the API key of a model's field, or one of the following meta columns: `id`, `_updated_at`, `_created_at`, `_status`, `_published_at`, `_first_published_at`, `_publication_scheduled_at`, `_unpublishing_scheduled_at`, `_is_valid`, `position` (only for sortable models). You can pass multiple comma separated rules.
|
|
855
853
|
*/
|
|
856
|
-
order_by?:
|
|
854
|
+
order_by?: ToItemHrefSchemaOrderBy<D>;
|
|
857
855
|
/**
|
|
858
856
|
* Whether you want the currently published versions (`published`, default) of your records, or the latest available (`current`)
|
|
859
857
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FieldCreateConfig, FieldUpdateConfig, GenericFieldAttributes } from '../fieldTypes/schema';
|
|
2
|
-
import type { ItemTypeDefinition, ToItemAttributes, ToItemAttributesInNestedResponse, ToItemAttributesInRequest } from '../utilities/itemDefinition';
|
|
2
|
+
import type { ItemTypeDefinition, ToItemAttributes, ToItemAttributesInNestedResponse, ToItemAttributesInRequest, ToItemHrefSchemaField, ToItemHrefSchemaOrderBy } from '../utilities/itemDefinition';
|
|
3
3
|
export type Field = FieldStableShell;
|
|
4
4
|
export type FieldAttributes = GenericFieldAttributes<FieldAttributesStableShell>;
|
|
5
5
|
export type FieldCreateSchema = Omit<FieldCreateSchemaStableShell, 'data'> & {
|
|
@@ -624,7 +624,7 @@ export type BuildEventInstancesHrefSchema = {
|
|
|
624
624
|
* This interface was referenced by `Item`'s JSON-Schema
|
|
625
625
|
* via the `instances.hrefSchema` link.
|
|
626
626
|
*/
|
|
627
|
-
export type ItemInstancesHrefSchema = {
|
|
627
|
+
export type ItemInstancesHrefSchema<D extends ItemTypeDefinition = ItemTypeDefinition> = {
|
|
628
628
|
/**
|
|
629
629
|
* For Modular Content, Structured Text and Single Block fields. If set, returns full payload for nested blocks instead of IDs
|
|
630
630
|
*/
|
|
@@ -648,9 +648,7 @@ export type ItemInstancesHrefSchema = {
|
|
|
648
648
|
/**
|
|
649
649
|
* Same as [GraphQL API records filters](/docs/content-delivery-api/filtering-records): you must use square brackets to indicate nesting levels. E.g. if you wanna [filter by parent record](/docs/content-delivery-api/filtering-records#parent) in a tree of records, you must use `filter[fields][parent][eq]=<ID_VALUE>`. Use snake_case for fields names. If `locale` is defined, search within that locale. Otherwise environment's main locale will be used.
|
|
650
650
|
*/
|
|
651
|
-
fields?:
|
|
652
|
-
[k: string]: unknown;
|
|
653
|
-
};
|
|
651
|
+
fields?: ToItemHrefSchemaField<D>;
|
|
654
652
|
/**
|
|
655
653
|
* When set, only valid records are included in the results.
|
|
656
654
|
*/
|
|
@@ -677,7 +675,7 @@ export type ItemInstancesHrefSchema = {
|
|
|
677
675
|
/**
|
|
678
676
|
* Fields used to order results. You **must** specify also `filter[type]` with one element only to be able use this option. Format: `<field_name>_(ASC|DESC)`, where `<field_name>` can be either the API key of a model's field, or one of the following meta columns: `id`, `_updated_at`, `_created_at`, `_status`, `_published_at`, `_first_published_at`, `_publication_scheduled_at`, `_unpublishing_scheduled_at`, `_is_valid`, `position` (only for sortable models). You can pass multiple comma separated rules.
|
|
679
677
|
*/
|
|
680
|
-
order_by?:
|
|
678
|
+
order_by?: ToItemHrefSchemaOrderBy<D>;
|
|
681
679
|
/**
|
|
682
680
|
* Whether you want the currently published versions (`published`, default) of your records, or the latest available (`current`)
|
|
683
681
|
*/
|