@directus/extensions-sdk 9.0.0-rc.96 → 9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@directus/extensions-sdk",
3
- "version": "9.0.0-rc.96",
3
+ "version": "9.0.0",
4
4
  "description": "A toolkit to develop extensions to extend Directus.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "exports": {
@@ -29,9 +29,9 @@
29
29
  "node": ">=12.20.0"
30
30
  },
31
31
  "author": "Nicola Krumschmidt",
32
- "gitHead": "435cc0cc67e364b1a30605bddb827da68d63b561",
32
+ "gitHead": "c95add08ef1386cab6e54546f03d541d889148ed",
33
33
  "dependencies": {
34
- "@directus/shared": "9.0.0-rc.96",
34
+ "@directus/shared": "9.0.0",
35
35
  "@rollup/plugin-commonjs": "^21.0.0",
36
36
  "@rollup/plugin-json": "^4.1.0",
37
37
  "@rollup/plugin-node-resolve": "^13.0.0",
@@ -51,6 +51,6 @@
51
51
  "devDependencies": {
52
52
  "npm-run-all": "4.1.5",
53
53
  "rimraf": "3.0.2",
54
- "typescript": "4.4.3"
54
+ "typescript": "4.4.4"
55
55
  }
56
56
  }
@@ -7,7 +7,7 @@ export default {
7
7
  props: {
8
8
  value: {
9
9
  type: String,
10
- required: true,
10
+ default: null,
11
11
  },
12
12
  },
13
13
  };
@@ -3,9 +3,9 @@ import DisplayComponent from './display.vue';
3
3
  export default {
4
4
  id: 'custom',
5
5
  name: 'Custom',
6
- description: 'This is my custom display!',
7
6
  icon: 'box',
7
+ description: 'This is my custom display!',
8
8
  component: DisplayComponent,
9
- types: ['string'],
10
9
  options: null,
10
+ types: ['string'],
11
11
  };
@@ -9,7 +9,7 @@ export default defineComponent({
9
9
  props: {
10
10
  value: {
11
11
  type: String,
12
- required: true,
12
+ default: null,
13
13
  },
14
14
  },
15
15
  });
@@ -4,9 +4,9 @@ import DisplayComponent from './display.vue';
4
4
  export default defineDisplay({
5
5
  id: 'custom',
6
6
  name: 'Custom',
7
- description: 'This is my custom display!',
8
7
  icon: 'box',
8
+ description: 'This is my custom display!',
9
9
  component: DisplayComponent,
10
- types: ['string'],
11
10
  options: null,
11
+ types: ['string'],
12
12
  });
@@ -1,5 +1,9 @@
1
- export default () => ({
2
- 'items.create': () => {
1
+ export default ({ filter, action }) => {
2
+ filter('items.create', () => {
3
+ console.log('Creating Item!');
4
+ });
5
+
6
+ action('items.create', () => {
3
7
  console.log('Item created!');
4
- },
5
- });
8
+ });
9
+ };
@@ -1,7 +1,11 @@
1
1
  import { defineHook } from '@directus/extensions-sdk';
2
2
 
3
- export default defineHook(() => ({
4
- 'items.create': () => {
3
+ export default defineHook(({ filter, action }) => {
4
+ filter('items.create', () => {
5
+ console.log('Creating Item!');
6
+ });
7
+
8
+ action('items.create', () => {
5
9
  console.log('Item created!');
6
- },
7
- }));
10
+ });
11
+ });
@@ -3,9 +3,9 @@ import InterfaceComponent from './interface.vue';
3
3
  export default {
4
4
  id: 'custom',
5
5
  name: 'Custom',
6
- description: 'This is my custom interface!',
7
6
  icon: 'box',
7
+ description: 'This is my custom interface!',
8
8
  component: InterfaceComponent,
9
- types: ['string'],
10
9
  options: null,
10
+ types: ['string'],
11
11
  };
@@ -7,14 +7,16 @@ export default {
7
7
  props: {
8
8
  value: {
9
9
  type: String,
10
- required: true,
10
+ default: null,
11
11
  },
12
12
  },
13
13
  emits: ['input'],
14
- methods: {
15
- handleChange(value) {
16
- this.$emit('input', value);
17
- },
14
+ setup(props, { emit }) {
15
+ return { handleChange };
16
+
17
+ function handleChange(value) {
18
+ emit('input', value);
19
+ }
18
20
  },
19
21
  };
20
22
  </script>
@@ -4,9 +4,9 @@ import InterfaceComponent from './interface.vue';
4
4
  export default defineInterface({
5
5
  id: 'custom',
6
6
  name: 'Custom',
7
- description: 'This is my custom interface!',
8
7
  icon: 'box',
8
+ description: 'This is my custom interface!',
9
9
  component: InterfaceComponent,
10
- types: ['string'],
11
10
  options: null,
11
+ types: ['string'],
12
12
  });
@@ -9,14 +9,16 @@ export default defineComponent({
9
9
  props: {
10
10
  value: {
11
11
  type: String,
12
- required: true,
12
+ default: null,
13
13
  },
14
14
  },
15
15
  emits: ['input'],
16
- methods: {
17
- handleChange(value: string) {
18
- this.$emit('input', value);
19
- },
16
+ setup(props, { emit }) {
17
+ return { handleChange };
18
+
19
+ function handleChange(value: string): void {
20
+ emit('input', value);
21
+ }
20
22
  },
21
23
  });
22
24
  </script>