123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- 'use strict';
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
- define([], function () {
- var APISpec = function () {
- function APISpec() {
- _classCallCheck(this, APISpec);
- }
- APISpec.prototype.getAPISpec = function getAPISpec() {
- var _this = this;
- if (!this.apiSpec) {
- this.apiSpec = {
- name: 'savedPrompts API',
- events: {
- propagationInfo: {
- namespace: 'savedPrompts',
- callStack: {
- name: 'getSavedPrompts'
- },
- info: {
- supportsUndoRedo: true,
- refresh: {
- dataIfQueryChanged: true
- }
- }
- },
- actions: {
-
-
- 'save': {
- eventName: 'savedprompts:save',
- getInfo: function getInfo(args) {
- return {
- promptValueSpec: args ? args[0] : undefined
- };
- },
- getUndoActions: function getUndoActions() {
- var currentValue = _this.widgetModel.get('savedPrompts');
- return [{
- name: 'reset',
- params: [currentValue ? JSON.parse(JSON.stringify(currentValue)) : undefined, true]
- }];
- }
- },
- 'reset': {
- eventName: 'savedprompts:reset',
- getInfo: function getInfo(args) {
- return {
- promptValueSpec: args ? args[0] : undefined
- };
- },
- getUndoActions: function getUndoActions(args) {
- return [{
- name: 'reset',
- params: [args[0], true]
- }];
- },
- isTriggerEvent: function isTriggerEvent(action, undoActions, returnValue) {
- return returnValue;
- }
- }
- }
- }
- };
- }
- return this.apiSpec;
- };
- return APISpec;
- }();
- return APISpec;
- });
|