backendless 7.2.0 → 7.2.1
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/backendless.d.ts +14 -0
- package/dist/backendless.js +138 -1
- package/dist/backendless.js.map +1 -1
- package/dist/backendless.min.js +2 -2
- package/es/automations/index.js +102 -0
- package/es/index.js +8 -0
- package/es/urls.js +17 -0
- package/lib/automations/index.js +102 -0
- package/lib/index.js +8 -0
- package/lib/urls.js +17 -0
- package/package.json +1 -1
- package/src/automations/index.js +45 -0
- package/src/index.js +5 -0
- package/src/urls.js +14 -0
package/backendless.d.ts
CHANGED
|
@@ -599,6 +599,20 @@ declare module Backendless {
|
|
|
599
599
|
}
|
|
600
600
|
}
|
|
601
601
|
|
|
602
|
+
/**
|
|
603
|
+
* @public
|
|
604
|
+
* @namespace Backendless.Automations
|
|
605
|
+
*/
|
|
606
|
+
namespace Automations {
|
|
607
|
+
/**
|
|
608
|
+
* @public
|
|
609
|
+
* @type: Function
|
|
610
|
+
*/
|
|
611
|
+
|
|
612
|
+
function activateFlow(flowName: string, initialData?: object): Promise<void>
|
|
613
|
+
function activateFlowTrigger(flowName: string, triggerName: string, data?: object): Promise<void>
|
|
614
|
+
}
|
|
615
|
+
|
|
602
616
|
/**
|
|
603
617
|
* @public
|
|
604
618
|
* @namespace Backendless.UserService
|
package/dist/backendless.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* ********************************************************************************************************************
|
|
3
|
-
* Backendless SDK for JavaScript. Version: 7.2.
|
|
3
|
+
* Backendless SDK for JavaScript. Version: 7.2.1
|
|
4
4
|
*
|
|
5
5
|
* Copyright 2012-2023 BACKENDLESS.COM. All Rights Reserved.
|
|
6
6
|
*
|
|
@@ -24,6 +24,118 @@
|
|
|
24
24
|
return /******/ (() => { // webpackBootstrap
|
|
25
25
|
/******/ var __webpack_modules__ = ({
|
|
26
26
|
|
|
27
|
+
/***/ "./src/automations/index.js":
|
|
28
|
+
/*!**********************************!*\
|
|
29
|
+
!*** ./src/automations/index.js ***!
|
|
30
|
+
\**********************************/
|
|
31
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
32
|
+
|
|
33
|
+
"use strict";
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js");
|
|
37
|
+
Object.defineProperty(exports, "__esModule", ({
|
|
38
|
+
value: true
|
|
39
|
+
}));
|
|
40
|
+
exports["default"] = void 0;
|
|
41
|
+
var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"));
|
|
42
|
+
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
|
|
43
|
+
var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "./node_modules/@babel/runtime/helpers/classCallCheck.js"));
|
|
44
|
+
var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "./node_modules/@babel/runtime/helpers/createClass.js"));
|
|
45
|
+
var _utils = _interopRequireDefault(__webpack_require__(/*! ../utils */ "./src/utils.js"));
|
|
46
|
+
var Automations = /*#__PURE__*/function () {
|
|
47
|
+
function Automations(app) {
|
|
48
|
+
(0, _classCallCheck2["default"])(this, Automations);
|
|
49
|
+
this.app = app;
|
|
50
|
+
}
|
|
51
|
+
(0, _createClass2["default"])(Automations, [{
|
|
52
|
+
key: "activateFlow",
|
|
53
|
+
value: function () {
|
|
54
|
+
var _activateFlow = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(flowName, initialData) {
|
|
55
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
56
|
+
while (1) switch (_context.prev = _context.next) {
|
|
57
|
+
case 0:
|
|
58
|
+
if (!(!flowName || typeof flowName !== 'string')) {
|
|
59
|
+
_context.next = 2;
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
throw new Error('The "flowName" argument must be provided and must be a string.');
|
|
63
|
+
case 2:
|
|
64
|
+
if (!(initialData !== undefined && !_utils["default"].isObject(initialData))) {
|
|
65
|
+
_context.next = 4;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
throw new Error('The "initialData" argument must be an object with an arbitrary structure.');
|
|
69
|
+
case 4:
|
|
70
|
+
return _context.abrupt("return", this.app.request.post({
|
|
71
|
+
url: "".concat(this.app.urls.automationFlow(), "/activate-by-name"),
|
|
72
|
+
data: {
|
|
73
|
+
name: flowName,
|
|
74
|
+
initialData: initialData
|
|
75
|
+
}
|
|
76
|
+
}));
|
|
77
|
+
case 5:
|
|
78
|
+
case "end":
|
|
79
|
+
return _context.stop();
|
|
80
|
+
}
|
|
81
|
+
}, _callee, this);
|
|
82
|
+
}));
|
|
83
|
+
function activateFlow(_x, _x2) {
|
|
84
|
+
return _activateFlow.apply(this, arguments);
|
|
85
|
+
}
|
|
86
|
+
return activateFlow;
|
|
87
|
+
}()
|
|
88
|
+
}, {
|
|
89
|
+
key: "activateFlowTrigger",
|
|
90
|
+
value: function () {
|
|
91
|
+
var _activateFlowTrigger = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(flowName, triggerName, data) {
|
|
92
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
93
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
94
|
+
case 0:
|
|
95
|
+
if (!(!flowName || typeof flowName !== 'string')) {
|
|
96
|
+
_context2.next = 2;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
throw new Error('The "flowName" argument must be provided and must be a string.');
|
|
100
|
+
case 2:
|
|
101
|
+
if (!(!triggerName || typeof triggerName !== 'string')) {
|
|
102
|
+
_context2.next = 4;
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
throw new Error('The "triggerName" argument must be provided and must be a string.');
|
|
106
|
+
case 4:
|
|
107
|
+
if (!(data !== undefined && !_utils["default"].isObject(data))) {
|
|
108
|
+
_context2.next = 6;
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
throw new Error('The "data" argument must be an object with an arbitrary structure.');
|
|
112
|
+
case 6:
|
|
113
|
+
return _context2.abrupt("return", this.app.request.post({
|
|
114
|
+
url: "".concat(this.app.urls.automationFlowTrigger(), "/activate-by-name"),
|
|
115
|
+
query: {
|
|
116
|
+
flowName: flowName,
|
|
117
|
+
triggerName: triggerName
|
|
118
|
+
},
|
|
119
|
+
data: data
|
|
120
|
+
}));
|
|
121
|
+
case 7:
|
|
122
|
+
case "end":
|
|
123
|
+
return _context2.stop();
|
|
124
|
+
}
|
|
125
|
+
}, _callee2, this);
|
|
126
|
+
}));
|
|
127
|
+
function activateFlowTrigger(_x3, _x4, _x5) {
|
|
128
|
+
return _activateFlowTrigger.apply(this, arguments);
|
|
129
|
+
}
|
|
130
|
+
return activateFlowTrigger;
|
|
131
|
+
}()
|
|
132
|
+
}]);
|
|
133
|
+
return Automations;
|
|
134
|
+
}();
|
|
135
|
+
exports["default"] = Automations;
|
|
136
|
+
|
|
137
|
+
/***/ }),
|
|
138
|
+
|
|
27
139
|
/***/ "./src/bl/constants.js":
|
|
28
140
|
/*!*****************************!*\
|
|
29
141
|
!*** ./src/bl/constants.js ***!
|
|
@@ -6387,6 +6499,9 @@ var SERVICES = {
|
|
|
6387
6499
|
},
|
|
6388
6500
|
'Management': function Management() {
|
|
6389
6501
|
return (__webpack_require__(/*! ./management */ "./src/management/index.js")["default"]);
|
|
6502
|
+
},
|
|
6503
|
+
'Automations': function Automations() {
|
|
6504
|
+
return (__webpack_require__(/*! ./automations */ "./src/automations/index.js")["default"]);
|
|
6390
6505
|
}
|
|
6391
6506
|
};
|
|
6392
6507
|
var Backendless = /*#__PURE__*/function () {
|
|
@@ -6728,6 +6843,11 @@ var Backendless = /*#__PURE__*/function () {
|
|
|
6728
6843
|
get: function get() {
|
|
6729
6844
|
return this.__getService('Management');
|
|
6730
6845
|
}
|
|
6846
|
+
}, {
|
|
6847
|
+
key: "Automations",
|
|
6848
|
+
get: function get() {
|
|
6849
|
+
return this.__getService('Automations');
|
|
6850
|
+
}
|
|
6731
6851
|
|
|
6732
6852
|
///-------------- SERVICES -------------///
|
|
6733
6853
|
///-------------------------------------///
|
|
@@ -10074,6 +10194,23 @@ var Urls = /*#__PURE__*/function () {
|
|
|
10074
10194
|
return this.app.appPath;
|
|
10075
10195
|
}
|
|
10076
10196
|
|
|
10197
|
+
//automations
|
|
10198
|
+
}, {
|
|
10199
|
+
key: "automation",
|
|
10200
|
+
value: function automation() {
|
|
10201
|
+
return "".concat(this.root(), "/automation");
|
|
10202
|
+
}
|
|
10203
|
+
}, {
|
|
10204
|
+
key: "automationFlow",
|
|
10205
|
+
value: function automationFlow() {
|
|
10206
|
+
return "".concat(this.automation(), "/flow");
|
|
10207
|
+
}
|
|
10208
|
+
}, {
|
|
10209
|
+
key: "automationFlowTrigger",
|
|
10210
|
+
value: function automationFlowTrigger() {
|
|
10211
|
+
return "".concat(this.automationFlow(), "/trigger");
|
|
10212
|
+
}
|
|
10213
|
+
|
|
10077
10214
|
//bl
|
|
10078
10215
|
}, {
|
|
10079
10216
|
key: "blServices",
|