@tanglemedia/svelte-starter-directus-api 6.0.0 → 6.0.2
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 +1 -1
- package/dist/adapter/api-adapter.js +4 -4
- package/dist/provider/api-references-functions.provider.d.ts +1 -1
- package/dist/provider/api-references-functions.provider.js +3 -1
- package/package.json +3 -3
- package/src/provider/api-references-functions.provider.ts +1 -1
|
@@ -32,7 +32,7 @@ export declare class DirectusApiAdapter<Schema extends SchemaShape = SchemaShape
|
|
|
32
32
|
patch<T>(collection: Path, key: ApiId, query?: Record<string, unknown>): Promise<ApiResponse<T>>;
|
|
33
33
|
post<T>(collection: Path, data: AnyObject, query?: Record<string, unknown>): Promise<ApiResponse<T>>;
|
|
34
34
|
delete<T>(collection: Path, key?: ApiId): Promise<ApiResponse<T>>;
|
|
35
|
-
put<T extends object, R = T>(collection: Path, key?: ApiId, payload?: AnyObject): Promise<ApiResponse<R>>;
|
|
35
|
+
put<T extends object, R = T>(collection: Path, key?: ApiId, payload?: AnyObject, query?: Record<string, unknown>): Promise<ApiResponse<R>>;
|
|
36
36
|
upload<T>(path: string | undefined, data: FormData): Promise<ApiResponse<T>>;
|
|
37
37
|
createMany<T, R = T>(path: Path, body: ApiCreateManyQuery<T>): Promise<ApiResponse<R[], Response, AnyObject>>;
|
|
38
38
|
updateMany<T, R = T>(path: Path, body: ApiUpdateManyQuery<T>): Promise<ApiResponse<R[], Response, AnyObject>>;
|
|
@@ -128,9 +128,9 @@ export class DirectusApiAdapter extends ApiAdapterAbstract {
|
|
|
128
128
|
const data = await this.directus.request(deleteItem(collection, key));
|
|
129
129
|
return this.transformResponse({ data }, 202);
|
|
130
130
|
}
|
|
131
|
-
async put(collection, key, payload) {
|
|
131
|
+
async put(collection, key, payload, query) {
|
|
132
132
|
if (key) {
|
|
133
|
-
const data = (await this.directus.request(updateItem(collection, key, payload)));
|
|
133
|
+
const data = (await this.directus.request(updateItem(collection, key, payload, query)));
|
|
134
134
|
return this.transformResponse({ data }, 201);
|
|
135
135
|
}
|
|
136
136
|
else {
|
|
@@ -144,14 +144,14 @@ export class DirectusApiAdapter extends ApiAdapterAbstract {
|
|
|
144
144
|
return this.transformResponse({ data: response }, 201);
|
|
145
145
|
}
|
|
146
146
|
async createMany(path, body) {
|
|
147
|
-
const data = await this.directus.request(createItems(path, body.data));
|
|
147
|
+
const data = await this.directus.request(createItems(path, body.data, body?.query));
|
|
148
148
|
return this.transformResponse({ data }, 200);
|
|
149
149
|
}
|
|
150
150
|
async updateMany(path, body) {
|
|
151
151
|
if (!body.ids) {
|
|
152
152
|
throw Error('You must provide an array of keys to update');
|
|
153
153
|
}
|
|
154
|
-
const data = await this.directus.request(updateItems(path, body.ids || [], body.data));
|
|
154
|
+
const data = await this.directus.request(updateItems(path, body.ids || [], body.data, body?.query));
|
|
155
155
|
return this.transformResponse({ data }, 200);
|
|
156
156
|
}
|
|
157
157
|
async deleteMany(path, body) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { readItem, readSingleton, readItems, createItem, createItems, updateItem, updateSingleton, updateItems, deleteItem, deleteItems, readAssetRaw, readFiles, readFile, uploadFiles, importFile, updateFile, updateFiles, deleteFile, deleteFiles, readActivities, readActivity, readCollections, readCollection, createCollection, updateCollection, deleteCollection, readComments, readComment, createComment, createComments, updateComment, updateComments, deleteComment, deleteComments, readContentVersions, readContentVersion, createContentVersion, createContentVersions, updateContentVersion, updateContentVersions, deleteContentVersion, deleteContentVersions, saveToContentVersion, compareContentVersion, promoteContentVersion, readDashboards, readDashboard, createDashboard, createDashboards, updateDashboard, updateDashboards, deleteDashboard, 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,
|
|
1
|
+
export { readItem, readSingleton, readItems, createItem, createItems, updateItem, updateSingleton, updateItems, deleteItem, deleteItems, readAssetRaw, readFiles, readFile, uploadFiles, importFile, updateFile, updateFiles, deleteFile, deleteFiles, readActivities, readActivity, readCollections, readCollection, createCollection, updateCollection, deleteCollection, readComments, readComment, createComment, createComments, updateComment, updateComments, deleteComment, deleteComments, readContentVersions, readContentVersion, createContentVersion, createContentVersions, updateContentVersion, updateContentVersions, deleteContentVersion, deleteContentVersions, saveToContentVersion, compareContentVersion, promoteContentVersion, readDashboards, readDashboard, createDashboard, createDashboards, updateDashboard, updateDashboards, deleteDashboard, 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 +1,3 @@
|
|
|
1
|
-
export { readItem, readSingleton, readItems, createItem, createItems, updateItem, updateSingleton, updateItems, deleteItem, deleteItems, readAssetRaw, readFiles, readFile, uploadFiles, importFile, updateFile, updateFiles, deleteFile, deleteFiles, readActivities, readActivity, readCollections, readCollection, createCollection, updateCollection, deleteCollection, readComments, readComment, createComment, createComments, updateComment, updateComments, deleteComment, deleteComments, readContentVersions, readContentVersion, createContentVersion, createContentVersions, updateContentVersion, updateContentVersions, deleteContentVersion, deleteContentVersions, saveToContentVersion, compareContentVersion, promoteContentVersion, readDashboards, readDashboard, createDashboard, createDashboards, updateDashboard, updateDashboards, deleteDashboard,
|
|
1
|
+
export { readItem, readSingleton, readItems, createItem, createItems, updateItem, updateSingleton, updateItems, deleteItem, deleteItems, readAssetRaw, readFiles, readFile, uploadFiles, importFile, updateFile, updateFiles, deleteFile, deleteFiles, readActivities, readActivity, readCollections, readCollection, createCollection, updateCollection, deleteCollection, readComments, readComment, createComment, createComments, updateComment, updateComments, deleteComment, deleteComments, readContentVersions, readContentVersion, createContentVersion, createContentVersions, updateContentVersion, updateContentVersions, deleteContentVersion, deleteContentVersions, saveToContentVersion, compareContentVersion, promoteContentVersion, readDashboards, readDashboard, createDashboard, createDashboards, updateDashboard, updateDashboards, deleteDashboard,
|
|
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';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanglemedia/svelte-starter-directus-api",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.2",
|
|
4
4
|
"main": "src/index.ts",
|
|
5
5
|
"types": "src/index.ts",
|
|
6
6
|
"description": "directus API wrapper for all the directus sdk functionality",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"svelte-check": "^4.1.5",
|
|
36
36
|
"vite": "^6.2.1",
|
|
37
37
|
"vitest": "^3.0.8",
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
38
|
+
"@internal/eslint-config": "0.0.0",
|
|
39
|
+
"@tanglemedia/svelte-starter-core": "2.0.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@directus/sdk": "19.0.1",
|
|
@@ -51,6 +51,7 @@ export {
|
|
|
51
51
|
updateDashboard,
|
|
52
52
|
updateDashboards,
|
|
53
53
|
deleteDashboard,
|
|
54
|
+
// triggerOperation
|
|
54
55
|
deleteDashboards,
|
|
55
56
|
readExtensions,
|
|
56
57
|
updateExtension,
|
|
@@ -93,7 +94,6 @@ export {
|
|
|
93
94
|
updateOperations,
|
|
94
95
|
deleteOperation,
|
|
95
96
|
deleteOperations,
|
|
96
|
-
triggerOperation,
|
|
97
97
|
readPanels,
|
|
98
98
|
readPanel,
|
|
99
99
|
createPanel,
|