@datocms/cma-client 5.2.0-alpha.3 → 5.2.0-alpha.5
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/README.md +4 -0
- package/dist/cjs/generated/Client.js +3 -3
- package/dist/cjs/generated/Client.js.map +1 -1
- package/dist/cjs/generated/resources/ItemType.js +12 -12
- package/dist/cjs/generated/resources/Role.js +8 -8
- package/dist/cjs/generated/resources/Role.js.map +1 -1
- package/dist/cjs/generated/resources/{SiteSearchSource.js → SearchIndex.js} +59 -71
- package/dist/cjs/generated/resources/SearchIndex.js.map +1 -0
- package/dist/cjs/generated/resources/{SiteSearchSourceEvent.js → SearchIndexEvent.js} +19 -19
- package/dist/cjs/generated/resources/SearchIndexEvent.js.map +1 -0
- package/dist/cjs/generated/resources/index.js +5 -5
- package/dist/cjs/generated/resources/index.js.map +1 -1
- package/dist/cjs/utilities/schemaRepository.js +131 -0
- package/dist/cjs/utilities/schemaRepository.js.map +1 -1
- package/dist/esm/generated/ApiTypes.d.ts +273 -270
- package/dist/esm/generated/Client.d.ts +2 -2
- package/dist/esm/generated/Client.js +3 -3
- package/dist/esm/generated/Client.js.map +1 -1
- package/dist/esm/generated/RawApiTypes.d.ts +265 -258
- package/dist/esm/generated/resources/ItemType.d.ts +12 -12
- package/dist/esm/generated/resources/ItemType.js +12 -12
- package/dist/esm/generated/resources/Role.js +8 -8
- package/dist/esm/generated/resources/Role.js.map +1 -1
- package/dist/esm/generated/resources/SearchIndex.d.ts +132 -0
- package/dist/esm/generated/resources/{SiteSearchSource.js → SearchIndex.js} +58 -70
- package/dist/esm/generated/resources/SearchIndex.js.map +1 -0
- package/dist/esm/generated/resources/SearchIndexEvent.d.ts +61 -0
- package/dist/esm/generated/resources/{SiteSearchSourceEvent.js → SearchIndexEvent.js} +18 -18
- package/dist/esm/generated/resources/SearchIndexEvent.js.map +1 -0
- package/dist/esm/generated/resources/index.d.ts +2 -2
- package/dist/esm/generated/resources/index.js +2 -2
- package/dist/esm/generated/resources/index.js.map +1 -1
- package/dist/esm/utilities/schemaRepository.d.ts +42 -2
- package/dist/esm/utilities/schemaRepository.js +132 -1
- package/dist/esm/utilities/schemaRepository.js.map +1 -1
- package/dist/types/generated/ApiTypes.d.ts +273 -270
- package/dist/types/generated/Client.d.ts +2 -2
- package/dist/types/generated/RawApiTypes.d.ts +265 -258
- package/dist/types/generated/resources/ItemType.d.ts +12 -12
- package/dist/types/generated/resources/SearchIndex.d.ts +132 -0
- package/dist/types/generated/resources/SearchIndexEvent.d.ts +61 -0
- package/dist/types/generated/resources/index.d.ts +2 -2
- package/dist/types/utilities/schemaRepository.d.ts +42 -2
- package/package.json +3 -3
- package/resources.json +83 -85
- package/src/generated/ApiTypes.ts +274 -272
- package/src/generated/Client.ts +5 -5
- package/src/generated/RawApiTypes.ts +266 -259
- package/src/generated/resources/ItemType.ts +12 -12
- package/src/generated/resources/Role.ts +8 -8
- package/src/generated/resources/SearchIndex.ts +243 -0
- package/src/generated/resources/{SiteSearchSourceEvent.ts → SearchIndexEvent.ts} +32 -34
- package/src/generated/resources/index.ts +2 -2
- package/src/utilities/schemaRepository.ts +167 -9
- package/dist/cjs/generated/resources/SiteSearchSource.js.map +0 -1
- package/dist/cjs/generated/resources/SiteSearchSourceEvent.js.map +0 -1
- package/dist/esm/generated/resources/SiteSearchSource.d.ts +0 -132
- package/dist/esm/generated/resources/SiteSearchSource.js.map +0 -1
- package/dist/esm/generated/resources/SiteSearchSourceEvent.d.ts +0 -61
- package/dist/esm/generated/resources/SiteSearchSourceEvent.js.map +0 -1
- package/dist/types/generated/resources/SiteSearchSource.d.ts +0 -132
- package/dist/types/generated/resources/SiteSearchSourceEvent.d.ts +0 -61
- package/src/generated/resources/SiteSearchSource.ts +0 -267
|
@@ -7,7 +7,7 @@ export default class ItemType extends BaseResource {
|
|
|
7
7
|
static readonly TYPE = 'item_type' as const;
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* Create a new model
|
|
10
|
+
* Create a new model/block model
|
|
11
11
|
*
|
|
12
12
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/create
|
|
13
13
|
*
|
|
@@ -55,7 +55,7 @@ export default class ItemType extends BaseResource {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
|
-
* Create a new model
|
|
58
|
+
* Create a new model/block model
|
|
59
59
|
*
|
|
60
60
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/create
|
|
61
61
|
*
|
|
@@ -75,7 +75,7 @@ export default class ItemType extends BaseResource {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
|
-
* Update a model
|
|
78
|
+
* Update a model/block model
|
|
79
79
|
*
|
|
80
80
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/update
|
|
81
81
|
*
|
|
@@ -125,7 +125,7 @@ export default class ItemType extends BaseResource {
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
/**
|
|
128
|
-
* Update a model
|
|
128
|
+
* Update a model/block model
|
|
129
129
|
*
|
|
130
130
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/update
|
|
131
131
|
*
|
|
@@ -144,7 +144,7 @@ export default class ItemType extends BaseResource {
|
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
/**
|
|
147
|
-
* List all models
|
|
147
|
+
* List all models/block models
|
|
148
148
|
*
|
|
149
149
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/instances
|
|
150
150
|
*
|
|
@@ -160,7 +160,7 @@ export default class ItemType extends BaseResource {
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
/**
|
|
163
|
-
* List all models
|
|
163
|
+
* List all models/block models
|
|
164
164
|
*
|
|
165
165
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/instances
|
|
166
166
|
*
|
|
@@ -175,7 +175,7 @@ export default class ItemType extends BaseResource {
|
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
/**
|
|
178
|
-
* Retrieve a model
|
|
178
|
+
* Retrieve a model/block model
|
|
179
179
|
*
|
|
180
180
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/self
|
|
181
181
|
*
|
|
@@ -189,7 +189,7 @@ export default class ItemType extends BaseResource {
|
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
/**
|
|
192
|
-
* Retrieve a model
|
|
192
|
+
* Retrieve a model/block model
|
|
193
193
|
*
|
|
194
194
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/self
|
|
195
195
|
*
|
|
@@ -204,7 +204,7 @@ export default class ItemType extends BaseResource {
|
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
/**
|
|
207
|
-
* Duplicate model
|
|
207
|
+
* Duplicate model/block model
|
|
208
208
|
*
|
|
209
209
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/duplicate
|
|
210
210
|
*
|
|
@@ -220,7 +220,7 @@ export default class ItemType extends BaseResource {
|
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
/**
|
|
223
|
-
* Duplicate model
|
|
223
|
+
* Duplicate model/block model
|
|
224
224
|
*
|
|
225
225
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/duplicate
|
|
226
226
|
*
|
|
@@ -237,7 +237,7 @@ export default class ItemType extends BaseResource {
|
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
/**
|
|
240
|
-
* Delete a model
|
|
240
|
+
* Delete a model/block model
|
|
241
241
|
*
|
|
242
242
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/destroy
|
|
243
243
|
*
|
|
@@ -254,7 +254,7 @@ export default class ItemType extends BaseResource {
|
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
/**
|
|
257
|
-
* Delete a model
|
|
257
|
+
* Delete a model/block model
|
|
258
258
|
*
|
|
259
259
|
* Read more: https://www.datocms.com/docs/content-management-api/resources/item-type/destroy
|
|
260
260
|
*
|
|
@@ -29,7 +29,7 @@ export default class Role extends BaseResource {
|
|
|
29
29
|
'environments_access',
|
|
30
30
|
'can_manage_users',
|
|
31
31
|
'can_manage_shared_filters',
|
|
32
|
-
'
|
|
32
|
+
'can_manage_search_indexes',
|
|
33
33
|
'can_manage_upload_collections',
|
|
34
34
|
'can_manage_build_triggers',
|
|
35
35
|
'can_manage_webhooks',
|
|
@@ -40,15 +40,15 @@ export default class Role extends BaseResource {
|
|
|
40
40
|
'can_manage_access_tokens',
|
|
41
41
|
'can_perform_site_search',
|
|
42
42
|
'can_access_build_events_log',
|
|
43
|
-
'
|
|
43
|
+
'can_access_search_index_events_log',
|
|
44
44
|
'positive_item_type_permissions',
|
|
45
45
|
'negative_item_type_permissions',
|
|
46
46
|
'positive_upload_permissions',
|
|
47
47
|
'negative_upload_permissions',
|
|
48
48
|
'positive_build_trigger_permissions',
|
|
49
49
|
'negative_build_trigger_permissions',
|
|
50
|
-
'
|
|
51
|
-
'
|
|
50
|
+
'positive_search_index_permissions',
|
|
51
|
+
'negative_search_index_permissions',
|
|
52
52
|
],
|
|
53
53
|
relationships: ['inherits_permissions_from'],
|
|
54
54
|
}),
|
|
@@ -100,7 +100,7 @@ export default class Role extends BaseResource {
|
|
|
100
100
|
'environments_access',
|
|
101
101
|
'can_manage_users',
|
|
102
102
|
'can_manage_shared_filters',
|
|
103
|
-
'
|
|
103
|
+
'can_manage_search_indexes',
|
|
104
104
|
'can_manage_upload_collections',
|
|
105
105
|
'can_manage_build_triggers',
|
|
106
106
|
'can_manage_webhooks',
|
|
@@ -111,15 +111,15 @@ export default class Role extends BaseResource {
|
|
|
111
111
|
'can_manage_access_tokens',
|
|
112
112
|
'can_perform_site_search',
|
|
113
113
|
'can_access_build_events_log',
|
|
114
|
-
'
|
|
114
|
+
'can_access_search_index_events_log',
|
|
115
115
|
'positive_item_type_permissions',
|
|
116
116
|
'negative_item_type_permissions',
|
|
117
117
|
'positive_upload_permissions',
|
|
118
118
|
'negative_upload_permissions',
|
|
119
119
|
'positive_build_trigger_permissions',
|
|
120
120
|
'negative_build_trigger_permissions',
|
|
121
|
-
'
|
|
122
|
-
'
|
|
121
|
+
'positive_search_index_permissions',
|
|
122
|
+
'negative_search_index_permissions',
|
|
123
123
|
],
|
|
124
124
|
relationships: ['inherits_permissions_from'],
|
|
125
125
|
}),
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import * as Utils from '@datocms/rest-client-utils';
|
|
2
|
+
import BaseResource from '../../BaseResource';
|
|
3
|
+
import type * as ApiTypes from '../ApiTypes';
|
|
4
|
+
import type * as RawApiTypes from '../RawApiTypes';
|
|
5
|
+
|
|
6
|
+
export default class SearchIndex extends BaseResource {
|
|
7
|
+
static readonly TYPE = 'search_index' as const;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* List all search indexes for a site
|
|
11
|
+
*
|
|
12
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/instances
|
|
13
|
+
*
|
|
14
|
+
* @throws {ApiError}
|
|
15
|
+
* @throws {TimeoutError}
|
|
16
|
+
*/
|
|
17
|
+
list() {
|
|
18
|
+
return this.rawList().then((body) =>
|
|
19
|
+
Utils.deserializeResponseBody<ApiTypes.SearchIndexInstancesTargetSchema>(
|
|
20
|
+
body,
|
|
21
|
+
),
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* List all search indexes for a site
|
|
27
|
+
*
|
|
28
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/instances
|
|
29
|
+
*
|
|
30
|
+
* @throws {ApiError}
|
|
31
|
+
* @throws {TimeoutError}
|
|
32
|
+
*/
|
|
33
|
+
rawList(): Promise<RawApiTypes.SearchIndexInstancesTargetSchema> {
|
|
34
|
+
return this.client.request<RawApiTypes.SearchIndexInstancesTargetSchema>({
|
|
35
|
+
method: 'GET',
|
|
36
|
+
url: '/search-indexes',
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Retrieve a search index
|
|
42
|
+
*
|
|
43
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/self
|
|
44
|
+
*
|
|
45
|
+
* @throws {ApiError}
|
|
46
|
+
* @throws {TimeoutError}
|
|
47
|
+
*/
|
|
48
|
+
find(searchIndexId: string | ApiTypes.SearchIndexData) {
|
|
49
|
+
return this.rawFind(Utils.toId(searchIndexId)).then((body) =>
|
|
50
|
+
Utils.deserializeResponseBody<ApiTypes.SearchIndexSelfTargetSchema>(body),
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Retrieve a search index
|
|
56
|
+
*
|
|
57
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/self
|
|
58
|
+
*
|
|
59
|
+
* @throws {ApiError}
|
|
60
|
+
* @throws {TimeoutError}
|
|
61
|
+
*/
|
|
62
|
+
rawFind(
|
|
63
|
+
searchIndexId: string,
|
|
64
|
+
): Promise<RawApiTypes.SearchIndexSelfTargetSchema> {
|
|
65
|
+
return this.client.request<RawApiTypes.SearchIndexSelfTargetSchema>({
|
|
66
|
+
method: 'GET',
|
|
67
|
+
url: `/search-indexes/${searchIndexId}`,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Create a search index
|
|
73
|
+
*
|
|
74
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/create
|
|
75
|
+
*
|
|
76
|
+
* @throws {ApiError}
|
|
77
|
+
* @throws {TimeoutError}
|
|
78
|
+
*/
|
|
79
|
+
create(body: ApiTypes.SearchIndexCreateSchema) {
|
|
80
|
+
return this.rawCreate(
|
|
81
|
+
Utils.serializeRequestBody<RawApiTypes.SearchIndexCreateSchema>(body, {
|
|
82
|
+
type: 'search_index',
|
|
83
|
+
attributes: ['name', 'enabled', 'frontend_url', 'user_agent_suffix'],
|
|
84
|
+
relationships: ['build_triggers'],
|
|
85
|
+
}),
|
|
86
|
+
).then((body) =>
|
|
87
|
+
Utils.deserializeResponseBody<ApiTypes.SearchIndexCreateTargetSchema>(
|
|
88
|
+
body,
|
|
89
|
+
),
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Create a search index
|
|
95
|
+
*
|
|
96
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/create
|
|
97
|
+
*
|
|
98
|
+
* @throws {ApiError}
|
|
99
|
+
* @throws {TimeoutError}
|
|
100
|
+
*/
|
|
101
|
+
rawCreate(
|
|
102
|
+
body: RawApiTypes.SearchIndexCreateSchema,
|
|
103
|
+
): Promise<RawApiTypes.SearchIndexCreateTargetSchema> {
|
|
104
|
+
return this.client.request<RawApiTypes.SearchIndexCreateTargetSchema>({
|
|
105
|
+
method: 'POST',
|
|
106
|
+
url: '/search-indexes',
|
|
107
|
+
body,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Update a search index
|
|
113
|
+
*
|
|
114
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/update
|
|
115
|
+
*
|
|
116
|
+
* @throws {ApiError}
|
|
117
|
+
* @throws {TimeoutError}
|
|
118
|
+
*/
|
|
119
|
+
update(
|
|
120
|
+
searchIndexId: string | ApiTypes.SearchIndexData,
|
|
121
|
+
body: ApiTypes.SearchIndexUpdateSchema,
|
|
122
|
+
) {
|
|
123
|
+
return this.rawUpdate(
|
|
124
|
+
Utils.toId(searchIndexId),
|
|
125
|
+
Utils.serializeRequestBody<RawApiTypes.SearchIndexUpdateSchema>(body, {
|
|
126
|
+
id: Utils.toId(searchIndexId),
|
|
127
|
+
type: 'search_index',
|
|
128
|
+
attributes: ['name', 'enabled', 'frontend_url', 'user_agent_suffix'],
|
|
129
|
+
relationships: ['build_triggers'],
|
|
130
|
+
}),
|
|
131
|
+
).then((body) =>
|
|
132
|
+
Utils.deserializeResponseBody<ApiTypes.SearchIndexUpdateTargetSchema>(
|
|
133
|
+
body,
|
|
134
|
+
),
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Update a search index
|
|
140
|
+
*
|
|
141
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/update
|
|
142
|
+
*
|
|
143
|
+
* @throws {ApiError}
|
|
144
|
+
* @throws {TimeoutError}
|
|
145
|
+
*/
|
|
146
|
+
rawUpdate(
|
|
147
|
+
searchIndexId: string,
|
|
148
|
+
body: RawApiTypes.SearchIndexUpdateSchema,
|
|
149
|
+
): Promise<RawApiTypes.SearchIndexUpdateTargetSchema> {
|
|
150
|
+
return this.client.request<RawApiTypes.SearchIndexUpdateTargetSchema>({
|
|
151
|
+
method: 'PUT',
|
|
152
|
+
url: `/search-indexes/${searchIndexId}`,
|
|
153
|
+
body,
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Trigger the indexing process
|
|
159
|
+
*
|
|
160
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/trigger
|
|
161
|
+
*
|
|
162
|
+
* @throws {ApiError}
|
|
163
|
+
* @throws {TimeoutError}
|
|
164
|
+
*/
|
|
165
|
+
trigger(searchIndexId: string | ApiTypes.SearchIndexData) {
|
|
166
|
+
return this.rawTrigger(Utils.toId(searchIndexId));
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Trigger the indexing process
|
|
171
|
+
*
|
|
172
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/trigger
|
|
173
|
+
*
|
|
174
|
+
* @throws {ApiError}
|
|
175
|
+
* @throws {TimeoutError}
|
|
176
|
+
*/
|
|
177
|
+
rawTrigger(searchIndexId: string): Promise<void> {
|
|
178
|
+
return this.client.request<void>({
|
|
179
|
+
method: 'POST',
|
|
180
|
+
url: `/search-indexes/${searchIndexId}/trigger`,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Abort a the current indexing process and mark it as failed
|
|
186
|
+
*
|
|
187
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/abort
|
|
188
|
+
*
|
|
189
|
+
* @throws {ApiError}
|
|
190
|
+
* @throws {TimeoutError}
|
|
191
|
+
*/
|
|
192
|
+
abort(searchIndexId: string | ApiTypes.SearchIndexData) {
|
|
193
|
+
return this.rawAbort(Utils.toId(searchIndexId));
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Abort a the current indexing process and mark it as failed
|
|
198
|
+
*
|
|
199
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/abort
|
|
200
|
+
*
|
|
201
|
+
* @throws {ApiError}
|
|
202
|
+
* @throws {TimeoutError}
|
|
203
|
+
*/
|
|
204
|
+
rawAbort(searchIndexId: string): Promise<void> {
|
|
205
|
+
return this.client.request<void>({
|
|
206
|
+
method: 'DELETE',
|
|
207
|
+
url: `/search-indexes/${searchIndexId}/abort`,
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Delete a search index
|
|
213
|
+
*
|
|
214
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/destroy
|
|
215
|
+
*
|
|
216
|
+
* @throws {ApiError}
|
|
217
|
+
* @throws {TimeoutError}
|
|
218
|
+
*/
|
|
219
|
+
destroy(searchIndexId: string | ApiTypes.SearchIndexData) {
|
|
220
|
+
return this.rawDestroy(Utils.toId(searchIndexId)).then((body) =>
|
|
221
|
+
Utils.deserializeResponseBody<ApiTypes.SearchIndexDestroyTargetSchema>(
|
|
222
|
+
body,
|
|
223
|
+
),
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Delete a search index
|
|
229
|
+
*
|
|
230
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/search-index/destroy
|
|
231
|
+
*
|
|
232
|
+
* @throws {ApiError}
|
|
233
|
+
* @throws {TimeoutError}
|
|
234
|
+
*/
|
|
235
|
+
rawDestroy(
|
|
236
|
+
searchIndexId: string,
|
|
237
|
+
): Promise<RawApiTypes.SearchIndexDestroyTargetSchema> {
|
|
238
|
+
return this.client.request<RawApiTypes.SearchIndexDestroyTargetSchema>({
|
|
239
|
+
method: 'DELETE',
|
|
240
|
+
url: `/search-indexes/${searchIndexId}`,
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}
|
|
@@ -3,40 +3,40 @@ import BaseResource from '../../BaseResource';
|
|
|
3
3
|
import type * as ApiTypes from '../ApiTypes';
|
|
4
4
|
import type * as RawApiTypes from '../RawApiTypes';
|
|
5
5
|
|
|
6
|
-
export default class
|
|
7
|
-
static readonly TYPE = '
|
|
6
|
+
export default class SearchIndexEvent extends BaseResource {
|
|
7
|
+
static readonly TYPE = 'search_index_event' as const;
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* List all
|
|
10
|
+
* List all search indexing events
|
|
11
11
|
*
|
|
12
|
-
* Read more: https://www.datocms.com/docs/content-management-api/resources/
|
|
12
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/search-index_event/instances
|
|
13
13
|
*
|
|
14
14
|
* @throws {ApiError}
|
|
15
15
|
* @throws {TimeoutError}
|
|
16
16
|
*/
|
|
17
|
-
list(queryParams?: ApiTypes.
|
|
17
|
+
list(queryParams?: ApiTypes.SearchIndexEventInstancesHrefSchema) {
|
|
18
18
|
return this.rawList(queryParams).then((body) =>
|
|
19
|
-
Utils.deserializeResponseBody<ApiTypes.
|
|
19
|
+
Utils.deserializeResponseBody<ApiTypes.SearchIndexEventInstancesTargetSchema>(
|
|
20
20
|
body,
|
|
21
21
|
),
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* List all
|
|
26
|
+
* List all search indexing events
|
|
27
27
|
*
|
|
28
|
-
* Read more: https://www.datocms.com/docs/content-management-api/resources/
|
|
28
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/search-index_event/instances
|
|
29
29
|
*
|
|
30
30
|
* @throws {ApiError}
|
|
31
31
|
* @throws {TimeoutError}
|
|
32
32
|
*/
|
|
33
33
|
rawList(
|
|
34
|
-
queryParams?: RawApiTypes.
|
|
35
|
-
): Promise<RawApiTypes.
|
|
36
|
-
return this.client.request<RawApiTypes.
|
|
34
|
+
queryParams?: RawApiTypes.SearchIndexEventInstancesHrefSchema,
|
|
35
|
+
): Promise<RawApiTypes.SearchIndexEventInstancesTargetSchema> {
|
|
36
|
+
return this.client.request<RawApiTypes.SearchIndexEventInstancesTargetSchema>(
|
|
37
37
|
{
|
|
38
38
|
method: 'GET',
|
|
39
|
-
url: '/
|
|
39
|
+
url: '/search-index-events',
|
|
40
40
|
queryParams,
|
|
41
41
|
},
|
|
42
42
|
);
|
|
@@ -45,14 +45,14 @@ export default class SiteSearchSourceEvent extends BaseResource {
|
|
|
45
45
|
/**
|
|
46
46
|
* Async iterator to auto-paginate over elements returned by list()
|
|
47
47
|
*
|
|
48
|
-
* Read more: https://www.datocms.com/docs/content-management-api/resources/
|
|
48
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/search-index_event/instances
|
|
49
49
|
*
|
|
50
50
|
* @throws {ApiError}
|
|
51
51
|
* @throws {TimeoutError}
|
|
52
52
|
*/
|
|
53
53
|
async *listPagedIterator(
|
|
54
54
|
queryParams?: Utils.OmitFromKnownKeys<
|
|
55
|
-
ApiTypes.
|
|
55
|
+
ApiTypes.SearchIndexEventInstancesHrefSchema,
|
|
56
56
|
'page'
|
|
57
57
|
>,
|
|
58
58
|
iteratorOptions?: Utils.IteratorOptions,
|
|
@@ -62,7 +62,7 @@ export default class SiteSearchSourceEvent extends BaseResource {
|
|
|
62
62
|
iteratorOptions,
|
|
63
63
|
)) {
|
|
64
64
|
yield Utils.deserializeJsonEntity<
|
|
65
|
-
ApiTypes.
|
|
65
|
+
ApiTypes.SearchIndexEventInstancesTargetSchema[0]
|
|
66
66
|
>(element);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -70,14 +70,14 @@ export default class SiteSearchSourceEvent extends BaseResource {
|
|
|
70
70
|
/**
|
|
71
71
|
* Async iterator to auto-paginate over elements returned by rawList()
|
|
72
72
|
*
|
|
73
|
-
* Read more: https://www.datocms.com/docs/content-management-api/resources/
|
|
73
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/search-index_event/instances
|
|
74
74
|
*
|
|
75
75
|
* @throws {ApiError}
|
|
76
76
|
* @throws {TimeoutError}
|
|
77
77
|
*/
|
|
78
78
|
rawListPagedIterator(
|
|
79
79
|
queryParams?: Utils.OmitFromKnownKeys<
|
|
80
|
-
RawApiTypes.
|
|
80
|
+
RawApiTypes.SearchIndexEventInstancesHrefSchema,
|
|
81
81
|
'page'
|
|
82
82
|
>,
|
|
83
83
|
iteratorOptions?: Utils.IteratorOptions,
|
|
@@ -85,50 +85,48 @@ export default class SiteSearchSourceEvent extends BaseResource {
|
|
|
85
85
|
Utils.warnOnPageQueryParam(queryParams);
|
|
86
86
|
|
|
87
87
|
return Utils.rawPageIterator<
|
|
88
|
-
RawApiTypes.
|
|
88
|
+
RawApiTypes.SearchIndexEventInstancesTargetSchema['data'][0]
|
|
89
89
|
>(
|
|
90
90
|
{
|
|
91
91
|
defaultLimit: 30,
|
|
92
92
|
maxLimit: 500,
|
|
93
93
|
},
|
|
94
|
-
(page: RawApiTypes.
|
|
94
|
+
(page: RawApiTypes.SearchIndexEventInstancesHrefSchema['page']) =>
|
|
95
95
|
this.rawList({ ...queryParams, page }),
|
|
96
96
|
iteratorOptions,
|
|
97
97
|
);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
|
-
* Retrieve a
|
|
101
|
+
* Retrieve a search indexing event
|
|
102
102
|
*
|
|
103
|
-
* Read more: https://www.datocms.com/docs/content-management-api/resources/
|
|
103
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/search-index_event/self
|
|
104
104
|
*
|
|
105
105
|
* @throws {ApiError}
|
|
106
106
|
* @throws {TimeoutError}
|
|
107
107
|
*/
|
|
108
|
-
find(
|
|
109
|
-
return this.rawFind(Utils.toId(
|
|
110
|
-
Utils.deserializeResponseBody<ApiTypes.
|
|
108
|
+
find(searchIndexEventId: string | ApiTypes.SearchIndexEventData) {
|
|
109
|
+
return this.rawFind(Utils.toId(searchIndexEventId)).then((body) =>
|
|
110
|
+
Utils.deserializeResponseBody<ApiTypes.SearchIndexEventSelfTargetSchema>(
|
|
111
111
|
body,
|
|
112
112
|
),
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
/**
|
|
117
|
-
* Retrieve a
|
|
117
|
+
* Retrieve a search indexing event
|
|
118
118
|
*
|
|
119
|
-
* Read more: https://www.datocms.com/docs/content-management-api/resources/
|
|
119
|
+
* Read more: https://www.datocms.com/docs/content-management-api/resources/search-index_event/self
|
|
120
120
|
*
|
|
121
121
|
* @throws {ApiError}
|
|
122
122
|
* @throws {TimeoutError}
|
|
123
123
|
*/
|
|
124
124
|
rawFind(
|
|
125
|
-
|
|
126
|
-
): Promise<RawApiTypes.
|
|
127
|
-
return this.client.request<RawApiTypes.
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
},
|
|
132
|
-
);
|
|
125
|
+
searchIndexEventId: string,
|
|
126
|
+
): Promise<RawApiTypes.SearchIndexEventSelfTargetSchema> {
|
|
127
|
+
return this.client.request<RawApiTypes.SearchIndexEventSelfTargetSchema>({
|
|
128
|
+
method: 'GET',
|
|
129
|
+
url: `/search-index-events/${searchIndexEventId}`,
|
|
130
|
+
});
|
|
133
131
|
}
|
|
134
132
|
}
|
|
@@ -15,7 +15,7 @@ export { default as JobResult } from './JobResult';
|
|
|
15
15
|
export { default as SubscriptionLimit } from './SubscriptionLimit';
|
|
16
16
|
export { default as SubscriptionFeature } from './SubscriptionFeature';
|
|
17
17
|
export { default as BuildEvent } from './BuildEvent';
|
|
18
|
-
export { default as
|
|
18
|
+
export { default as SearchIndexEvent } from './SearchIndexEvent';
|
|
19
19
|
export { default as Item } from './Item';
|
|
20
20
|
export { default as ItemVersion } from './ItemVersion';
|
|
21
21
|
export { default as Upload } from './Upload';
|
|
@@ -29,7 +29,7 @@ export { default as MaintenanceMode } from './MaintenanceMode';
|
|
|
29
29
|
export { default as Webhook } from './Webhook';
|
|
30
30
|
export { default as WebhookCall } from './WebhookCall';
|
|
31
31
|
export { default as BuildTrigger } from './BuildTrigger';
|
|
32
|
-
export { default as
|
|
32
|
+
export { default as SearchIndex } from './SearchIndex';
|
|
33
33
|
export { default as ItemTypeFilter } from './ItemTypeFilter';
|
|
34
34
|
export { default as UploadFilter } from './UploadFilter';
|
|
35
35
|
export { default as SiteInvitation } from './SiteInvitation';
|