datocms-plugin-sdk 0.3.4 → 0.3.5

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.
@@ -438,7 +438,7 @@ export declare type UpdateParametersMethods = {
438
438
  * });
439
439
  *
440
440
  * await ctx.updateFieldAppearance(field.id, operations);
441
- * await ctx.notice(`Successfully edited field ${field.attributes.api_key}`);
441
+ * ctx.notice(`Successfully edited field ${field.attributes.api_key}`);
442
442
  * }
443
443
  */
444
444
  updateFieldAppearance: (fieldId: string, changes: FieldAppearanceChange[]) => Promise<void>;
@@ -438,7 +438,7 @@ export declare type UpdateParametersMethods = {
438
438
  * });
439
439
  *
440
440
  * await ctx.updateFieldAppearance(field.id, operations);
441
- * await ctx.notice(`Successfully edited field ${field.attributes.api_key}`);
441
+ * ctx.notice(`Successfully edited field ${field.attributes.api_key}`);
442
442
  * }
443
443
  */
444
444
  updateFieldAppearance: (fieldId: string, changes: FieldAppearanceChange[]) => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datocms-plugin-sdk",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "DatoCMS Plugin SDK",
5
5
  "keywords": [
6
6
  "datocms",
@@ -41,5 +41,5 @@
41
41
  "devDependencies": {
42
42
  "typedoc": "^0.22.8"
43
43
  },
44
- "gitHead": "2f0aacc7697348cbeb7799c9b0e982a79fec6200"
44
+ "gitHead": "8842270101e46f3aa736f3948306e2c73064e56e"
45
45
  }
package/types.json CHANGED
@@ -10972,7 +10972,7 @@
10972
10972
  "tags": [
10973
10973
  {
10974
10974
  "tag": "example",
10975
- "text": "\n const fields = await ctx.loadFieldsUsingPlugin();\n\n if (fields.length === 0) {\n ctx.alert('No field is using this plugin as a manual extension!');\n return;\n }\n\n for (const field of fields) {\n const { appearance } = field.attributes;\n const operations = [];\n\n if (appearance.editor === ctx.plugin.id) {\n operations.push({\n operation: 'updateEditor',\n newParameters: {\n ...appearance.parameters,\n foo: 'bar',\n },\n });\n }\n\n appearance.addons.forEach((addon, i) => {\n if (addon.id !== ctx.plugin.id) {\n return;\n }\n\n operations.push({\n operation: 'updateAddon',\n index: i,\n newParameters: { ...addon.parameters, foo: 'bar' },\n });\n });\n\n await ctx.updateFieldAppearance(field.id, operations);\n await ctx.notice(`Successfully edited field ${field.attributes.api_key}`);\n }\n"
10975
+ "text": "\n const fields = await ctx.loadFieldsUsingPlugin();\n\n if (fields.length === 0) {\n ctx.alert('No field is using this plugin as a manual extension!');\n return;\n }\n\n for (const field of fields) {\n const { appearance } = field.attributes;\n const operations = [];\n\n if (appearance.editor === ctx.plugin.id) {\n operations.push({\n operation: 'updateEditor',\n newParameters: {\n ...appearance.parameters,\n foo: 'bar',\n },\n });\n }\n\n appearance.addons.forEach((addon, i) => {\n if (addon.id !== ctx.plugin.id) {\n return;\n }\n\n operations.push({\n operation: 'updateAddon',\n index: i,\n newParameters: { ...addon.parameters, foo: 'bar' },\n });\n });\n\n await ctx.updateFieldAppearance(field.id, operations);\n ctx.notice(`Successfully edited field ${field.attributes.api_key}`);\n }\n"
10976
10976
  }
10977
10977
  ]
10978
10978
  },