@datocms/cma-client 5.2.0-alpha.2 → 5.2.0-alpha.4

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.
Files changed (48) hide show
  1. package/dist/cjs/generated/Client.js +3 -3
  2. package/dist/cjs/generated/Client.js.map +1 -1
  3. package/dist/cjs/generated/resources/Role.js +8 -8
  4. package/dist/cjs/generated/resources/Role.js.map +1 -1
  5. package/dist/cjs/generated/resources/{SiteSearchSource.js → SearchIndex.js} +55 -53
  6. package/dist/cjs/generated/resources/SearchIndex.js.map +1 -0
  7. package/dist/cjs/generated/resources/{SiteSearchSourceEvent.js → SearchIndexEvent.js} +19 -19
  8. package/dist/cjs/generated/resources/SearchIndexEvent.js.map +1 -0
  9. package/dist/cjs/generated/resources/index.js +5 -5
  10. package/dist/cjs/generated/resources/index.js.map +1 -1
  11. package/dist/esm/generated/ApiTypes.d.ts +147 -131
  12. package/dist/esm/generated/Client.d.ts +2 -2
  13. package/dist/esm/generated/Client.js +3 -3
  14. package/dist/esm/generated/Client.js.map +1 -1
  15. package/dist/esm/generated/RawApiTypes.d.ts +148 -136
  16. package/dist/esm/generated/resources/Role.js +8 -8
  17. package/dist/esm/generated/resources/Role.js.map +1 -1
  18. package/dist/esm/generated/resources/{SiteSearchSource.d.ts → SearchIndex.d.ts} +40 -40
  19. package/dist/esm/generated/resources/{SiteSearchSource.js → SearchIndex.js} +54 -52
  20. package/dist/esm/generated/resources/SearchIndex.js.map +1 -0
  21. package/dist/esm/generated/resources/SearchIndexEvent.d.ts +61 -0
  22. package/dist/esm/generated/resources/{SiteSearchSourceEvent.js → SearchIndexEvent.js} +18 -18
  23. package/dist/esm/generated/resources/SearchIndexEvent.js.map +1 -0
  24. package/dist/esm/generated/resources/index.d.ts +2 -2
  25. package/dist/esm/generated/resources/index.js +2 -2
  26. package/dist/esm/generated/resources/index.js.map +1 -1
  27. package/dist/types/generated/ApiTypes.d.ts +147 -131
  28. package/dist/types/generated/Client.d.ts +2 -2
  29. package/dist/types/generated/RawApiTypes.d.ts +148 -136
  30. package/dist/types/generated/resources/{SiteSearchSource.d.ts → SearchIndex.d.ts} +40 -40
  31. package/dist/types/generated/resources/SearchIndexEvent.d.ts +61 -0
  32. package/dist/types/generated/resources/index.d.ts +2 -2
  33. package/package.json +3 -3
  34. package/resources.json +79 -77
  35. package/src/generated/ApiTypes.ts +148 -133
  36. package/src/generated/Client.ts +5 -5
  37. package/src/generated/RawApiTypes.ts +149 -137
  38. package/src/generated/resources/Role.ts +8 -8
  39. package/src/generated/resources/SearchIndex.ts +255 -0
  40. package/src/generated/resources/{SiteSearchSourceEvent.ts → SearchIndexEvent.ts} +32 -34
  41. package/src/generated/resources/index.ts +2 -2
  42. package/dist/cjs/generated/resources/SiteSearchSource.js.map +0 -1
  43. package/dist/cjs/generated/resources/SiteSearchSourceEvent.js.map +0 -1
  44. package/dist/esm/generated/resources/SiteSearchSource.js.map +0 -1
  45. package/dist/esm/generated/resources/SiteSearchSourceEvent.d.ts +0 -61
  46. package/dist/esm/generated/resources/SiteSearchSourceEvent.js.map +0 -1
  47. package/dist/types/generated/resources/SiteSearchSourceEvent.d.ts +0 -61
  48. package/src/generated/resources/SiteSearchSource.ts +0 -265
