@tanglemedia/svelte-starter-directus-api 6.0.2 → 7.0.0
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/adapter/api-adapter.d.ts +15 -12
- package/dist/adapter/api-adapter.js +39 -10
- package/dist/provider/api-references-functions.provider.d.ts +1 -1
- package/dist/provider/api-references-functions.provider.js +1 -3
- package/package.json +12 -12
- package/src/adapter/api-adapter.ts +71 -13
- package/src/provider/api-references-functions.provider.ts +1 -202
|
@@ -25,16 +25,19 @@ export declare class DirectusApiAdapter<Schema extends SchemaShape = SchemaShape
|
|
|
25
25
|
meta?: AnyObject;
|
|
26
26
|
}, status?: number): Promise<ApiResponse<T, Response, M>>;
|
|
27
27
|
getConfig(configuration?: unknown): DirectusConfig;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
normalizeQuery(config?: ApiAdapterRequestConfig, merge?: Record<string, unknown>): {
|
|
29
|
+
[x: string]: unknown;
|
|
30
|
+
};
|
|
31
|
+
request<T>(method: BaseApiMethods, url: string, query?: ApiAdapterRequestConfig): Promise<T>;
|
|
32
|
+
find<T, Q = T, R = T>(collection: Path, query: ApiFindQuery<Q>, config?: ApiAdapterRequestConfig): Promise<ApiResponse<R[]>>;
|
|
33
|
+
findOne<T>(collection: Path, key?: ApiId, query?: ApiAdapterRequestConfig): Promise<ApiResponse<T>>;
|
|
34
|
+
aggregate<T, Q = T, R = T>(collection: Path, query: ApiAggregateQuery<Q>, config?: ApiAdapterRequestConfig): Promise<ApiResponse<R>>;
|
|
35
|
+
patch<T>(collection: Path, key: ApiId, query?: Record<string, unknown>, config?: ApiAdapterRequestConfig): Promise<ApiResponse<T>>;
|
|
36
|
+
post<T>(collection: Path, data: AnyObject, query?: Record<string, unknown>, config?: ApiAdapterRequestConfig): Promise<ApiResponse<T>>;
|
|
37
|
+
delete<T>(collection: Path, key?: ApiId, config?: ApiAdapterRequestConfig): Promise<ApiResponse<T>>;
|
|
38
|
+
put<T extends object, R = T>(collection: Path, key?: ApiId, payload?: AnyObject, query?: ApiAdapterRequestConfig): Promise<ApiResponse<R>>;
|
|
39
|
+
upload<T>(path: string | undefined, data: FormData, config?: ApiAdapterRequestConfig): Promise<ApiResponse<T>>;
|
|
40
|
+
createMany<T, R = T>(path: Path, body: ApiCreateManyQuery<T>, config?: ApiAdapterRequestConfig): Promise<ApiResponse<R[], Response, AnyObject>>;
|
|
41
|
+
updateMany<T, R = T>(path: Path, body: ApiUpdateManyQuery<T>, config?: ApiAdapterRequestConfig): Promise<ApiResponse<R[], Response, AnyObject>>;
|
|
42
|
+
deleteMany<R = null>(path: Path, body: ApiDeleteManyQuery<ApiId>, config?: ApiAdapterRequestConfig): Promise<ApiResponse<R, Response, AnyObject>>;
|
|
40
43
|
}
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
import { aggregate, createItem, createItems, deleteItem, deleteItems, readItem, readItems, updateItem, updateItems, uploadFiles } from '@directus/sdk';
|
|
2
2
|
import { ApiAdapterAbstract } from '@tanglemedia/svelte-starter-core';
|
|
3
|
+
const allowedQueryKeys = [
|
|
4
|
+
'fields',
|
|
5
|
+
'sort',
|
|
6
|
+
'filter',
|
|
7
|
+
'limit',
|
|
8
|
+
'offset',
|
|
9
|
+
'page',
|
|
10
|
+
'search',
|
|
11
|
+
'version',
|
|
12
|
+
'versionRaw',
|
|
13
|
+
'export',
|
|
14
|
+
'group',
|
|
15
|
+
'aggregate',
|
|
16
|
+
'deep',
|
|
17
|
+
'alias'
|
|
18
|
+
];
|
|
3
19
|
/**
|
|
4
20
|
* TODO: Various types fixes. The current adapter doesn't correctly follow the types defined under the ApiAdapterAbstract.
|
|
5
21
|
* See the fetch adapter under the core
|
|
@@ -75,6 +91,17 @@ export class DirectusApiAdapter extends ApiAdapterAbstract {
|
|
|
75
91
|
};
|
|
76
92
|
return Object.assign(client, config);
|
|
77
93
|
}
|
|
94
|
+
normalizeQuery(config = {}, merge) {
|
|
95
|
+
const q = { ...(config?.params || {}) };
|
|
96
|
+
const c = { ...config };
|
|
97
|
+
// legacy support, this pulls the directus specific keys from the config
|
|
98
|
+
const r = allowedQueryKeys.reduce((acc, k) => (typeof c[k] !== 'undefined' ? ((acc[k] = c[k]), acc) : acc), {});
|
|
99
|
+
return {
|
|
100
|
+
...q,
|
|
101
|
+
...r,
|
|
102
|
+
...(merge || {})
|
|
103
|
+
};
|
|
104
|
+
}
|
|
78
105
|
async request(method, url, query) {
|
|
79
106
|
try {
|
|
80
107
|
const response = await this.directus.request(() => {
|
|
@@ -91,7 +118,8 @@ export class DirectusApiAdapter extends ApiAdapterAbstract {
|
|
|
91
118
|
throw error;
|
|
92
119
|
}
|
|
93
120
|
}
|
|
94
|
-
async find(collection, query) {
|
|
121
|
+
async find(collection, query, config) {
|
|
122
|
+
query = this.normalizeQuery(config, query);
|
|
95
123
|
const response = (await this.directus.request(readItems(collection, query)));
|
|
96
124
|
const total = await this.includeTotals(collection, query);
|
|
97
125
|
if (null === total) {
|
|
@@ -101,11 +129,12 @@ export class DirectusApiAdapter extends ApiAdapterAbstract {
|
|
|
101
129
|
return this.transformResponse({ data: response, meta: { total } });
|
|
102
130
|
}
|
|
103
131
|
async findOne(collection, key, query) {
|
|
132
|
+
const q = this.normalizeQuery(query);
|
|
104
133
|
const data = await this.directus.request(readItem(collection, key, query));
|
|
105
134
|
return this.transformResponse({ data });
|
|
106
135
|
}
|
|
107
|
-
async aggregate(collection, query) {
|
|
108
|
-
const { aggregate: aggregate_, ...rest } = query
|
|
136
|
+
async aggregate(collection, query, config) {
|
|
137
|
+
const { aggregate: aggregate_, ...rest } = this.normalizeQuery(config, query);
|
|
109
138
|
const data = await this.directus.request(aggregate(collection, {
|
|
110
139
|
aggregate: aggregate_
|
|
111
140
|
? aggregate_
|
|
@@ -116,15 +145,15 @@ export class DirectusApiAdapter extends ApiAdapterAbstract {
|
|
|
116
145
|
}));
|
|
117
146
|
return this.transformResponse({ data });
|
|
118
147
|
}
|
|
119
|
-
async patch(collection, key, query) {
|
|
148
|
+
async patch(collection, key, query, config) {
|
|
120
149
|
const data = await this.directus.request(updateItem(collection, key, query));
|
|
121
150
|
return this.transformResponse({ data });
|
|
122
151
|
}
|
|
123
|
-
async post(collection, data, query) {
|
|
152
|
+
async post(collection, data, query, config) {
|
|
124
153
|
const response = await this.directus.request(createItem(collection, data, query));
|
|
125
154
|
return this.transformResponse({ data: response }, 201);
|
|
126
155
|
}
|
|
127
|
-
async delete(collection, key) {
|
|
156
|
+
async delete(collection, key, config) {
|
|
128
157
|
const data = await this.directus.request(deleteItem(collection, key));
|
|
129
158
|
return this.transformResponse({ data }, 202);
|
|
130
159
|
}
|
|
@@ -139,22 +168,22 @@ export class DirectusApiAdapter extends ApiAdapterAbstract {
|
|
|
139
168
|
}
|
|
140
169
|
}
|
|
141
170
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
142
|
-
async upload(path = '', data) {
|
|
171
|
+
async upload(path = '', data, config) {
|
|
143
172
|
const response = await this.directus.request(uploadFiles(data));
|
|
144
173
|
return this.transformResponse({ data: response }, 201);
|
|
145
174
|
}
|
|
146
|
-
async createMany(path, body) {
|
|
175
|
+
async createMany(path, body, config) {
|
|
147
176
|
const data = await this.directus.request(createItems(path, body.data, body?.query));
|
|
148
177
|
return this.transformResponse({ data }, 200);
|
|
149
178
|
}
|
|
150
|
-
async updateMany(path, body) {
|
|
179
|
+
async updateMany(path, body, config) {
|
|
151
180
|
if (!body.ids) {
|
|
152
181
|
throw Error('You must provide an array of keys to update');
|
|
153
182
|
}
|
|
154
183
|
const data = await this.directus.request(updateItems(path, body.ids || [], body.data, body?.query));
|
|
155
184
|
return this.transformResponse({ data }, 200);
|
|
156
185
|
}
|
|
157
|
-
async deleteMany(path, body) {
|
|
186
|
+
async deleteMany(path, body, config) {
|
|
158
187
|
const data = await this.directus.request(deleteItems(path, body.ids));
|
|
159
188
|
return this.transformResponse({ data }, 201);
|
|
160
189
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from '@directus/sdk';
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
// triggerOperation
|
|
3
|
-
deleteDashboards, readExtensions, updateExtension, readFields, readFieldsByCollection, readField, createField, updateField, deleteField, readFlows, readFlow, createFlow, createFlows, updateFlow, updateFlows, deleteFlow, deleteFlows, triggerFlow, readFolders, readFolder, createFolder, createFolders, updateFolder, updateFolders, deleteFolder, deleteFolders, readNotifications, readNotification, createNotification, createNotifications, updateNotification, updateNotifications, deleteNotification, deleteNotifications, readOperations, readOperation, createOperation, createOperations, updateOperation, updateOperations, deleteOperation, deleteOperations, readPanels, readPanel, createPanel, createPanels, updatePanel, updatePanels, deletePanel, deletePanels, readPermissions, readPermission, createPermission, createPermissions, updatePermission, updatePermissions, deletePermission, deletePermissions, readUserPermissions, readItemPermissions, readPolicies, readPolicy, createPolicy, createPolicies, updatePolicy, updatePolicies, deletePolicy, deletePolicies, readPresets, readPreset, createPreset, createPresets, updatePreset, updatePresets, deletePreset, deletePresets, readRelations, readRelationByCollection, readRelation, createRelation, updateRelation, deleteRelation, readRevisions, readRevision, readRoles, readRole, createRole, createRoles, updateRole, updateRoles, deleteRole, deleteRoles, schemaSnapshot, readOpenApiSpec, readGraphqlSdl, serverPing, serverInfo, serverHealth, readSettings, updateSettings, readShares, readShare, createShare, createShares, updateShare, updateShares, deleteShare, deleteShares, authenticateShare, inviteShare, readShareInfo, readTranslations, readTranslation, createTranslation, createTranslations, updateTranslation, updateTranslations, deleteTranslation, deleteTranslations, readUsers, readUser, readMe, updateMe, createUser, createUsers, updateUser, updateUsers, deleteUser, deleteUsers, registerUser, registerUserVerify, inviteUser, acceptUserInvite, generateTwoFactorSecret, enableTwoFactor, disableTwoFactor, randomString, generateHash, verifyHash, utilitySort, utilsImport, utilsExport, clearCache, passwordRequest, createDirectus, rest, staticToken } from '@directus/sdk';
|
|
1
|
+
export * from '@directus/sdk';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanglemedia/svelte-starter-directus-api",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"main": "src/index.ts",
|
|
5
5
|
"types": "src/index.ts",
|
|
6
6
|
"description": "directus API wrapper for all the directus sdk functionality",
|
|
@@ -22,31 +22,31 @@
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@directus/types": "13.
|
|
26
|
-
"@sveltejs/adapter-auto": "^
|
|
27
|
-
"@sveltejs/package": "^2.
|
|
28
|
-
"@sveltejs/vite-plugin-svelte": "^
|
|
25
|
+
"@directus/types": "13.5.0",
|
|
26
|
+
"@sveltejs/adapter-auto": "^7.0.0",
|
|
27
|
+
"@sveltejs/package": "^2.5.7",
|
|
28
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.1",
|
|
29
29
|
"@testing-library/jest-dom": "^6.6.3",
|
|
30
30
|
"@testing-library/svelte": "^5.2.7",
|
|
31
31
|
"@vitest/coverage-v8": "^3.0.8",
|
|
32
32
|
"jsdom": "^26.0.0",
|
|
33
33
|
"msw": "^2.7.3",
|
|
34
|
-
"svelte": "^5.
|
|
35
|
-
"svelte-check": "^4.
|
|
36
|
-
"vite": "^
|
|
37
|
-
"vitest": "^
|
|
34
|
+
"svelte": "^5.46.1",
|
|
35
|
+
"svelte-check": "^4.3.5",
|
|
36
|
+
"vite": "^7.3.0",
|
|
37
|
+
"vitest": "^4.0.16",
|
|
38
38
|
"@internal/eslint-config": "0.0.0",
|
|
39
|
-
"@tanglemedia/svelte-starter-core": "
|
|
39
|
+
"@tanglemedia/svelte-starter-core": "3.0.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@directus/sdk": "
|
|
42
|
+
"@directus/sdk": "20.3.0",
|
|
43
43
|
"@types/js-cookie": "^3.0.6",
|
|
44
44
|
"esm-env": "^1.2.2",
|
|
45
45
|
"js-cookie": "^3.0.5"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@sveltejs/kit": ">=2 <3",
|
|
49
|
-
"@tanglemedia/svelte-starter-core": ">=
|
|
49
|
+
"@tanglemedia/svelte-starter-core": ">=3.0.0",
|
|
50
50
|
"svelte": "^4.0.0 || >=5.0.0"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
@@ -34,6 +34,23 @@ import type { DirectusConfig, SchemaShape } from '../types/adapter.types';
|
|
|
34
34
|
export type AdapterClient<Schema extends SchemaShape = SchemaShape> = DirectusClient<Schema> &
|
|
35
35
|
RestClient<Schema>;
|
|
36
36
|
|
|
37
|
+
const allowedQueryKeys = [
|
|
38
|
+
'fields',
|
|
39
|
+
'sort',
|
|
40
|
+
'filter',
|
|
41
|
+
'limit',
|
|
42
|
+
'offset',
|
|
43
|
+
'page',
|
|
44
|
+
'search',
|
|
45
|
+
'version',
|
|
46
|
+
'versionRaw',
|
|
47
|
+
'export',
|
|
48
|
+
'group',
|
|
49
|
+
'aggregate',
|
|
50
|
+
'deep',
|
|
51
|
+
'alias'
|
|
52
|
+
];
|
|
53
|
+
|
|
37
54
|
/**
|
|
38
55
|
* TODO: Various types fixes. The current adapter doesn't correctly follow the types defined under the ApiAdapterAbstract.
|
|
39
56
|
* See the fetch adapter under the core
|
|
@@ -143,10 +160,25 @@ export class DirectusApiAdapter<
|
|
|
143
160
|
return Object.assign(client, config);
|
|
144
161
|
}
|
|
145
162
|
|
|
163
|
+
normalizeQuery(config: ApiAdapterRequestConfig = {}, merge?: Record<string, unknown>) {
|
|
164
|
+
const q = { ...(config?.params || {}) };
|
|
165
|
+
const c = { ...config } as Record<string, unknown>;
|
|
166
|
+
// legacy support, this pulls the directus specific keys from the config
|
|
167
|
+
const r = allowedQueryKeys.reduce<Record<string, unknown>>(
|
|
168
|
+
(acc, k) => (typeof c[k] !== 'undefined' ? ((acc[k] = c[k]), acc) : acc),
|
|
169
|
+
{}
|
|
170
|
+
);
|
|
171
|
+
return {
|
|
172
|
+
...q,
|
|
173
|
+
...r,
|
|
174
|
+
...(merge || {})
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
146
178
|
public async request<T>(
|
|
147
179
|
method: BaseApiMethods,
|
|
148
180
|
url: string,
|
|
149
|
-
query?:
|
|
181
|
+
query?: ApiAdapterRequestConfig
|
|
150
182
|
): Promise<T> {
|
|
151
183
|
try {
|
|
152
184
|
const response = await this.directus.request<T>(() => {
|
|
@@ -165,8 +197,10 @@ export class DirectusApiAdapter<
|
|
|
165
197
|
|
|
166
198
|
public async find<T, Q = T, R = T>(
|
|
167
199
|
collection: Path,
|
|
168
|
-
query: ApiFindQuery<Q
|
|
200
|
+
query: ApiFindQuery<Q>,
|
|
201
|
+
config?: ApiAdapterRequestConfig
|
|
169
202
|
): Promise<ApiResponse<R[]>> {
|
|
203
|
+
query = this.normalizeQuery(config, query);
|
|
170
204
|
const response = (await this.directus.request<T>(readItems(collection, query))) as R[];
|
|
171
205
|
const total = await this.includeTotals(collection, query);
|
|
172
206
|
if (null === total) {
|
|
@@ -180,17 +214,19 @@ export class DirectusApiAdapter<
|
|
|
180
214
|
public async findOne<T>(
|
|
181
215
|
collection: Path,
|
|
182
216
|
key?: ApiId,
|
|
183
|
-
query?:
|
|
217
|
+
query?: ApiAdapterRequestConfig
|
|
184
218
|
): Promise<ApiResponse<T>> {
|
|
219
|
+
const q = this.normalizeQuery(query);
|
|
185
220
|
const data = await this.directus.request<T>(readItem(collection, key, query));
|
|
186
221
|
return this.transformResponse({ data });
|
|
187
222
|
}
|
|
188
223
|
|
|
189
224
|
public async aggregate<T, Q = T, R = T>(
|
|
190
225
|
collection: Path,
|
|
191
|
-
query: ApiAggregateQuery<Q
|
|
226
|
+
query: ApiAggregateQuery<Q>,
|
|
227
|
+
config?: ApiAdapterRequestConfig
|
|
192
228
|
): Promise<ApiResponse<R>> {
|
|
193
|
-
const { aggregate: aggregate_, ...rest } = query
|
|
229
|
+
const { aggregate: aggregate_, ...rest } = this.normalizeQuery(config, query);
|
|
194
230
|
|
|
195
231
|
const data = await this.directus.request<T>(
|
|
196
232
|
aggregate(collection, {
|
|
@@ -209,7 +245,8 @@ export class DirectusApiAdapter<
|
|
|
209
245
|
public async patch<T>(
|
|
210
246
|
collection: Path,
|
|
211
247
|
key: ApiId,
|
|
212
|
-
query?: Record<string, unknown
|
|
248
|
+
query?: Record<string, unknown>,
|
|
249
|
+
config?: ApiAdapterRequestConfig
|
|
213
250
|
): Promise<ApiResponse<T>> {
|
|
214
251
|
const data = await this.directus.request<T>(updateItem(collection, key, query));
|
|
215
252
|
return this.transformResponse({ data });
|
|
@@ -218,13 +255,18 @@ export class DirectusApiAdapter<
|
|
|
218
255
|
public async post<T>(
|
|
219
256
|
collection: Path,
|
|
220
257
|
data: AnyObject,
|
|
221
|
-
query?: Record<string, unknown
|
|
258
|
+
query?: Record<string, unknown>,
|
|
259
|
+
config?: ApiAdapterRequestConfig
|
|
222
260
|
): Promise<ApiResponse<T>> {
|
|
223
261
|
const response = await this.directus.request<T>(createItem(collection, data, query));
|
|
224
262
|
return this.transformResponse({ data: response }, 201);
|
|
225
263
|
}
|
|
226
264
|
|
|
227
|
-
public async delete<T>(
|
|
265
|
+
public async delete<T>(
|
|
266
|
+
collection: Path,
|
|
267
|
+
key?: ApiId,
|
|
268
|
+
config?: ApiAdapterRequestConfig
|
|
269
|
+
): Promise<ApiResponse<T>> {
|
|
228
270
|
const data = await this.directus.request<T>(deleteItem(collection, key));
|
|
229
271
|
return this.transformResponse({ data }, 202);
|
|
230
272
|
}
|
|
@@ -233,7 +275,7 @@ export class DirectusApiAdapter<
|
|
|
233
275
|
collection: Path,
|
|
234
276
|
key?: ApiId,
|
|
235
277
|
payload?: AnyObject,
|
|
236
|
-
query?:
|
|
278
|
+
query?: ApiAdapterRequestConfig
|
|
237
279
|
): Promise<ApiResponse<R>> {
|
|
238
280
|
if (key) {
|
|
239
281
|
const data = (await this.directus.request<T>(
|
|
@@ -247,17 +289,29 @@ export class DirectusApiAdapter<
|
|
|
247
289
|
}
|
|
248
290
|
|
|
249
291
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
250
|
-
public async upload<T>(
|
|
292
|
+
public async upload<T>(
|
|
293
|
+
path: string = '',
|
|
294
|
+
data: FormData,
|
|
295
|
+
config?: ApiAdapterRequestConfig
|
|
296
|
+
): Promise<ApiResponse<T>> {
|
|
251
297
|
const response = await this.directus.request<T>(uploadFiles(data));
|
|
252
298
|
return this.transformResponse({ data: response }, 201);
|
|
253
299
|
}
|
|
254
300
|
|
|
255
|
-
async createMany<T, R = T>(
|
|
301
|
+
async createMany<T, R = T>(
|
|
302
|
+
path: Path,
|
|
303
|
+
body: ApiCreateManyQuery<T>,
|
|
304
|
+
config?: ApiAdapterRequestConfig
|
|
305
|
+
) {
|
|
256
306
|
const data = await this.directus.request<T>(createItems(path, body.data, body?.query));
|
|
257
307
|
return this.transformResponse<R[]>({ data }, 200);
|
|
258
308
|
}
|
|
259
309
|
|
|
260
|
-
async updateMany<T, R = T>(
|
|
310
|
+
async updateMany<T, R = T>(
|
|
311
|
+
path: Path,
|
|
312
|
+
body: ApiUpdateManyQuery<T>,
|
|
313
|
+
config?: ApiAdapterRequestConfig
|
|
314
|
+
) {
|
|
261
315
|
if (!body.ids) {
|
|
262
316
|
throw Error('You must provide an array of keys to update');
|
|
263
317
|
}
|
|
@@ -267,7 +321,11 @@ export class DirectusApiAdapter<
|
|
|
267
321
|
return this.transformResponse<R[]>({ data }, 200);
|
|
268
322
|
}
|
|
269
323
|
|
|
270
|
-
async deleteMany<R = null>(
|
|
324
|
+
async deleteMany<R = null>(
|
|
325
|
+
path: Path,
|
|
326
|
+
body: ApiDeleteManyQuery<ApiId>,
|
|
327
|
+
config?: ApiAdapterRequestConfig
|
|
328
|
+
) {
|
|
271
329
|
const data = await this.directus.request(deleteItems(path, body.ids));
|
|
272
330
|
return this.transformResponse<R>({ data } as R, 201);
|
|
273
331
|
}
|
|
@@ -1,202 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
readItem,
|
|
3
|
-
readSingleton,
|
|
4
|
-
readItems,
|
|
5
|
-
createItem,
|
|
6
|
-
createItems,
|
|
7
|
-
updateItem,
|
|
8
|
-
updateSingleton,
|
|
9
|
-
updateItems,
|
|
10
|
-
deleteItem,
|
|
11
|
-
deleteItems,
|
|
12
|
-
readAssetRaw,
|
|
13
|
-
readFiles,
|
|
14
|
-
readFile,
|
|
15
|
-
uploadFiles,
|
|
16
|
-
importFile,
|
|
17
|
-
updateFile,
|
|
18
|
-
updateFiles,
|
|
19
|
-
deleteFile,
|
|
20
|
-
deleteFiles,
|
|
21
|
-
readActivities,
|
|
22
|
-
readActivity,
|
|
23
|
-
readCollections,
|
|
24
|
-
readCollection,
|
|
25
|
-
createCollection,
|
|
26
|
-
updateCollection,
|
|
27
|
-
deleteCollection,
|
|
28
|
-
readComments,
|
|
29
|
-
readComment,
|
|
30
|
-
createComment,
|
|
31
|
-
createComments,
|
|
32
|
-
updateComment,
|
|
33
|
-
updateComments,
|
|
34
|
-
deleteComment,
|
|
35
|
-
deleteComments,
|
|
36
|
-
readContentVersions,
|
|
37
|
-
readContentVersion,
|
|
38
|
-
createContentVersion,
|
|
39
|
-
createContentVersions,
|
|
40
|
-
updateContentVersion,
|
|
41
|
-
updateContentVersions,
|
|
42
|
-
deleteContentVersion,
|
|
43
|
-
deleteContentVersions,
|
|
44
|
-
saveToContentVersion,
|
|
45
|
-
compareContentVersion,
|
|
46
|
-
promoteContentVersion,
|
|
47
|
-
readDashboards,
|
|
48
|
-
readDashboard,
|
|
49
|
-
createDashboard,
|
|
50
|
-
createDashboards,
|
|
51
|
-
updateDashboard,
|
|
52
|
-
updateDashboards,
|
|
53
|
-
deleteDashboard,
|
|
54
|
-
// triggerOperation
|
|
55
|
-
deleteDashboards,
|
|
56
|
-
readExtensions,
|
|
57
|
-
updateExtension,
|
|
58
|
-
readFields,
|
|
59
|
-
readFieldsByCollection,
|
|
60
|
-
readField,
|
|
61
|
-
createField,
|
|
62
|
-
updateField,
|
|
63
|
-
deleteField,
|
|
64
|
-
readFlows,
|
|
65
|
-
readFlow,
|
|
66
|
-
createFlow,
|
|
67
|
-
createFlows,
|
|
68
|
-
updateFlow,
|
|
69
|
-
updateFlows,
|
|
70
|
-
deleteFlow,
|
|
71
|
-
deleteFlows,
|
|
72
|
-
triggerFlow,
|
|
73
|
-
readFolders,
|
|
74
|
-
readFolder,
|
|
75
|
-
createFolder,
|
|
76
|
-
createFolders,
|
|
77
|
-
updateFolder,
|
|
78
|
-
updateFolders,
|
|
79
|
-
deleteFolder,
|
|
80
|
-
deleteFolders,
|
|
81
|
-
readNotifications,
|
|
82
|
-
readNotification,
|
|
83
|
-
createNotification,
|
|
84
|
-
createNotifications,
|
|
85
|
-
updateNotification,
|
|
86
|
-
updateNotifications,
|
|
87
|
-
deleteNotification,
|
|
88
|
-
deleteNotifications,
|
|
89
|
-
readOperations,
|
|
90
|
-
readOperation,
|
|
91
|
-
createOperation,
|
|
92
|
-
createOperations,
|
|
93
|
-
updateOperation,
|
|
94
|
-
updateOperations,
|
|
95
|
-
deleteOperation,
|
|
96
|
-
deleteOperations,
|
|
97
|
-
readPanels,
|
|
98
|
-
readPanel,
|
|
99
|
-
createPanel,
|
|
100
|
-
createPanels,
|
|
101
|
-
updatePanel,
|
|
102
|
-
updatePanels,
|
|
103
|
-
deletePanel,
|
|
104
|
-
deletePanels,
|
|
105
|
-
readPermissions,
|
|
106
|
-
readPermission,
|
|
107
|
-
createPermission,
|
|
108
|
-
createPermissions,
|
|
109
|
-
updatePermission,
|
|
110
|
-
updatePermissions,
|
|
111
|
-
deletePermission,
|
|
112
|
-
deletePermissions,
|
|
113
|
-
readUserPermissions,
|
|
114
|
-
readItemPermissions,
|
|
115
|
-
readPolicies,
|
|
116
|
-
readPolicy,
|
|
117
|
-
createPolicy,
|
|
118
|
-
createPolicies,
|
|
119
|
-
updatePolicy,
|
|
120
|
-
updatePolicies,
|
|
121
|
-
deletePolicy,
|
|
122
|
-
deletePolicies,
|
|
123
|
-
readPresets,
|
|
124
|
-
readPreset,
|
|
125
|
-
createPreset,
|
|
126
|
-
createPresets,
|
|
127
|
-
updatePreset,
|
|
128
|
-
updatePresets,
|
|
129
|
-
deletePreset,
|
|
130
|
-
deletePresets,
|
|
131
|
-
readRelations,
|
|
132
|
-
readRelationByCollection,
|
|
133
|
-
readRelation,
|
|
134
|
-
createRelation,
|
|
135
|
-
updateRelation,
|
|
136
|
-
deleteRelation,
|
|
137
|
-
readRevisions,
|
|
138
|
-
readRevision,
|
|
139
|
-
readRoles,
|
|
140
|
-
readRole,
|
|
141
|
-
createRole,
|
|
142
|
-
createRoles,
|
|
143
|
-
updateRole,
|
|
144
|
-
updateRoles,
|
|
145
|
-
deleteRole,
|
|
146
|
-
deleteRoles,
|
|
147
|
-
schemaSnapshot,
|
|
148
|
-
readOpenApiSpec,
|
|
149
|
-
readGraphqlSdl,
|
|
150
|
-
serverPing,
|
|
151
|
-
serverInfo,
|
|
152
|
-
serverHealth,
|
|
153
|
-
readSettings,
|
|
154
|
-
updateSettings,
|
|
155
|
-
readShares,
|
|
156
|
-
readShare,
|
|
157
|
-
createShare,
|
|
158
|
-
createShares,
|
|
159
|
-
updateShare,
|
|
160
|
-
updateShares,
|
|
161
|
-
deleteShare,
|
|
162
|
-
deleteShares,
|
|
163
|
-
authenticateShare,
|
|
164
|
-
inviteShare,
|
|
165
|
-
readShareInfo,
|
|
166
|
-
readTranslations,
|
|
167
|
-
readTranslation,
|
|
168
|
-
createTranslation,
|
|
169
|
-
createTranslations,
|
|
170
|
-
updateTranslation,
|
|
171
|
-
updateTranslations,
|
|
172
|
-
deleteTranslation,
|
|
173
|
-
deleteTranslations,
|
|
174
|
-
readUsers,
|
|
175
|
-
readUser,
|
|
176
|
-
readMe,
|
|
177
|
-
updateMe,
|
|
178
|
-
createUser,
|
|
179
|
-
createUsers,
|
|
180
|
-
updateUser,
|
|
181
|
-
updateUsers,
|
|
182
|
-
deleteUser,
|
|
183
|
-
deleteUsers,
|
|
184
|
-
registerUser,
|
|
185
|
-
registerUserVerify,
|
|
186
|
-
inviteUser,
|
|
187
|
-
acceptUserInvite,
|
|
188
|
-
generateTwoFactorSecret,
|
|
189
|
-
enableTwoFactor,
|
|
190
|
-
disableTwoFactor,
|
|
191
|
-
randomString,
|
|
192
|
-
generateHash,
|
|
193
|
-
verifyHash,
|
|
194
|
-
utilitySort,
|
|
195
|
-
utilsImport,
|
|
196
|
-
utilsExport,
|
|
197
|
-
clearCache,
|
|
198
|
-
passwordRequest,
|
|
199
|
-
createDirectus,
|
|
200
|
-
rest,
|
|
201
|
-
staticToken
|
|
202
|
-
} from '@directus/sdk';
|
|
1
|
+
export * from '@directus/sdk';
|