datocms-plugin-sdk 0.6.15-alpha.1 → 0.6.17

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.
@@ -42,40 +42,33 @@ export declare type FullConnectParameters = {
42
42
  */
43
43
  onBoot: (ctx: OnBootCtx) => void;
44
44
  /**
45
- * This function will be called before destroying a record. You can stop the
45
+ * This function will be called before destroying records. You can stop the
46
46
  * action by returning `false`
47
47
  *
48
48
  * @tag beforeHooks
49
49
  */
50
- onBeforeItemDestroy: (item: Item, ctx: OnBootCtx) => MaybePromise<boolean>;
50
+ onBeforeItemsDestroy: (items: Item[], ctx: OnBootCtx) => MaybePromise<boolean>;
51
51
  /**
52
- * This function will be called before creating a new record. You can stop the
52
+ * This function will be called before publishing records. You can stop the
53
53
  * action by returning `false`
54
54
  *
55
55
  * @tag beforeHooks
56
56
  */
57
- onBeforeItemCreate: (payload: ItemCreateSchema, ctx: OnBootCtx) => MaybePromise<ItemCreateSchema | false>;
57
+ onBeforeItemsPublish: (items: Item[], ctx: OnBootCtx) => MaybePromise<boolean>;
58
58
  /**
59
- * This function will be called before saving a new version of a record. You
60
- * can stop the action by returning `false`
61
- *
62
- * @tag beforeHooks
63
- */
64
- onBeforeItemUpdate: (payload: ItemUpdateSchema, ctx: OnBootCtx) => MaybePromise<ItemUpdateSchema | false>;
65
- /**
66
- * This function will be called before publishing a record. You can stop the
59
+ * This function will be called before unpublishing records. You can stop the
67
60
  * action by returning `false`
68
61
  *
69
62
  * @tag beforeHooks
70
63
  */
71
- onBeforeItemPublish: (item: Item, ctx: OnBootCtx) => MaybePromise<boolean>;
64
+ onBeforeItemsUnpublish: (items: Item[], ctx: OnBootCtx) => MaybePromise<boolean>;
72
65
  /**
73
- * This function will be called before unpublishing a record. You can stop the
74
- * action by returning `false`
66
+ * This function will be called before saving a new version of a record. You
67
+ * can stop the action by returning `false`
75
68
  *
76
69
  * @tag beforeHooks
77
70
  */
78
- onBeforeItemUnpublish: (item: Item, ctx: OnBootCtx) => MaybePromise<boolean>;
71
+ onBeforeItemUpsert: (createOrUpdateItemPayload: ItemUpdateSchema | ItemCreateSchema, ctx: OnBootCtx) => MaybePromise<boolean>;
79
72
  /**
80
73
  * Use this function to declare new tabs you want to add in the top-bar of the
81
74
  * UI
@@ -1,13 +1,10 @@
1
1
  import { RenderItemFormOutletMethods } from '.';
2
- import { InitMethods, OnBootMethods, RenderPageMethods, RenderFieldExtensionMethods, RenderConfigScreenMethods, RenderManualFieldExtensionConfigScreenMethods, RenderSidebarPanelMethods, RenderModalMethods, RenderAssetSourceMethods } from './types';
2
+ import { OnBootMethods, RenderPageMethods, RenderFieldExtensionMethods, RenderConfigScreenMethods, RenderManualFieldExtensionConfigScreenMethods, RenderSidebarPanelMethods, RenderModalMethods, RenderAssetSourceMethods } from './types';
3
3
  export declare type Parent = {
4
4
  getSettings: () => Promise<{
5
5
  mode: string;
6
6
  }>;
7
7
  };
8
- export declare const isInitParent: (parent: Parent, settings: {
9
- mode: string;
10
- }) => parent is InitMethods;
11
8
  export declare const isOnBootParent: (parent: Parent, settings: {
12
9
  mode: string;
13
10
  }) => parent is OnBootMethods;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datocms-plugin-sdk",
3
- "version": "0.6.15-alpha.1",
3
+ "version": "0.6.17",
4
4
  "description": "DatoCMS Plugin SDK",
5
5
  "keywords": [
6
6
  "datocms",
@@ -43,5 +43,5 @@
43
43
  "devDependencies": {
44
44
  "typedoc": "^0.23.20"
45
45
  },
46
- "gitHead": "e68d63dc2149929bfbdfb13e8394387867a32aa7"
46
+ "gitHead": "6661d3a021dd1a6166311924818ce674af2f5c15"
47
47
  }