@@ -1,265 +0,0 @@
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 SiteSearchSource extends BaseResource {
7
- static readonly TYPE = 'site_search_source' as const;
8
-
9
- /**
10
- * List all site search sources for a site
11
- *
12
- * Read more: https://www.datocms.com/docs/content-management-api/resources/site-search_source/instances
13
- *
14
- * @throws {ApiError}
15
- * @throws {TimeoutError}
16
- */
17
- list() {
18
- return this.rawList().then((body) =>
19
- Utils.deserializeResponseBody<ApiTypes.SiteSearchSourceInstancesTargetSchema>(
20
- body,
21
- ),
22
- );
23
- }
24
-
25
- /**
26
- * List all site search sources for a site
27
- *
28
- * Read more: https://www.datocms.com/docs/content-management-api/resources/site-search_source/instances
29
- *
30
- * @throws {ApiError}
31
- * @throws {TimeoutError}
32
- */
33
- rawList(): Promise<RawApiTypes.SiteSearchSourceInstancesTargetSchema> {
34
- return this.client.request<RawApiTypes.SiteSearchSourceInstancesTargetSchema>(
35
- {
36
- method: 'GET',
37
- url: '/site-search-sources',
38
- },
39
- );
40
- }
41
-
42
- /**
43
- * Retrieve a site search source
44
- *
45
- * Read more: https://www.datocms.com/docs/content-management-api/resources/site-search_source/self
46
- *
47
- * @throws {ApiError}
48
- * @throws {TimeoutError}
49
- */
50
- find(siteSearchSourceId: string | ApiTypes.SiteSearchSourceData) {
51
- return this.rawFind(Utils.toId(siteSearchSourceId)).then((body) =>
52
- Utils.deserializeResponseBody<ApiTypes.SiteSearchSourceSelfTargetSchema>(
53
- body,
54
- ),
55
- );
56
- }
57
-
58
- /**
59
- * Retrieve a site search source
60
- *
61
- * Read more: https://www.datocms.com/docs/content-management-api/resources/site-search_source/self
62
- *
63
- * @throws {ApiError}
64
- * @throws {TimeoutError}
65
- */
66
- rawFind(
67
- siteSearchSourceId: string,
68
- ): Promise<RawApiTypes.SiteSearchSourceSelfTargetSchema> {
69
- return this.client.request<RawApiTypes.SiteSearchSourceSelfTargetSchema>({
70
- method: 'GET',
71
- url: `/site-search-sources/${siteSearchSourceId}`,
72
- });
73
- }
74
-
75
- /**
76
- * Create site search source
77
- *
78
- * Read more: https://www.datocms.com/docs/content-management-api/resources/site-search_source/create
79
- *
80
- * @throws {ApiError}
81
- * @throws {TimeoutError}
82
- */
83
- create(body: ApiTypes.SiteSearchSourceCreateSchema) {
84
- return this.rawCreate(
85
- Utils.serializeRequestBody<RawApiTypes.SiteSearchSourceCreateSchema>(
86
- body,
87
- {
88
- type: 'site_search_source',
89
- attributes: [
90
- 'name',
91
- 'enabled',
92
- 'build_trigger_indexing_enabled',
93
- 'frontend_url',
94
- ],
95
- relationships: ['build_triggers'],
96
- },
97
- ),
98
- ).then((body) =>
99
- Utils.deserializeResponseBody<ApiTypes.SiteSearchSourceCreateTargetSchema>(
100
- body,
101
- ),
102
- );
103
- }
104
-
105
- /**
106
- * Create site search source
107
- *
108
- * Read more: https://www.datocms.com/docs/content-management-api/resources/site-search_source/create
109
- *
110
- * @throws {ApiError}
111
- * @throws {TimeoutError}
112
- */
113
- rawCreate(
114
- body: RawApiTypes.SiteSearchSourceCreateSchema,
115
- ): Promise<RawApiTypes.SiteSearchSourceCreateTargetSchema> {
116
- return this.client.request<RawApiTypes.SiteSearchSourceCreateTargetSchema>({
117
- method: 'POST',
118
- url: '/site-search-sources',
119
- body,
120
- });
121
- }
122
-
123
- /**
124
- * Update site search source
125
- *
126
- * Read more: https://www.datocms.com/docs/content-management-api/resources/site-search_source/update
127
- *
128
- * @throws {ApiError}
129
- * @throws {TimeoutError}
130
- */
131
- update(
132
- siteSearchSourceId: string | ApiTypes.SiteSearchSourceData,
133
- body: ApiTypes.SiteSearchSourceUpdateSchema,
134
- ) {
135
- return this.rawUpdate(
136
- Utils.toId(siteSearchSourceId),
137
- Utils.serializeRequestBody<RawApiTypes.SiteSearchSourceUpdateSchema>(
138
- body,
139
- {
140
- id: Utils.toId(siteSearchSourceId),
141
- type: 'site_search_source',
142
- attributes: [
143
- 'name',
144
- 'enabled',
145
- 'build_trigger_indexing_enabled',
146
- 'frontend_url',
147
- ],
148
- relationships: ['build_triggers'],
149
- },
150
- ),
151
- ).then((body) =>
152
- Utils.deserializeResponseBody<ApiTypes.SiteSearchSourceUpdateTargetSchema>(
153
- body,
154
- ),
155
- );
156
- }
157
-
158
- /**
159
- * Update site search source
160
- *
161
- * Read more: https://www.datocms.com/docs/content-management-api/resources/site-search_source/update
162
- *
163
- * @throws {ApiError}
164
- * @throws {TimeoutError}
165
- */
166
- rawUpdate(
167
- siteSearchSourceId: string,
168
- body: RawApiTypes.SiteSearchSourceUpdateSchema,
169
- ): Promise<RawApiTypes.SiteSearchSourceUpdateTargetSchema> {
170
- return this.client.request<RawApiTypes.SiteSearchSourceUpdateTargetSchema>({
171
- method: 'PUT',
172
- url: `/site-search-sources/${siteSearchSourceId}`,
173
- body,
174
- });
175
- }
176
-
177
- /**
178
- * Trigger a site search indexing
179
- *
180
- * Read more: https://www.datocms.com/docs/content-management-api/resources/site-search_source/trigger
181
- *
182
- * @throws {ApiError}
183
- * @throws {TimeoutError}
184
- */
185
- trigger(siteSearchSourceId: string | ApiTypes.SiteSearchSourceData) {
186
- return this.rawTrigger(Utils.toId(siteSearchSourceId));
187
- }
188
-
189
- /**
190
- * Trigger a site search indexing
191
- *
192
- * Read more: https://www.datocms.com/docs/content-management-api/resources/site-search_source/trigger
193
- *
194
- * @throws {ApiError}
195
- * @throws {TimeoutError}
196
- */
197
- rawTrigger(siteSearchSourceId: string): Promise<void> {
198
- return this.client.request<void>({
199
- method: 'POST',
200
- url: `/site-search-sources/${siteSearchSourceId}/trigger`,
201
- });
202
- }
203
-
204
- /**
205
- * Abort a site search spidering and mark it as failed
206
- *
207
- * Read more: https://www.datocms.com/docs/content-management-api/resources/site-search_source/abort
208
- *
209
- * @throws {ApiError}
210
- * @throws {TimeoutError}
211
- */
212
- abort(siteSearchSourceId: string | ApiTypes.SiteSearchSourceData) {
213
- return this.rawAbort(Utils.toId(siteSearchSourceId));
214
- }
215
-
216
- /**
217
- * Abort a site search spidering and mark it as failed
218
- *
219
- * Read more: https://www.datocms.com/docs/content-management-api/resources/site-search_source/abort
220
- *
221
- * @throws {ApiError}
222
- * @throws {TimeoutError}
223
- */
224
- rawAbort(siteSearchSourceId: string): Promise<void> {
225
- return this.client.request<void>({
226
- method: 'DELETE',
227
- url: `/site-search-sources/${siteSearchSourceId}/abort`,
228
- });
229
- }
230
-
231
- /**
232
- * Delete a site search source
233
- *
234
- * Read more: https://www.datocms.com/docs/content-management-api/resources/site-search_source/destroy
235
- *
236
- * @throws {ApiError}
237
- * @throws {TimeoutError}
238
- */
239
- destroy(siteSearchSourceId: string | ApiTypes.SiteSearchSourceData) {
240
- return this.rawDestroy(Utils.toId(siteSearchSourceId)).then((body) =>
241
- Utils.deserializeResponseBody<ApiTypes.SiteSearchSourceDestroyTargetSchema>(
242
- body,
243
- ),
244
- );
245
- }
246
-
247
- /**
248
- * Delete a site search source
249
- *
250
- * Read more: https://www.datocms.com/docs/content-management-api/resources/site-search_source/destroy
251
- *
252
- * @throws {ApiError}
253
- * @throws {TimeoutError}
254
- */
255
- rawDestroy(
256
- siteSearchSourceId: string,
257
- ): Promise<RawApiTypes.SiteSearchSourceDestroyTargetSchema> {
258
- return this.client.request<RawApiTypes.SiteSearchSourceDestroyTargetSchema>(
259
- {
260
- method: 'DELETE',
261
- url: `/site-search-sources/${siteSearchSourceId}`,
262
- },
263
- );
264
- }
265
- }