@datocms/cma-client 5.2.0-alpha.3 → 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} +53 -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 +131 -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 +136 -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} +52 -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 +131 -131
  28. package/dist/types/generated/Client.d.ts +2 -2
  29. package/dist/types/generated/RawApiTypes.d.ts +136 -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 +75 -75
  35. package/src/generated/ApiTypes.ts +132 -133
  36. package/src/generated/Client.ts +5 -5
  37. package/src/generated/RawApiTypes.ts +137 -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 -267
@@ -1,267 +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
- 'user_agent_suffix',
95
- ],
96
- relationships: ['build_triggers'],
97
- },
98
- ),
99
- ).then((body) =>
100
- Utils.deserializeResponseBody<ApiTypes.SiteSearchSourceCreateTargetSchema>(
101
- body,
102
- ),
103
- );
104
- }
105
-
106
- /**
107
- * Create site search source
108
- *
109
- * Read more: https://www.datocms.com/docs/content-management-api/resources/site-search_source/create
110
- *
111
- * @throws {ApiError}
112
- * @throws {TimeoutError}
113
- */
114
- rawCreate(
115
- body: RawApiTypes.SiteSearchSourceCreateSchema,
116
- ): Promise<RawApiTypes.SiteSearchSourceCreateTargetSchema> {
117
- return this.client.request<RawApiTypes.SiteSearchSourceCreateTargetSchema>({
118
- method: 'POST',
119
- url: '/site-search-sources',
120
- body,
121
- });
122
- }
123
-
124
- /**
125
- * Update site search source
126
- *
127
- * Read more: https://www.datocms.com/docs/content-management-api/resources/site-search_source/update
128
- *
129
- * @throws {ApiError}
130
- * @throws {TimeoutError}
131
- */
132
- update(
133
- siteSearchSourceId: string | ApiTypes.SiteSearchSourceData,
134
- body: ApiTypes.SiteSearchSourceUpdateSchema,
135
- ) {
136
- return this.rawUpdate(
137
- Utils.toId(siteSearchSourceId),
138
- Utils.serializeRequestBody<RawApiTypes.SiteSearchSourceUpdateSchema>(
139
- body,
140
- {
141
- id: Utils.toId(siteSearchSourceId),
142
- type: 'site_search_source',
143
- attributes: [
144
- 'name',
145
- 'enabled',
146
- 'build_trigger_indexing_enabled',
147
- 'frontend_url',
148
- 'user_agent_suffix',
149
- ],
150
- relationships: ['build_triggers'],
151
- },
152
- ),
153
- ).then((body) =>
154
- Utils.deserializeResponseBody<ApiTypes.SiteSearchSourceUpdateTargetSchema>(
155
- body,
156
- ),
157
- );
158
- }
159
-
160
- /**
161
- * Update site search source
162
- *
163
- * Read more: https://www.datocms.com/docs/content-management-api/resources/site-search_source/update
164
- *
165
- * @throws {ApiError}
166
- * @throws {TimeoutError}
167
- */
168
- rawUpdate(
169
- siteSearchSourceId: string,
170
- body: RawApiTypes.SiteSearchSourceUpdateSchema,
171
- ): Promise<RawApiTypes.SiteSearchSourceUpdateTargetSchema> {
172
- return this.client.request<RawApiTypes.SiteSearchSourceUpdateTargetSchema>({
173
- method: 'PUT',
174
- url: `/site-search-sources/${siteSearchSourceId}`,
175
- body,
176
- });
177
- }
178
-
179
- /**
180
- * Trigger a site search indexing
181
- *
182
- * Read more: https://www.datocms.com/docs/content-management-api/resources/site-search_source/trigger
183
- *
184
- * @throws {ApiError}
185
- * @throws {TimeoutError}
186
- */
187
- trigger(siteSearchSourceId: string | ApiTypes.SiteSearchSourceData) {
188
- return this.rawTrigger(Utils.toId(siteSearchSourceId));
189
- }
190
-
191
- /**
192
- * Trigger a site search indexing
193
- *
194
- * Read more: https://www.datocms.com/docs/content-management-api/resources/site-search_source/trigger
195
- *
196
- * @throws {ApiError}
197
- * @throws {TimeoutError}
198
- */
199
- rawTrigger(siteSearchSourceId: string): Promise<void> {
200
- return this.client.request<void>({
201
- method: 'POST',
202
- url: `/site-search-sources/${siteSearchSourceId}/trigger`,
203
- });
204
- }
205
-
206
- /**
207
- * Abort a site search spidering and mark it as failed
208
- *
209
- * Read more: https://www.datocms.com/docs/content-management-api/resources/site-search_source/abort
210
- *
211
- * @throws {ApiError}
212
- * @throws {TimeoutError}
213
- */
214
- abort(siteSearchSourceId: string | ApiTypes.SiteSearchSourceData) {
215
- return this.rawAbort(Utils.toId(siteSearchSourceId));
216
- }
217
-
218
- /**
219
- * Abort a site search spidering and mark it as failed
220
- *
221
- * Read more: https://www.datocms.com/docs/content-management-api/resources/site-search_source/abort
222
- *
223
- * @throws {ApiError}
224
- * @throws {TimeoutError}
225
- */
226
- rawAbort(siteSearchSourceId: string): Promise<void> {
227
- return this.client.request<void>({
228
- method: 'DELETE',
229
- url: `/site-search-sources/${siteSearchSourceId}/abort`,
230
- });
231
- }
232
-
233
- /**
234
- * Delete a site search source
235
- *
236
- * Read more: https://www.datocms.com/docs/content-management-api/resources/site-search_source/destroy
237
- *
238
- * @throws {ApiError}
239
- * @throws {TimeoutError}
240
- */
241
- destroy(siteSearchSourceId: string | ApiTypes.SiteSearchSourceData) {
242
- return this.rawDestroy(Utils.toId(siteSearchSourceId)).then((body) =>
243
- Utils.deserializeResponseBody<ApiTypes.SiteSearchSourceDestroyTargetSchema>(
244
- body,
245
- ),
246
- );
247
- }
248
-
249
- /**
250
- * Delete a site search source
251
- *
252
- * Read more: https://www.datocms.com/docs/content-management-api/resources/site-search_source/destroy
253
- *
254
- * @throws {ApiError}
255
- * @throws {TimeoutError}
256
- */
257
- rawDestroy(
258
- siteSearchSourceId: string,
259
- ): Promise<RawApiTypes.SiteSearchSourceDestroyTargetSchema> {
260
- return this.client.request<RawApiTypes.SiteSearchSourceDestroyTargetSchema>(
261
- {
262
- method: 'DELETE',
263
- url: `/site-search-sources/${siteSearchSourceId}`,
264
- },
265
- );
266
- }
267
- }