@kintone/rest-api-client 5.0.3 → 5.0.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.
- package/esm/package.json +13 -9
- package/esm/src/KintoneFields/exportTypes/__checks__/usecases/layout.js.map +1 -1
- package/esm/src/KintoneRequestConfigBuilder.js.map +1 -1
- package/esm/src/KintoneResponseHandler.js.map +1 -1
- package/esm/src/KintoneRestAPIClient.js.map +1 -1
- package/esm/src/client/BulkRequestClient.js.map +1 -1
- package/esm/src/client/FileClient.js.map +1 -1
- package/esm/src/client/RecordClient.js.map +1 -1
- package/esm/src/error/KintoneAbortSearchError.js.map +1 -1
- package/esm/src/error/KintoneAllRecordsError.js.map +1 -1
- package/esm/src/error/KintoneRestAPIError.js.map +1 -1
- package/esm/src/http/index.d.ts +1 -1
- package/esm/src/platform/UnsupportedPlatformError.js.map +1 -1
- package/esm/src/platform/browser.js.map +1 -1
- package/esm/src/platform/index.js.map +1 -1
- package/esm/src/platform/node.js.map +1 -1
- package/esm/tsconfig.build.esm.tsbuildinfo +1 -0
- package/lib/package.json +13 -9
- package/lib/src/KintoneFields/exportTypes/__checks__/usecases/layout.js.map +1 -1
- package/lib/src/KintoneRequestConfigBuilder.js.map +1 -1
- package/lib/src/KintoneResponseHandler.js.map +1 -1
- package/lib/src/KintoneRestAPIClient.js.map +1 -1
- package/lib/src/client/BulkRequestClient.js.map +1 -1
- package/lib/src/client/FileClient.js.map +1 -1
- package/lib/src/client/RecordClient.js.map +1 -1
- package/lib/src/error/KintoneAbortSearchError.js.map +1 -1
- package/lib/src/error/KintoneAllRecordsError.js.map +1 -1
- package/lib/src/error/KintoneRestAPIError.js.map +1 -1
- package/lib/src/http/index.d.ts +1 -1
- package/lib/src/platform/UnsupportedPlatformError.js.map +1 -1
- package/lib/src/platform/browser.js.map +1 -1
- package/lib/src/platform/index.js.map +1 -1
- package/lib/src/platform/node.js.map +1 -1
- package/lib/tsconfig.build.tsbuildinfo +1 -0
- package/lib/tsconfig.typecheck.node.tsbuildinfo +1 -0
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -0
- package/package.json +13 -9
- package/umd/KintoneRestAPIClient.js +128 -62
- package/umd/KintoneRestAPIClient.min.js +3 -3
- package/esm/src/__tests__/KintoneRequestConfigBuilder.test.d.ts +0 -1
- package/esm/src/__tests__/KintoneRequestConfigBuilder.test.js +0 -759
- package/esm/src/__tests__/KintoneRequestConfigBuilder.test.js.map +0 -1
- package/esm/src/__tests__/KintoneResponseHandler.test.d.ts +0 -1
- package/esm/src/__tests__/KintoneResponseHandler.test.js +0 -182
- package/esm/src/__tests__/KintoneResponseHandler.test.js.map +0 -1
- package/esm/src/__tests__/KintoneRestAPIClient.test.d.ts +0 -1
- package/esm/src/__tests__/KintoneRestAPIClient.test.js +0 -138
- package/esm/src/__tests__/KintoneRestAPIClient.test.js.map +0 -1
- package/esm/src/__tests__/index.browser.test.d.ts +0 -1
- package/esm/src/__tests__/index.browser.test.js +0 -15
- package/esm/src/__tests__/index.browser.test.js.map +0 -1
- package/esm/src/__tests__/index.test.d.ts +0 -1
- package/esm/src/__tests__/index.test.js +0 -15
- package/esm/src/__tests__/index.test.js.map +0 -1
- package/esm/src/__tests__/setup.d.ts +0 -1
- package/esm/src/__tests__/setup.js +0 -6
- package/esm/src/__tests__/setup.js.map +0 -1
- package/esm/src/__tests__/url.test.d.ts +0 -1
- package/esm/src/__tests__/url.test.js +0 -11
- package/esm/src/__tests__/url.test.js.map +0 -1
- package/esm/src/client/__tests__/AppClient.test.d.ts +0 -1
- package/esm/src/client/__tests__/AppClient.test.js +0 -1618
- package/esm/src/client/__tests__/AppClient.test.js.map +0 -1
- package/esm/src/client/__tests__/BulkRequestClient.test.d.ts +0 -1
- package/esm/src/client/__tests__/BulkRequestClient.test.js +0 -235
- package/esm/src/client/__tests__/BulkRequestClient.test.js.map +0 -1
- package/esm/src/client/__tests__/File.test.d.ts +0 -1
- package/esm/src/client/__tests__/File.test.js +0 -208
- package/esm/src/client/__tests__/File.test.js.map +0 -1
- package/esm/src/client/__tests__/RecordClient.test.d.ts +0 -1
- package/esm/src/client/__tests__/RecordClient.test.js +0 -1747
- package/esm/src/client/__tests__/RecordClient.test.js.map +0 -1
- package/esm/src/error/__tests__/KintoneAbortSearchError.test.d.ts +0 -1
- package/esm/src/error/__tests__/KintoneAbortSearchError.test.js +0 -9
- package/esm/src/error/__tests__/KintoneAbortSearchError.test.js.map +0 -1
- package/esm/src/error/__tests__/KintoneAllRecordsError.test.d.ts +0 -1
- package/esm/src/error/__tests__/KintoneAllRecordsError.test.js +0 -152
- package/esm/src/error/__tests__/KintoneAllRecordsError.test.js.map +0 -1
- package/esm/src/error/__tests__/KintoneRestAPIError.test.d.ts +0 -1
- package/esm/src/error/__tests__/KintoneRestAPIError.test.js +0 -82
- package/esm/src/error/__tests__/KintoneRestAPIError.test.js.map +0 -1
- package/esm/src/platform/__tests__/browser.test.d.ts +0 -4
- package/esm/src/platform/__tests__/browser.test.js +0 -109
- package/esm/src/platform/__tests__/browser.test.js.map +0 -1
- package/lib/src/__tests__/KintoneRequestConfigBuilder.test.d.ts +0 -1
- package/lib/src/__tests__/KintoneRequestConfigBuilder.test.js +0 -787
- package/lib/src/__tests__/KintoneRequestConfigBuilder.test.js.map +0 -1
- package/lib/src/__tests__/KintoneResponseHandler.test.d.ts +0 -1
- package/lib/src/__tests__/KintoneResponseHandler.test.js +0 -184
- package/lib/src/__tests__/KintoneResponseHandler.test.js.map +0 -1
- package/lib/src/__tests__/KintoneRestAPIClient.test.d.ts +0 -1
- package/lib/src/__tests__/KintoneRestAPIClient.test.js +0 -163
- package/lib/src/__tests__/KintoneRestAPIClient.test.js.map +0 -1
- package/lib/src/__tests__/index.browser.test.d.ts +0 -1
- package/lib/src/__tests__/index.browser.test.js +0 -40
- package/lib/src/__tests__/index.browser.test.js.map +0 -1
- package/lib/src/__tests__/index.test.d.ts +0 -1
- package/lib/src/__tests__/index.test.js +0 -40
- package/lib/src/__tests__/index.test.js.map +0 -1
- package/lib/src/__tests__/setup.d.ts +0 -1
- package/lib/src/__tests__/setup.js +0 -31
- package/lib/src/__tests__/setup.js.map +0 -1
- package/lib/src/__tests__/url.test.d.ts +0 -1
- package/lib/src/__tests__/url.test.js +0 -13
- package/lib/src/__tests__/url.test.js.map +0 -1
- package/lib/src/client/__tests__/AppClient.test.d.ts +0 -1
- package/lib/src/client/__tests__/AppClient.test.js +0 -1620
- package/lib/src/client/__tests__/AppClient.test.js.map +0 -1
- package/lib/src/client/__tests__/BulkRequestClient.test.d.ts +0 -1
- package/lib/src/client/__tests__/BulkRequestClient.test.js +0 -237
- package/lib/src/client/__tests__/BulkRequestClient.test.js.map +0 -1
- package/lib/src/client/__tests__/File.test.d.ts +0 -1
- package/lib/src/client/__tests__/File.test.js +0 -236
- package/lib/src/client/__tests__/File.test.js.map +0 -1
- package/lib/src/client/__tests__/RecordClient.test.d.ts +0 -1
- package/lib/src/client/__tests__/RecordClient.test.js +0 -1749
- package/lib/src/client/__tests__/RecordClient.test.js.map +0 -1
- package/lib/src/error/__tests__/KintoneAbortSearchError.test.d.ts +0 -1
- package/lib/src/error/__tests__/KintoneAbortSearchError.test.js +0 -11
- package/lib/src/error/__tests__/KintoneAbortSearchError.test.js.map +0 -1
- package/lib/src/error/__tests__/KintoneAllRecordsError.test.d.ts +0 -1
- package/lib/src/error/__tests__/KintoneAllRecordsError.test.js +0 -154
- package/lib/src/error/__tests__/KintoneAllRecordsError.test.js.map +0 -1
- package/lib/src/error/__tests__/KintoneRestAPIError.test.d.ts +0 -1
- package/lib/src/error/__tests__/KintoneRestAPIError.test.js +0 -84
- package/lib/src/error/__tests__/KintoneRestAPIError.test.js.map +0 -1
- package/lib/src/platform/__tests__/browser.test.d.ts +0 -4
- package/lib/src/platform/__tests__/browser.test.js +0 -111
- package/lib/src/platform/__tests__/browser.test.js.map +0 -1
- package/lib/tsconfig.tsbuildinfo +0 -1
|
@@ -1,1620 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
-
var MockClient_1 = require("../../http/MockClient");
|
|
51
|
-
var AppClient_1 = require("../AppClient");
|
|
52
|
-
var KintoneRequestConfigBuilder_1 = require("../../KintoneRequestConfigBuilder");
|
|
53
|
-
var APP_ID = 1;
|
|
54
|
-
var REVISION = 5;
|
|
55
|
-
var RECORD_ID = 3;
|
|
56
|
-
var properties = {
|
|
57
|
-
fieldCode: {
|
|
58
|
-
type: "SINGLE_LINE_TEXT",
|
|
59
|
-
code: "fieldCode",
|
|
60
|
-
label: "Text Field",
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
var layout = [
|
|
64
|
-
{
|
|
65
|
-
type: "ROW",
|
|
66
|
-
fields: [
|
|
67
|
-
{
|
|
68
|
-
type: "SINGLE_LINE_TEXT",
|
|
69
|
-
code: "fieldCode1",
|
|
70
|
-
size: { width: "100" },
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
type: "LABEL",
|
|
74
|
-
label: "label1",
|
|
75
|
-
size: { width: "100" },
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
type: "SPACER",
|
|
79
|
-
elementId: "space",
|
|
80
|
-
size: { width: "100", height: "50" },
|
|
81
|
-
},
|
|
82
|
-
],
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
type: "SUBTABLE",
|
|
86
|
-
code: "tableFieldCode",
|
|
87
|
-
fields: [
|
|
88
|
-
{
|
|
89
|
-
type: "MULTI_LINE_TEXT",
|
|
90
|
-
code: "fieldCode2",
|
|
91
|
-
size: { width: "150", innerHeight: "200" },
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
type: "GROUP",
|
|
97
|
-
code: "fieldCode3",
|
|
98
|
-
layout: [
|
|
99
|
-
{
|
|
100
|
-
type: "ROW",
|
|
101
|
-
fields: [
|
|
102
|
-
{
|
|
103
|
-
type: "NUMBER",
|
|
104
|
-
code: "fieldCode3_1",
|
|
105
|
-
size: {
|
|
106
|
-
width: 200,
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
],
|
|
110
|
-
},
|
|
111
|
-
],
|
|
112
|
-
},
|
|
113
|
-
];
|
|
114
|
-
var views = {
|
|
115
|
-
view1: {
|
|
116
|
-
type: "LIST",
|
|
117
|
-
index: 0,
|
|
118
|
-
name: "view1",
|
|
119
|
-
fields: ["field"],
|
|
120
|
-
filterCond: 'field = "foo"',
|
|
121
|
-
sort: "sortField desc",
|
|
122
|
-
},
|
|
123
|
-
view2: {
|
|
124
|
-
type: "CALENDAR",
|
|
125
|
-
index: 1,
|
|
126
|
-
name: "view2",
|
|
127
|
-
date: "dateField",
|
|
128
|
-
title: "titleField",
|
|
129
|
-
filterCond: 'field = "bar"',
|
|
130
|
-
sort: "sortField asc",
|
|
131
|
-
},
|
|
132
|
-
view3: {
|
|
133
|
-
type: "CUSTOM",
|
|
134
|
-
index: 2,
|
|
135
|
-
name: "view3",
|
|
136
|
-
html: "<div>Hello!</div>",
|
|
137
|
-
pager: true,
|
|
138
|
-
device: "DESKTOP",
|
|
139
|
-
},
|
|
140
|
-
};
|
|
141
|
-
var states = {
|
|
142
|
-
status1: {
|
|
143
|
-
name: "status1",
|
|
144
|
-
index: 0,
|
|
145
|
-
assignee: {
|
|
146
|
-
type: "ONE",
|
|
147
|
-
entities: [
|
|
148
|
-
{ entity: { type: "FIELD_ENTITY", code: "creator" } },
|
|
149
|
-
],
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
status2: {
|
|
153
|
-
name: "status2",
|
|
154
|
-
index: 1,
|
|
155
|
-
assignee: {
|
|
156
|
-
type: "ANY",
|
|
157
|
-
entities: [{ entity: { type: "CREATOR" } }],
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
status3: {
|
|
161
|
-
name: "status3",
|
|
162
|
-
index: 2,
|
|
163
|
-
assignee: {
|
|
164
|
-
type: "ALL",
|
|
165
|
-
entities: [
|
|
166
|
-
{ entity: { type: "USER", code: "user1" } },
|
|
167
|
-
{ entity: { type: "USER", code: "user2" } },
|
|
168
|
-
],
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
};
|
|
172
|
-
var actions = [
|
|
173
|
-
{ name: "action1to2", from: "status1", to: "status2" },
|
|
174
|
-
{
|
|
175
|
-
name: "action2to3",
|
|
176
|
-
from: "status2",
|
|
177
|
-
to: "status3",
|
|
178
|
-
filterCond: 'field = "foo"',
|
|
179
|
-
},
|
|
180
|
-
];
|
|
181
|
-
describe("AppClient", function () {
|
|
182
|
-
var mockClient;
|
|
183
|
-
var appClient;
|
|
184
|
-
beforeEach(function () {
|
|
185
|
-
var requestConfigBuilder = new KintoneRequestConfigBuilder_1.KintoneRequestConfigBuilder({
|
|
186
|
-
baseUrl: "https://example.cybozu.com",
|
|
187
|
-
auth: { type: "apiToken", apiToken: "foo" },
|
|
188
|
-
});
|
|
189
|
-
mockClient = (0, MockClient_1.buildMockClient)(requestConfigBuilder);
|
|
190
|
-
appClient = new AppClient_1.AppClient(mockClient);
|
|
191
|
-
});
|
|
192
|
-
describe("getFormFields", function () {
|
|
193
|
-
var lang = "default";
|
|
194
|
-
var params = { app: APP_ID, lang: lang };
|
|
195
|
-
describe("without preview", function () {
|
|
196
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
197
|
-
return __generator(this, function (_a) {
|
|
198
|
-
switch (_a.label) {
|
|
199
|
-
case 0: return [4 /*yield*/, appClient.getFormFields(params)];
|
|
200
|
-
case 1:
|
|
201
|
-
_a.sent();
|
|
202
|
-
return [2 /*return*/];
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
}); });
|
|
206
|
-
it("should pass the path to the http client", function () {
|
|
207
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/app/form/fields.json");
|
|
208
|
-
});
|
|
209
|
-
it("should send a get request", function () {
|
|
210
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
211
|
-
});
|
|
212
|
-
it("should pass app and lang as a param to the http client", function () {
|
|
213
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
214
|
-
});
|
|
215
|
-
});
|
|
216
|
-
describe("preview: true", function () {
|
|
217
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
218
|
-
return __generator(this, function (_a) {
|
|
219
|
-
switch (_a.label) {
|
|
220
|
-
case 0: return [4 /*yield*/, appClient.getFormFields(__assign(__assign({}, params), { preview: true }))];
|
|
221
|
-
case 1:
|
|
222
|
-
_a.sent();
|
|
223
|
-
return [2 /*return*/];
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
}); });
|
|
227
|
-
it("should pass the path to the http client", function () {
|
|
228
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/form/fields.json");
|
|
229
|
-
});
|
|
230
|
-
it("should send a get request", function () {
|
|
231
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
232
|
-
});
|
|
233
|
-
it("should pass app and lang as a param to the http client", function () {
|
|
234
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
235
|
-
});
|
|
236
|
-
});
|
|
237
|
-
});
|
|
238
|
-
describe("addFormFields", function () {
|
|
239
|
-
var params = { app: APP_ID, properties: properties, revision: REVISION };
|
|
240
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
241
|
-
return __generator(this, function (_a) {
|
|
242
|
-
switch (_a.label) {
|
|
243
|
-
case 0: return [4 /*yield*/, appClient.addFormFields(params)];
|
|
244
|
-
case 1:
|
|
245
|
-
_a.sent();
|
|
246
|
-
return [2 /*return*/];
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
}); });
|
|
250
|
-
it("should pass the path to the http client", function () {
|
|
251
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/form/fields.json");
|
|
252
|
-
});
|
|
253
|
-
it("should send a post request", function () {
|
|
254
|
-
expect(mockClient.getLogs()[0].method).toBe("post");
|
|
255
|
-
});
|
|
256
|
-
it("should pass app, properties and revision as a param to the http client", function () {
|
|
257
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
258
|
-
});
|
|
259
|
-
});
|
|
260
|
-
describe("updateFormFields", function () {
|
|
261
|
-
var params = { app: APP_ID, properties: properties, revision: REVISION };
|
|
262
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
263
|
-
return __generator(this, function (_a) {
|
|
264
|
-
switch (_a.label) {
|
|
265
|
-
case 0: return [4 /*yield*/, appClient.updateFormFields(params)];
|
|
266
|
-
case 1:
|
|
267
|
-
_a.sent();
|
|
268
|
-
return [2 /*return*/];
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
|
-
}); });
|
|
272
|
-
it("should pass the path to the http client", function () {
|
|
273
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/form/fields.json");
|
|
274
|
-
});
|
|
275
|
-
it("should send a put request", function () {
|
|
276
|
-
expect(mockClient.getLogs()[0].method).toBe("put");
|
|
277
|
-
});
|
|
278
|
-
it("should pass app, properties and revision to the http client", function () {
|
|
279
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
280
|
-
});
|
|
281
|
-
});
|
|
282
|
-
describe("deleteFormFields", function () {
|
|
283
|
-
var fields = ["fieldCode1", "fieldCode2"];
|
|
284
|
-
var params = { app: APP_ID, fields: fields, revision: REVISION };
|
|
285
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
286
|
-
return __generator(this, function (_a) {
|
|
287
|
-
switch (_a.label) {
|
|
288
|
-
case 0: return [4 /*yield*/, appClient.deleteFormFields(params)];
|
|
289
|
-
case 1:
|
|
290
|
-
_a.sent();
|
|
291
|
-
return [2 /*return*/];
|
|
292
|
-
}
|
|
293
|
-
});
|
|
294
|
-
}); });
|
|
295
|
-
it("should pass the path to the http client", function () {
|
|
296
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/form/fields.json");
|
|
297
|
-
});
|
|
298
|
-
it("should send a delete request", function () {
|
|
299
|
-
expect(mockClient.getLogs()[0].method).toBe("delete");
|
|
300
|
-
});
|
|
301
|
-
it("should pass app, fields, and revision to the http client", function () {
|
|
302
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
303
|
-
});
|
|
304
|
-
});
|
|
305
|
-
describe("getFormLayout", function () {
|
|
306
|
-
var params = { app: APP_ID };
|
|
307
|
-
describe("without preview", function () {
|
|
308
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
309
|
-
return __generator(this, function (_a) {
|
|
310
|
-
switch (_a.label) {
|
|
311
|
-
case 0: return [4 /*yield*/, appClient.getFormLayout(params)];
|
|
312
|
-
case 1:
|
|
313
|
-
_a.sent();
|
|
314
|
-
return [2 /*return*/];
|
|
315
|
-
}
|
|
316
|
-
});
|
|
317
|
-
}); });
|
|
318
|
-
it("should pass the path to the http client", function () {
|
|
319
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/app/form/layout.json");
|
|
320
|
-
});
|
|
321
|
-
it("should send a get request", function () {
|
|
322
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
323
|
-
});
|
|
324
|
-
it("should pass app as a param to the http client", function () {
|
|
325
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
326
|
-
});
|
|
327
|
-
});
|
|
328
|
-
describe("preview: true", function () {
|
|
329
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
330
|
-
return __generator(this, function (_a) {
|
|
331
|
-
switch (_a.label) {
|
|
332
|
-
case 0: return [4 /*yield*/, appClient.getFormLayout(__assign(__assign({}, params), { preview: true }))];
|
|
333
|
-
case 1:
|
|
334
|
-
_a.sent();
|
|
335
|
-
return [2 /*return*/];
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
}); });
|
|
339
|
-
it("should pass the path to the http client", function () {
|
|
340
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/form/layout.json");
|
|
341
|
-
});
|
|
342
|
-
it("should send a get request", function () {
|
|
343
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
344
|
-
});
|
|
345
|
-
it("should pass app as a param to the http client", function () {
|
|
346
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
347
|
-
});
|
|
348
|
-
});
|
|
349
|
-
});
|
|
350
|
-
describe("updateFormLayout", function () {
|
|
351
|
-
var params = { app: APP_ID, layout: layout, revision: REVISION };
|
|
352
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
353
|
-
return __generator(this, function (_a) {
|
|
354
|
-
switch (_a.label) {
|
|
355
|
-
case 0: return [4 /*yield*/, appClient.updateFormLayout(params)];
|
|
356
|
-
case 1:
|
|
357
|
-
_a.sent();
|
|
358
|
-
return [2 /*return*/];
|
|
359
|
-
}
|
|
360
|
-
});
|
|
361
|
-
}); });
|
|
362
|
-
it("should pass the path to the http client", function () {
|
|
363
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/form/layout.json");
|
|
364
|
-
});
|
|
365
|
-
it("should send a put request", function () {
|
|
366
|
-
expect(mockClient.getLogs()[0].method).toBe("put");
|
|
367
|
-
});
|
|
368
|
-
it("should pass app, layout and revision to the http client", function () {
|
|
369
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
370
|
-
});
|
|
371
|
-
});
|
|
372
|
-
describe("getViews", function () {
|
|
373
|
-
var lang = "default";
|
|
374
|
-
var params = { app: APP_ID, lang: lang };
|
|
375
|
-
describe("without preview", function () {
|
|
376
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
377
|
-
return __generator(this, function (_a) {
|
|
378
|
-
switch (_a.label) {
|
|
379
|
-
case 0: return [4 /*yield*/, appClient.getViews(params)];
|
|
380
|
-
case 1:
|
|
381
|
-
_a.sent();
|
|
382
|
-
return [2 /*return*/];
|
|
383
|
-
}
|
|
384
|
-
});
|
|
385
|
-
}); });
|
|
386
|
-
it("should pass the path to the http client", function () {
|
|
387
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/app/views.json");
|
|
388
|
-
});
|
|
389
|
-
it("should send a get request", function () {
|
|
390
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
391
|
-
});
|
|
392
|
-
it("should pass app and lang as a param to the http client", function () {
|
|
393
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
394
|
-
});
|
|
395
|
-
});
|
|
396
|
-
describe("preview: true", function () {
|
|
397
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
398
|
-
return __generator(this, function (_a) {
|
|
399
|
-
switch (_a.label) {
|
|
400
|
-
case 0: return [4 /*yield*/, appClient.getViews(__assign(__assign({}, params), { preview: true }))];
|
|
401
|
-
case 1:
|
|
402
|
-
_a.sent();
|
|
403
|
-
return [2 /*return*/];
|
|
404
|
-
}
|
|
405
|
-
});
|
|
406
|
-
}); });
|
|
407
|
-
it("should pass the path to the http client", function () {
|
|
408
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/views.json");
|
|
409
|
-
});
|
|
410
|
-
it("should send a get request", function () {
|
|
411
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
412
|
-
});
|
|
413
|
-
it("should pass app and lang as a param to the http client", function () {
|
|
414
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
415
|
-
});
|
|
416
|
-
});
|
|
417
|
-
});
|
|
418
|
-
describe("updateViews", function () {
|
|
419
|
-
var params = { app: APP_ID, views: views, revision: REVISION };
|
|
420
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
421
|
-
return __generator(this, function (_a) {
|
|
422
|
-
switch (_a.label) {
|
|
423
|
-
case 0: return [4 /*yield*/, appClient.updateViews(params)];
|
|
424
|
-
case 1:
|
|
425
|
-
_a.sent();
|
|
426
|
-
return [2 /*return*/];
|
|
427
|
-
}
|
|
428
|
-
});
|
|
429
|
-
}); });
|
|
430
|
-
it("should pass the path to the http client", function () {
|
|
431
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/views.json");
|
|
432
|
-
});
|
|
433
|
-
it("should send a put request", function () {
|
|
434
|
-
expect(mockClient.getLogs()[0].method).toBe("put");
|
|
435
|
-
});
|
|
436
|
-
it("should pass app, views and revision to the http client", function () {
|
|
437
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
438
|
-
});
|
|
439
|
-
});
|
|
440
|
-
describe("getApp", function () {
|
|
441
|
-
var params = {
|
|
442
|
-
id: APP_ID,
|
|
443
|
-
};
|
|
444
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
445
|
-
return __generator(this, function (_a) {
|
|
446
|
-
switch (_a.label) {
|
|
447
|
-
case 0: return [4 /*yield*/, appClient.getApp(params)];
|
|
448
|
-
case 1:
|
|
449
|
-
_a.sent();
|
|
450
|
-
return [2 /*return*/];
|
|
451
|
-
}
|
|
452
|
-
});
|
|
453
|
-
}); });
|
|
454
|
-
it("should pass the path to the http client", function () {
|
|
455
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/app.json");
|
|
456
|
-
});
|
|
457
|
-
it("should send a get request", function () {
|
|
458
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
459
|
-
});
|
|
460
|
-
it("should pass id as a param to the http client", function () {
|
|
461
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
462
|
-
});
|
|
463
|
-
});
|
|
464
|
-
describe("getApps", function () {
|
|
465
|
-
var params = {
|
|
466
|
-
ids: [APP_ID],
|
|
467
|
-
codes: ["APP"],
|
|
468
|
-
name: "app",
|
|
469
|
-
spaceIds: [1, 2],
|
|
470
|
-
limit: 100,
|
|
471
|
-
offset: 30,
|
|
472
|
-
};
|
|
473
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
474
|
-
return __generator(this, function (_a) {
|
|
475
|
-
switch (_a.label) {
|
|
476
|
-
case 0: return [4 /*yield*/, appClient.getApps(params)];
|
|
477
|
-
case 1:
|
|
478
|
-
_a.sent();
|
|
479
|
-
return [2 /*return*/];
|
|
480
|
-
}
|
|
481
|
-
});
|
|
482
|
-
}); });
|
|
483
|
-
it("should pass the path to the http client", function () {
|
|
484
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/apps.json");
|
|
485
|
-
});
|
|
486
|
-
it("should send a get request", function () {
|
|
487
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
488
|
-
});
|
|
489
|
-
it("should pass ids, codes, name, spaceIds, limit, and offset as a param to the http client", function () {
|
|
490
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
491
|
-
});
|
|
492
|
-
});
|
|
493
|
-
describe("addApp", function () {
|
|
494
|
-
describe("without space", function () {
|
|
495
|
-
var params = {
|
|
496
|
-
name: "app",
|
|
497
|
-
};
|
|
498
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
499
|
-
return __generator(this, function (_a) {
|
|
500
|
-
switch (_a.label) {
|
|
501
|
-
case 0: return [4 /*yield*/, appClient.addApp(params)];
|
|
502
|
-
case 1:
|
|
503
|
-
_a.sent();
|
|
504
|
-
return [2 /*return*/];
|
|
505
|
-
}
|
|
506
|
-
});
|
|
507
|
-
}); });
|
|
508
|
-
it("should pass the path to the http client", function () {
|
|
509
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app.json");
|
|
510
|
-
});
|
|
511
|
-
it("should send a post request", function () {
|
|
512
|
-
expect(mockClient.getLogs()[0].method).toBe("post");
|
|
513
|
-
});
|
|
514
|
-
it("should pass name, space, and thread as a param to the http client", function () {
|
|
515
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
516
|
-
});
|
|
517
|
-
});
|
|
518
|
-
describe("with space", function () {
|
|
519
|
-
var params = {
|
|
520
|
-
name: "app",
|
|
521
|
-
space: 10,
|
|
522
|
-
};
|
|
523
|
-
var defaultThread = 20;
|
|
524
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
525
|
-
return __generator(this, function (_a) {
|
|
526
|
-
switch (_a.label) {
|
|
527
|
-
case 0:
|
|
528
|
-
mockClient.mockResponse({ defaultThread: defaultThread });
|
|
529
|
-
return [4 /*yield*/, appClient.addApp(params)];
|
|
530
|
-
case 1:
|
|
531
|
-
_a.sent();
|
|
532
|
-
return [2 /*return*/];
|
|
533
|
-
}
|
|
534
|
-
});
|
|
535
|
-
}); });
|
|
536
|
-
it("should fetch the default thread of the space", function () {
|
|
537
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/space.json");
|
|
538
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
539
|
-
expect(mockClient.getLogs()[0].params).toEqual({ id: params.space });
|
|
540
|
-
});
|
|
541
|
-
it("should add new app into the default thread", function () {
|
|
542
|
-
expect(mockClient.getLogs()[1].path).toBe("/k/v1/preview/app.json");
|
|
543
|
-
expect(mockClient.getLogs()[1].method).toBe("post");
|
|
544
|
-
expect(mockClient.getLogs()[1].params).toEqual(__assign(__assign({}, params), { thread: defaultThread }));
|
|
545
|
-
});
|
|
546
|
-
});
|
|
547
|
-
});
|
|
548
|
-
describe("getProcessManagement", function () {
|
|
549
|
-
var lang = "default";
|
|
550
|
-
var params = { app: APP_ID, lang: lang };
|
|
551
|
-
describe("without preview", function () {
|
|
552
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
553
|
-
return __generator(this, function (_a) {
|
|
554
|
-
switch (_a.label) {
|
|
555
|
-
case 0: return [4 /*yield*/, appClient.getProcessManagement(params)];
|
|
556
|
-
case 1:
|
|
557
|
-
_a.sent();
|
|
558
|
-
return [2 /*return*/];
|
|
559
|
-
}
|
|
560
|
-
});
|
|
561
|
-
}); });
|
|
562
|
-
it("should pass the path to the http client", function () {
|
|
563
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/app/status.json");
|
|
564
|
-
});
|
|
565
|
-
it("should send a get request", function () {
|
|
566
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
567
|
-
});
|
|
568
|
-
it("should pass app and lang to the http client", function () {
|
|
569
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
570
|
-
});
|
|
571
|
-
});
|
|
572
|
-
describe("preview: true", function () {
|
|
573
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
574
|
-
return __generator(this, function (_a) {
|
|
575
|
-
switch (_a.label) {
|
|
576
|
-
case 0: return [4 /*yield*/, appClient.getProcessManagement(__assign(__assign({}, params), { preview: true }))];
|
|
577
|
-
case 1:
|
|
578
|
-
_a.sent();
|
|
579
|
-
return [2 /*return*/];
|
|
580
|
-
}
|
|
581
|
-
});
|
|
582
|
-
}); });
|
|
583
|
-
it("should pass the path to the http client", function () {
|
|
584
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/status.json");
|
|
585
|
-
});
|
|
586
|
-
it("should send a get request", function () {
|
|
587
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
588
|
-
});
|
|
589
|
-
it("should pass app and lang to the http client", function () {
|
|
590
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
591
|
-
});
|
|
592
|
-
});
|
|
593
|
-
});
|
|
594
|
-
describe("updateProcessManagement", function () {
|
|
595
|
-
var params = {
|
|
596
|
-
app: APP_ID,
|
|
597
|
-
revision: REVISION,
|
|
598
|
-
enable: true,
|
|
599
|
-
states: states,
|
|
600
|
-
actions: actions,
|
|
601
|
-
};
|
|
602
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
603
|
-
return __generator(this, function (_a) {
|
|
604
|
-
switch (_a.label) {
|
|
605
|
-
case 0: return [4 /*yield*/, appClient.updateProcessManagement(params)];
|
|
606
|
-
case 1:
|
|
607
|
-
_a.sent();
|
|
608
|
-
return [2 /*return*/];
|
|
609
|
-
}
|
|
610
|
-
});
|
|
611
|
-
}); });
|
|
612
|
-
it("should pass the path to the http client", function () {
|
|
613
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/status.json");
|
|
614
|
-
});
|
|
615
|
-
it("should send a put request", function () {
|
|
616
|
-
expect(mockClient.getLogs()[0].method).toBe("put");
|
|
617
|
-
});
|
|
618
|
-
it("should pass app, states, actions and revision to the http client", function () {
|
|
619
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
620
|
-
});
|
|
621
|
-
});
|
|
622
|
-
describe("getAppSettings", function () {
|
|
623
|
-
var lang = "default";
|
|
624
|
-
var params = { app: APP_ID, lang: lang };
|
|
625
|
-
describe("without preview", function () {
|
|
626
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
627
|
-
return __generator(this, function (_a) {
|
|
628
|
-
switch (_a.label) {
|
|
629
|
-
case 0: return [4 /*yield*/, appClient.getAppSettings(params)];
|
|
630
|
-
case 1:
|
|
631
|
-
_a.sent();
|
|
632
|
-
return [2 /*return*/];
|
|
633
|
-
}
|
|
634
|
-
});
|
|
635
|
-
}); });
|
|
636
|
-
it("should pass the path to the http client", function () {
|
|
637
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/app/settings.json");
|
|
638
|
-
});
|
|
639
|
-
it("should send a get request", function () {
|
|
640
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
641
|
-
});
|
|
642
|
-
it("should pass app and lang to the http client", function () {
|
|
643
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
644
|
-
});
|
|
645
|
-
});
|
|
646
|
-
describe("preview: true", function () {
|
|
647
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
648
|
-
return __generator(this, function (_a) {
|
|
649
|
-
switch (_a.label) {
|
|
650
|
-
case 0: return [4 /*yield*/, appClient.getAppSettings(__assign(__assign({}, params), { preview: true }))];
|
|
651
|
-
case 1:
|
|
652
|
-
_a.sent();
|
|
653
|
-
return [2 /*return*/];
|
|
654
|
-
}
|
|
655
|
-
});
|
|
656
|
-
}); });
|
|
657
|
-
it("should pass the path to the http client", function () {
|
|
658
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/settings.json");
|
|
659
|
-
});
|
|
660
|
-
it("should send a get request", function () {
|
|
661
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
662
|
-
});
|
|
663
|
-
it("should pass app and lang to the http client", function () {
|
|
664
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
665
|
-
});
|
|
666
|
-
});
|
|
667
|
-
});
|
|
668
|
-
describe("updateAppSettings", function () {
|
|
669
|
-
var params = {
|
|
670
|
-
app: APP_ID,
|
|
671
|
-
revision: REVISION,
|
|
672
|
-
name: "test app",
|
|
673
|
-
description: "<div>Description</div>",
|
|
674
|
-
icon: {
|
|
675
|
-
type: "FILE",
|
|
676
|
-
file: {
|
|
677
|
-
fileKey: "file key",
|
|
678
|
-
},
|
|
679
|
-
},
|
|
680
|
-
theme: "WHITE",
|
|
681
|
-
};
|
|
682
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
683
|
-
return __generator(this, function (_a) {
|
|
684
|
-
switch (_a.label) {
|
|
685
|
-
case 0: return [4 /*yield*/, appClient.updateAppSettings(params)];
|
|
686
|
-
case 1:
|
|
687
|
-
_a.sent();
|
|
688
|
-
return [2 /*return*/];
|
|
689
|
-
}
|
|
690
|
-
});
|
|
691
|
-
}); });
|
|
692
|
-
it("should pass the path to the http client", function () {
|
|
693
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/settings.json");
|
|
694
|
-
});
|
|
695
|
-
it("should send a put request", function () {
|
|
696
|
-
expect(mockClient.getLogs()[0].method).toBe("put");
|
|
697
|
-
});
|
|
698
|
-
it("should pass app, name, description, icon, theme and revision to the http client", function () {
|
|
699
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
700
|
-
});
|
|
701
|
-
});
|
|
702
|
-
describe("getDeployStatus", function () {
|
|
703
|
-
var params = {
|
|
704
|
-
apps: [APP_ID],
|
|
705
|
-
};
|
|
706
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
707
|
-
return __generator(this, function (_a) {
|
|
708
|
-
switch (_a.label) {
|
|
709
|
-
case 0: return [4 /*yield*/, appClient.getDeployStatus(params)];
|
|
710
|
-
case 1:
|
|
711
|
-
_a.sent();
|
|
712
|
-
return [2 /*return*/];
|
|
713
|
-
}
|
|
714
|
-
});
|
|
715
|
-
}); });
|
|
716
|
-
it("should pass the path to the http client", function () {
|
|
717
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/deploy.json");
|
|
718
|
-
});
|
|
719
|
-
it("should send a get request", function () {
|
|
720
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
721
|
-
});
|
|
722
|
-
it("should pass apps as a param to the http client", function () {
|
|
723
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
724
|
-
});
|
|
725
|
-
});
|
|
726
|
-
describe("deployApp", function () {
|
|
727
|
-
var params = {
|
|
728
|
-
apps: [{ app: APP_ID, revision: REVISION }],
|
|
729
|
-
revert: true,
|
|
730
|
-
};
|
|
731
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
732
|
-
return __generator(this, function (_a) {
|
|
733
|
-
switch (_a.label) {
|
|
734
|
-
case 0: return [4 /*yield*/, appClient.deployApp(params)];
|
|
735
|
-
case 1:
|
|
736
|
-
_a.sent();
|
|
737
|
-
return [2 /*return*/];
|
|
738
|
-
}
|
|
739
|
-
});
|
|
740
|
-
}); });
|
|
741
|
-
it("should pass the path to the http client", function () {
|
|
742
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/deploy.json");
|
|
743
|
-
});
|
|
744
|
-
it("should send a post request", function () {
|
|
745
|
-
expect(mockClient.getLogs()[0].method).toBe("post");
|
|
746
|
-
});
|
|
747
|
-
it("should pass apps and revert as a param to the http client", function () {
|
|
748
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
749
|
-
});
|
|
750
|
-
});
|
|
751
|
-
describe("getFieldAcl", function () {
|
|
752
|
-
var params = {
|
|
753
|
-
app: APP_ID,
|
|
754
|
-
};
|
|
755
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
756
|
-
return __generator(this, function (_a) {
|
|
757
|
-
switch (_a.label) {
|
|
758
|
-
case 0: return [4 /*yield*/, appClient.getFieldAcl(params)];
|
|
759
|
-
case 1:
|
|
760
|
-
_a.sent();
|
|
761
|
-
return [2 /*return*/];
|
|
762
|
-
}
|
|
763
|
-
});
|
|
764
|
-
}); });
|
|
765
|
-
it("should pass the path to the http client", function () {
|
|
766
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/field/acl.json");
|
|
767
|
-
});
|
|
768
|
-
it("should send a get request", function () {
|
|
769
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
770
|
-
});
|
|
771
|
-
it("should pass app as a param to the http client", function () {
|
|
772
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
773
|
-
});
|
|
774
|
-
});
|
|
775
|
-
describe("updateFieldAcl", function () {
|
|
776
|
-
var params = {
|
|
777
|
-
app: APP_ID,
|
|
778
|
-
rights: [
|
|
779
|
-
{
|
|
780
|
-
code: "foo",
|
|
781
|
-
entities: [
|
|
782
|
-
{
|
|
783
|
-
accessibility: "READ",
|
|
784
|
-
entity: {
|
|
785
|
-
code: "bar",
|
|
786
|
-
type: "USER",
|
|
787
|
-
},
|
|
788
|
-
},
|
|
789
|
-
],
|
|
790
|
-
},
|
|
791
|
-
],
|
|
792
|
-
};
|
|
793
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
794
|
-
return __generator(this, function (_a) {
|
|
795
|
-
switch (_a.label) {
|
|
796
|
-
case 0: return [4 /*yield*/, appClient.updateFieldAcl(params)];
|
|
797
|
-
case 1:
|
|
798
|
-
_a.sent();
|
|
799
|
-
return [2 /*return*/];
|
|
800
|
-
}
|
|
801
|
-
});
|
|
802
|
-
}); });
|
|
803
|
-
it("should pass the path to the http client", function () {
|
|
804
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/field/acl.json");
|
|
805
|
-
});
|
|
806
|
-
it("should send a put request", function () {
|
|
807
|
-
expect(mockClient.getLogs()[0].method).toBe("put");
|
|
808
|
-
});
|
|
809
|
-
it("should pass app and rights as a param to the http client", function () {
|
|
810
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
811
|
-
});
|
|
812
|
-
});
|
|
813
|
-
describe("getRecordAcl", function () {
|
|
814
|
-
var lang = "default";
|
|
815
|
-
var params = {
|
|
816
|
-
app: APP_ID,
|
|
817
|
-
lang: lang,
|
|
818
|
-
};
|
|
819
|
-
describe("without preview", function () {
|
|
820
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
821
|
-
return __generator(this, function (_a) {
|
|
822
|
-
switch (_a.label) {
|
|
823
|
-
case 0: return [4 /*yield*/, appClient.getRecordAcl(params)];
|
|
824
|
-
case 1:
|
|
825
|
-
_a.sent();
|
|
826
|
-
return [2 /*return*/];
|
|
827
|
-
}
|
|
828
|
-
});
|
|
829
|
-
}); });
|
|
830
|
-
it("should pass the path to the http client", function () {
|
|
831
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/record/acl.json");
|
|
832
|
-
});
|
|
833
|
-
it("should send a get request", function () {
|
|
834
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
835
|
-
});
|
|
836
|
-
it("should pass app and lang as a param to the http client", function () {
|
|
837
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
838
|
-
});
|
|
839
|
-
});
|
|
840
|
-
describe("preview: true", function () {
|
|
841
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
842
|
-
return __generator(this, function (_a) {
|
|
843
|
-
switch (_a.label) {
|
|
844
|
-
case 0: return [4 /*yield*/, appClient.getRecordAcl(__assign(__assign({}, params), { preview: true }))];
|
|
845
|
-
case 1:
|
|
846
|
-
_a.sent();
|
|
847
|
-
return [2 /*return*/];
|
|
848
|
-
}
|
|
849
|
-
});
|
|
850
|
-
}); });
|
|
851
|
-
it("should pass the path to the http client", function () {
|
|
852
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/record/acl.json");
|
|
853
|
-
});
|
|
854
|
-
it("should send a get request", function () {
|
|
855
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
856
|
-
});
|
|
857
|
-
it("should pass app and lang as a param to the http client", function () {
|
|
858
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
859
|
-
});
|
|
860
|
-
});
|
|
861
|
-
});
|
|
862
|
-
describe("updateRecordAcl", function () {
|
|
863
|
-
var params = {
|
|
864
|
-
app: APP_ID,
|
|
865
|
-
rights: [
|
|
866
|
-
{
|
|
867
|
-
filterCond: 'field = "foo"',
|
|
868
|
-
entities: [
|
|
869
|
-
{
|
|
870
|
-
entity: {
|
|
871
|
-
code: "bar",
|
|
872
|
-
type: "USER",
|
|
873
|
-
},
|
|
874
|
-
viewable: false,
|
|
875
|
-
editable: false,
|
|
876
|
-
deletable: false,
|
|
877
|
-
includeSubs: true,
|
|
878
|
-
},
|
|
879
|
-
],
|
|
880
|
-
},
|
|
881
|
-
],
|
|
882
|
-
revision: REVISION,
|
|
883
|
-
};
|
|
884
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
885
|
-
return __generator(this, function (_a) {
|
|
886
|
-
switch (_a.label) {
|
|
887
|
-
case 0: return [4 /*yield*/, appClient.updateRecordAcl(params)];
|
|
888
|
-
case 1:
|
|
889
|
-
_a.sent();
|
|
890
|
-
return [2 /*return*/];
|
|
891
|
-
}
|
|
892
|
-
});
|
|
893
|
-
}); });
|
|
894
|
-
it("should pass the path to the http client", function () {
|
|
895
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/record/acl.json");
|
|
896
|
-
});
|
|
897
|
-
it("should send a put request", function () {
|
|
898
|
-
expect(mockClient.getLogs()[0].method).toBe("put");
|
|
899
|
-
});
|
|
900
|
-
it("should pass app, right and revision as a param to the http client", function () {
|
|
901
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
902
|
-
});
|
|
903
|
-
});
|
|
904
|
-
describe("getPerRecordNotifications", function () {
|
|
905
|
-
var params = {
|
|
906
|
-
app: APP_ID,
|
|
907
|
-
};
|
|
908
|
-
describe("without preview", function () {
|
|
909
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
910
|
-
return __generator(this, function (_a) {
|
|
911
|
-
switch (_a.label) {
|
|
912
|
-
case 0: return [4 /*yield*/, appClient.getPerRecordNotifications(params)];
|
|
913
|
-
case 1:
|
|
914
|
-
_a.sent();
|
|
915
|
-
return [2 /*return*/];
|
|
916
|
-
}
|
|
917
|
-
});
|
|
918
|
-
}); });
|
|
919
|
-
it("should pass the path to the http client", function () {
|
|
920
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/app/notifications/perRecord.json");
|
|
921
|
-
});
|
|
922
|
-
it("should send a get request", function () {
|
|
923
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
924
|
-
});
|
|
925
|
-
it("should pass app as a param to the http client", function () {
|
|
926
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
927
|
-
});
|
|
928
|
-
});
|
|
929
|
-
describe("preview: true", function () {
|
|
930
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
931
|
-
return __generator(this, function (_a) {
|
|
932
|
-
switch (_a.label) {
|
|
933
|
-
case 0: return [4 /*yield*/, appClient.getPerRecordNotifications(__assign(__assign({}, params), { preview: true }))];
|
|
934
|
-
case 1:
|
|
935
|
-
_a.sent();
|
|
936
|
-
return [2 /*return*/];
|
|
937
|
-
}
|
|
938
|
-
});
|
|
939
|
-
}); });
|
|
940
|
-
it("should pass the path to the http client", function () {
|
|
941
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/notifications/perRecord.json");
|
|
942
|
-
});
|
|
943
|
-
it("should send a get request", function () {
|
|
944
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
945
|
-
});
|
|
946
|
-
it("should pass app and preview as a param to the http client", function () {
|
|
947
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
948
|
-
});
|
|
949
|
-
});
|
|
950
|
-
});
|
|
951
|
-
describe("getAppAcl", function () {
|
|
952
|
-
var params = {
|
|
953
|
-
app: APP_ID,
|
|
954
|
-
};
|
|
955
|
-
describe("without preview", function () {
|
|
956
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
957
|
-
return __generator(this, function (_a) {
|
|
958
|
-
switch (_a.label) {
|
|
959
|
-
case 0: return [4 /*yield*/, appClient.getAppAcl(params)];
|
|
960
|
-
case 1:
|
|
961
|
-
_a.sent();
|
|
962
|
-
return [2 /*return*/];
|
|
963
|
-
}
|
|
964
|
-
});
|
|
965
|
-
}); });
|
|
966
|
-
it("should pass the path to the http client", function () {
|
|
967
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/app/acl.json");
|
|
968
|
-
});
|
|
969
|
-
it("should send a get request", function () {
|
|
970
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
971
|
-
});
|
|
972
|
-
it("should pass app as a param to the http client", function () {
|
|
973
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
974
|
-
});
|
|
975
|
-
});
|
|
976
|
-
describe("preview: true", function () {
|
|
977
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
978
|
-
return __generator(this, function (_a) {
|
|
979
|
-
switch (_a.label) {
|
|
980
|
-
case 0: return [4 /*yield*/, appClient.getAppAcl(__assign(__assign({}, params), { preview: true }))];
|
|
981
|
-
case 1:
|
|
982
|
-
_a.sent();
|
|
983
|
-
return [2 /*return*/];
|
|
984
|
-
}
|
|
985
|
-
});
|
|
986
|
-
}); });
|
|
987
|
-
it("should pass the path to the http client", function () {
|
|
988
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/acl.json");
|
|
989
|
-
});
|
|
990
|
-
it("should send a get request", function () {
|
|
991
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
992
|
-
});
|
|
993
|
-
it("should pass app and preview as a param to the http client", function () {
|
|
994
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
995
|
-
});
|
|
996
|
-
});
|
|
997
|
-
});
|
|
998
|
-
describe("updateAppAcl", function () {
|
|
999
|
-
var params = {
|
|
1000
|
-
app: APP_ID,
|
|
1001
|
-
rights: [
|
|
1002
|
-
{
|
|
1003
|
-
entity: {
|
|
1004
|
-
type: "USER",
|
|
1005
|
-
code: "foo",
|
|
1006
|
-
},
|
|
1007
|
-
appEditable: true,
|
|
1008
|
-
recordViewable: true,
|
|
1009
|
-
recordAddable: true,
|
|
1010
|
-
recordEditable: true,
|
|
1011
|
-
recordDeletable: true,
|
|
1012
|
-
recordImportable: true,
|
|
1013
|
-
recordExportable: true,
|
|
1014
|
-
},
|
|
1015
|
-
],
|
|
1016
|
-
};
|
|
1017
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1018
|
-
return __generator(this, function (_a) {
|
|
1019
|
-
switch (_a.label) {
|
|
1020
|
-
case 0: return [4 /*yield*/, appClient.updateAppAcl(params)];
|
|
1021
|
-
case 1:
|
|
1022
|
-
_a.sent();
|
|
1023
|
-
return [2 /*return*/];
|
|
1024
|
-
}
|
|
1025
|
-
});
|
|
1026
|
-
}); });
|
|
1027
|
-
it("should pass the path to the http client", function () {
|
|
1028
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/acl.json");
|
|
1029
|
-
});
|
|
1030
|
-
it("should send a put request", function () {
|
|
1031
|
-
expect(mockClient.getLogs()[0].method).toBe("put");
|
|
1032
|
-
});
|
|
1033
|
-
it("should pass app and rights as a param to the http client", function () {
|
|
1034
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
1035
|
-
});
|
|
1036
|
-
});
|
|
1037
|
-
describe("evaluateRecordsAcl", function () {
|
|
1038
|
-
var params = {
|
|
1039
|
-
app: APP_ID,
|
|
1040
|
-
ids: [RECORD_ID],
|
|
1041
|
-
};
|
|
1042
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1043
|
-
return __generator(this, function (_a) {
|
|
1044
|
-
switch (_a.label) {
|
|
1045
|
-
case 0: return [4 /*yield*/, appClient.evaluateRecordsAcl(params)];
|
|
1046
|
-
case 1:
|
|
1047
|
-
_a.sent();
|
|
1048
|
-
return [2 /*return*/];
|
|
1049
|
-
}
|
|
1050
|
-
});
|
|
1051
|
-
}); });
|
|
1052
|
-
it("should pass the path to the http client", function () {
|
|
1053
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/records/acl/evaluate.json");
|
|
1054
|
-
});
|
|
1055
|
-
it("should send a get request", function () {
|
|
1056
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
1057
|
-
});
|
|
1058
|
-
it("should pass app and ids as a param to the http client", function () {
|
|
1059
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
1060
|
-
});
|
|
1061
|
-
});
|
|
1062
|
-
describe("getAppCustomize", function () {
|
|
1063
|
-
var params = { app: APP_ID };
|
|
1064
|
-
describe("without preview", function () {
|
|
1065
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1066
|
-
return __generator(this, function (_a) {
|
|
1067
|
-
switch (_a.label) {
|
|
1068
|
-
case 0: return [4 /*yield*/, appClient.getAppCustomize(params)];
|
|
1069
|
-
case 1:
|
|
1070
|
-
_a.sent();
|
|
1071
|
-
return [2 /*return*/];
|
|
1072
|
-
}
|
|
1073
|
-
});
|
|
1074
|
-
}); });
|
|
1075
|
-
it("should pass the path to the http client", function () {
|
|
1076
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/app/customize.json");
|
|
1077
|
-
});
|
|
1078
|
-
it("should send a get request", function () {
|
|
1079
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
1080
|
-
});
|
|
1081
|
-
it("should pass app as a param to the http client", function () {
|
|
1082
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
1083
|
-
});
|
|
1084
|
-
});
|
|
1085
|
-
describe("preview: true", function () {
|
|
1086
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1087
|
-
return __generator(this, function (_a) {
|
|
1088
|
-
switch (_a.label) {
|
|
1089
|
-
case 0: return [4 /*yield*/, appClient.getAppCustomize(__assign(__assign({}, params), { preview: true }))];
|
|
1090
|
-
case 1:
|
|
1091
|
-
_a.sent();
|
|
1092
|
-
return [2 /*return*/];
|
|
1093
|
-
}
|
|
1094
|
-
});
|
|
1095
|
-
}); });
|
|
1096
|
-
it("should pass the path to the http client", function () {
|
|
1097
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/customize.json");
|
|
1098
|
-
});
|
|
1099
|
-
it("should send a get request", function () {
|
|
1100
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
1101
|
-
});
|
|
1102
|
-
it("should pass app and preview as a param to the http client", function () {
|
|
1103
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
1104
|
-
});
|
|
1105
|
-
});
|
|
1106
|
-
});
|
|
1107
|
-
describe("updateAppCustomize", function () {
|
|
1108
|
-
var resource = {
|
|
1109
|
-
js: [
|
|
1110
|
-
{
|
|
1111
|
-
type: "URL",
|
|
1112
|
-
url: "https://www.example.com/example-mobile.js",
|
|
1113
|
-
},
|
|
1114
|
-
],
|
|
1115
|
-
css: [
|
|
1116
|
-
{
|
|
1117
|
-
type: "FILE",
|
|
1118
|
-
file: {
|
|
1119
|
-
fileKey: "ddfc8e89-7aa3-4350-b9ab-3a75c9cf46b3",
|
|
1120
|
-
},
|
|
1121
|
-
},
|
|
1122
|
-
],
|
|
1123
|
-
};
|
|
1124
|
-
var params = {
|
|
1125
|
-
app: APP_ID,
|
|
1126
|
-
scope: "ALL",
|
|
1127
|
-
desktop: resource,
|
|
1128
|
-
mobile: resource,
|
|
1129
|
-
revision: REVISION,
|
|
1130
|
-
};
|
|
1131
|
-
describe("customize resources are specified", function () {
|
|
1132
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1133
|
-
return __generator(this, function (_a) {
|
|
1134
|
-
switch (_a.label) {
|
|
1135
|
-
case 0: return [4 /*yield*/, appClient.updateAppCustomize(params)];
|
|
1136
|
-
case 1:
|
|
1137
|
-
_a.sent();
|
|
1138
|
-
return [2 /*return*/];
|
|
1139
|
-
}
|
|
1140
|
-
});
|
|
1141
|
-
}); });
|
|
1142
|
-
it("should pass the path to the http client", function () {
|
|
1143
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/customize.json");
|
|
1144
|
-
});
|
|
1145
|
-
it("should send a put request", function () {
|
|
1146
|
-
expect(mockClient.getLogs()[0].method).toBe("put");
|
|
1147
|
-
});
|
|
1148
|
-
it("should pass app, scope, desktop, mobile and revision as a param to the http client", function () {
|
|
1149
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
1150
|
-
});
|
|
1151
|
-
});
|
|
1152
|
-
});
|
|
1153
|
-
describe("getGeneralNotifications", function () {
|
|
1154
|
-
var params = {
|
|
1155
|
-
app: APP_ID,
|
|
1156
|
-
};
|
|
1157
|
-
describe("without preview", function () {
|
|
1158
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1159
|
-
return __generator(this, function (_a) {
|
|
1160
|
-
switch (_a.label) {
|
|
1161
|
-
case 0: return [4 /*yield*/, appClient.getGeneralNotifications(params)];
|
|
1162
|
-
case 1:
|
|
1163
|
-
_a.sent();
|
|
1164
|
-
return [2 /*return*/];
|
|
1165
|
-
}
|
|
1166
|
-
});
|
|
1167
|
-
}); });
|
|
1168
|
-
it("should pass the path to the http client", function () {
|
|
1169
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/app/notifications/general.json");
|
|
1170
|
-
});
|
|
1171
|
-
it("should send a get request", function () {
|
|
1172
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
1173
|
-
});
|
|
1174
|
-
it("should pass app as a param to the http client", function () {
|
|
1175
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
1176
|
-
});
|
|
1177
|
-
});
|
|
1178
|
-
describe("preview: true", function () {
|
|
1179
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1180
|
-
return __generator(this, function (_a) {
|
|
1181
|
-
switch (_a.label) {
|
|
1182
|
-
case 0: return [4 /*yield*/, appClient.getGeneralNotifications(__assign(__assign({}, params), { preview: true }))];
|
|
1183
|
-
case 1:
|
|
1184
|
-
_a.sent();
|
|
1185
|
-
return [2 /*return*/];
|
|
1186
|
-
}
|
|
1187
|
-
});
|
|
1188
|
-
}); });
|
|
1189
|
-
it("should pass the path to the http client", function () {
|
|
1190
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/notifications/general.json");
|
|
1191
|
-
});
|
|
1192
|
-
it("should send a get request", function () {
|
|
1193
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
1194
|
-
});
|
|
1195
|
-
it("should pass app and preview as a param to the http client", function () {
|
|
1196
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
1197
|
-
});
|
|
1198
|
-
});
|
|
1199
|
-
});
|
|
1200
|
-
describe("updateReminderNotifications", function () {
|
|
1201
|
-
var params = {
|
|
1202
|
-
app: 1,
|
|
1203
|
-
notifications: [
|
|
1204
|
-
{
|
|
1205
|
-
timing: {
|
|
1206
|
-
code: "CREATED_TIME",
|
|
1207
|
-
daysLater: "1",
|
|
1208
|
-
hoursLater: "2",
|
|
1209
|
-
},
|
|
1210
|
-
filterCond: 'CREATED_TIME in ("user1)',
|
|
1211
|
-
title: "test title1",
|
|
1212
|
-
targets: [
|
|
1213
|
-
{
|
|
1214
|
-
entity: {
|
|
1215
|
-
type: "USER",
|
|
1216
|
-
code: "user1",
|
|
1217
|
-
},
|
|
1218
|
-
includeSubs: false,
|
|
1219
|
-
},
|
|
1220
|
-
],
|
|
1221
|
-
},
|
|
1222
|
-
{
|
|
1223
|
-
timing: {
|
|
1224
|
-
code: "CREATED_TIME",
|
|
1225
|
-
daysLater: "-3",
|
|
1226
|
-
time: "08:30",
|
|
1227
|
-
},
|
|
1228
|
-
filterCond: 'CREATED_TIME in ("user1")',
|
|
1229
|
-
title: "test title2",
|
|
1230
|
-
targets: [
|
|
1231
|
-
{
|
|
1232
|
-
entity: {
|
|
1233
|
-
type: "USER",
|
|
1234
|
-
code: "user1",
|
|
1235
|
-
},
|
|
1236
|
-
includeSubs: false,
|
|
1237
|
-
},
|
|
1238
|
-
],
|
|
1239
|
-
},
|
|
1240
|
-
],
|
|
1241
|
-
timezone: "Asia/Tokyo",
|
|
1242
|
-
revision: "2",
|
|
1243
|
-
};
|
|
1244
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1245
|
-
return __generator(this, function (_a) {
|
|
1246
|
-
switch (_a.label) {
|
|
1247
|
-
case 0: return [4 /*yield*/, appClient.updateReminderNotifications(params)];
|
|
1248
|
-
case 1:
|
|
1249
|
-
_a.sent();
|
|
1250
|
-
return [2 /*return*/];
|
|
1251
|
-
}
|
|
1252
|
-
});
|
|
1253
|
-
}); });
|
|
1254
|
-
it("should pass the path to the http client", function () {
|
|
1255
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/notifications/reminder.json");
|
|
1256
|
-
});
|
|
1257
|
-
it("should send a put request", function () {
|
|
1258
|
-
expect(mockClient.getLogs()[0].method).toBe("put");
|
|
1259
|
-
});
|
|
1260
|
-
it("should pass app and rights as a param to the http client", function () {
|
|
1261
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
1262
|
-
});
|
|
1263
|
-
});
|
|
1264
|
-
describe("updatePerRecordNotifications", function () {
|
|
1265
|
-
var params = {
|
|
1266
|
-
app: APP_ID,
|
|
1267
|
-
notifications: [
|
|
1268
|
-
{
|
|
1269
|
-
filterCond: 'Customer = "foo"',
|
|
1270
|
-
title: "Send a notification",
|
|
1271
|
-
targets: [
|
|
1272
|
-
{
|
|
1273
|
-
entity: {
|
|
1274
|
-
type: "USER",
|
|
1275
|
-
code: "foo",
|
|
1276
|
-
},
|
|
1277
|
-
includeSubs: false,
|
|
1278
|
-
},
|
|
1279
|
-
],
|
|
1280
|
-
},
|
|
1281
|
-
],
|
|
1282
|
-
revision: 1,
|
|
1283
|
-
};
|
|
1284
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1285
|
-
return __generator(this, function (_a) {
|
|
1286
|
-
switch (_a.label) {
|
|
1287
|
-
case 0: return [4 /*yield*/, appClient.updatePerRecordNotifications(params)];
|
|
1288
|
-
case 1:
|
|
1289
|
-
_a.sent();
|
|
1290
|
-
return [2 /*return*/];
|
|
1291
|
-
}
|
|
1292
|
-
});
|
|
1293
|
-
}); });
|
|
1294
|
-
it("should pass the path to the http client", function () {
|
|
1295
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/notifications/perRecord.json");
|
|
1296
|
-
});
|
|
1297
|
-
it("should send a put request", function () {
|
|
1298
|
-
expect(mockClient.getLogs()[0].method).toBe("put");
|
|
1299
|
-
});
|
|
1300
|
-
it("should pass app and rights as a param to the http client", function () {
|
|
1301
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
1302
|
-
});
|
|
1303
|
-
});
|
|
1304
|
-
describe("getAppNotificationsReminder", function () {
|
|
1305
|
-
var lang = "default";
|
|
1306
|
-
var params = { app: APP_ID, lang: lang };
|
|
1307
|
-
describe("without preview", function () {
|
|
1308
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1309
|
-
return __generator(this, function (_a) {
|
|
1310
|
-
switch (_a.label) {
|
|
1311
|
-
case 0: return [4 /*yield*/, appClient.getReminderNotifications(params)];
|
|
1312
|
-
case 1:
|
|
1313
|
-
_a.sent();
|
|
1314
|
-
return [2 /*return*/];
|
|
1315
|
-
}
|
|
1316
|
-
});
|
|
1317
|
-
}); });
|
|
1318
|
-
it("should pass the path to the http client", function () {
|
|
1319
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/app/notifications/reminder.json");
|
|
1320
|
-
});
|
|
1321
|
-
it("should send a get request", function () {
|
|
1322
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
1323
|
-
});
|
|
1324
|
-
it("should pass app and lang as a param to the http client", function () {
|
|
1325
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
1326
|
-
});
|
|
1327
|
-
});
|
|
1328
|
-
describe("preview: true", function () {
|
|
1329
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1330
|
-
return __generator(this, function (_a) {
|
|
1331
|
-
switch (_a.label) {
|
|
1332
|
-
case 0: return [4 /*yield*/, appClient.getReminderNotifications(__assign(__assign({}, params), { preview: true }))];
|
|
1333
|
-
case 1:
|
|
1334
|
-
_a.sent();
|
|
1335
|
-
return [2 /*return*/];
|
|
1336
|
-
}
|
|
1337
|
-
});
|
|
1338
|
-
}); });
|
|
1339
|
-
it("should pass the path to the http client", function () {
|
|
1340
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/notifications/reminder.json");
|
|
1341
|
-
});
|
|
1342
|
-
it("should send a get request", function () {
|
|
1343
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
1344
|
-
});
|
|
1345
|
-
it("should pass app and lang as a param to the http client", function () {
|
|
1346
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
1347
|
-
});
|
|
1348
|
-
});
|
|
1349
|
-
});
|
|
1350
|
-
describe("updateAppUpdateGeneralNotifications", function () {
|
|
1351
|
-
var params = {
|
|
1352
|
-
app: APP_ID,
|
|
1353
|
-
notifications: [
|
|
1354
|
-
{
|
|
1355
|
-
entity: {
|
|
1356
|
-
type: "USER",
|
|
1357
|
-
code: "foo",
|
|
1358
|
-
},
|
|
1359
|
-
includeSubs: true,
|
|
1360
|
-
recordAdded: true,
|
|
1361
|
-
recordEdited: true,
|
|
1362
|
-
commentAdded: true,
|
|
1363
|
-
statusChanged: true,
|
|
1364
|
-
fileImported: true,
|
|
1365
|
-
},
|
|
1366
|
-
],
|
|
1367
|
-
notifyToCommenter: true,
|
|
1368
|
-
revision: 1,
|
|
1369
|
-
};
|
|
1370
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1371
|
-
return __generator(this, function (_a) {
|
|
1372
|
-
switch (_a.label) {
|
|
1373
|
-
case 0: return [4 /*yield*/, appClient.updateGeneralNotifications(params)];
|
|
1374
|
-
case 1:
|
|
1375
|
-
_a.sent();
|
|
1376
|
-
return [2 /*return*/];
|
|
1377
|
-
}
|
|
1378
|
-
});
|
|
1379
|
-
}); });
|
|
1380
|
-
it("should pass the path to the http client", function () {
|
|
1381
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/notifications/general.json");
|
|
1382
|
-
});
|
|
1383
|
-
it("should send a put request", function () {
|
|
1384
|
-
expect(mockClient.getLogs()[0].method).toBe("put");
|
|
1385
|
-
});
|
|
1386
|
-
it("should pass app and rights as a param to the http client", function () {
|
|
1387
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
1388
|
-
});
|
|
1389
|
-
});
|
|
1390
|
-
describe("getReports", function () {
|
|
1391
|
-
var lang = "default";
|
|
1392
|
-
var params = { app: APP_ID, lang: lang };
|
|
1393
|
-
describe("without preview", function () {
|
|
1394
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1395
|
-
return __generator(this, function (_a) {
|
|
1396
|
-
switch (_a.label) {
|
|
1397
|
-
case 0: return [4 /*yield*/, appClient.getReports(params)];
|
|
1398
|
-
case 1:
|
|
1399
|
-
_a.sent();
|
|
1400
|
-
return [2 /*return*/];
|
|
1401
|
-
}
|
|
1402
|
-
});
|
|
1403
|
-
}); });
|
|
1404
|
-
it("should pass the path to the http client", function () {
|
|
1405
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/app/reports.json");
|
|
1406
|
-
});
|
|
1407
|
-
it("should send a get request", function () {
|
|
1408
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
1409
|
-
});
|
|
1410
|
-
it("should pass app and lang as a param to the http client", function () {
|
|
1411
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
1412
|
-
});
|
|
1413
|
-
});
|
|
1414
|
-
describe("preview: true", function () {
|
|
1415
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1416
|
-
return __generator(this, function (_a) {
|
|
1417
|
-
switch (_a.label) {
|
|
1418
|
-
case 0: return [4 /*yield*/, appClient.getReports(__assign(__assign({}, params), { preview: true }))];
|
|
1419
|
-
case 1:
|
|
1420
|
-
_a.sent();
|
|
1421
|
-
return [2 /*return*/];
|
|
1422
|
-
}
|
|
1423
|
-
});
|
|
1424
|
-
}); });
|
|
1425
|
-
it("should pass the path to the http client", function () {
|
|
1426
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/reports.json");
|
|
1427
|
-
});
|
|
1428
|
-
it("should send a get request", function () {
|
|
1429
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
1430
|
-
});
|
|
1431
|
-
it("should pass app and lang as a param to the http client", function () {
|
|
1432
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
1433
|
-
});
|
|
1434
|
-
});
|
|
1435
|
-
});
|
|
1436
|
-
describe("updateReports", function () {
|
|
1437
|
-
var params = {
|
|
1438
|
-
app: 1,
|
|
1439
|
-
reports: {
|
|
1440
|
-
"Graph 1": {
|
|
1441
|
-
chartType: "BAR",
|
|
1442
|
-
chartMode: "NORMAL",
|
|
1443
|
-
name: "Graph 1",
|
|
1444
|
-
index: 0,
|
|
1445
|
-
groups: [
|
|
1446
|
-
{
|
|
1447
|
-
code: "Radio_button",
|
|
1448
|
-
},
|
|
1449
|
-
],
|
|
1450
|
-
aggregations: [
|
|
1451
|
-
{
|
|
1452
|
-
type: "COUNT",
|
|
1453
|
-
},
|
|
1454
|
-
],
|
|
1455
|
-
filterCond: "",
|
|
1456
|
-
sorts: [
|
|
1457
|
-
{
|
|
1458
|
-
by: "TOTAL",
|
|
1459
|
-
order: "DESC",
|
|
1460
|
-
},
|
|
1461
|
-
],
|
|
1462
|
-
periodicReport: {
|
|
1463
|
-
active: true,
|
|
1464
|
-
period: {
|
|
1465
|
-
every: "QUARTER",
|
|
1466
|
-
pattern: "JAN_APR_JUL_OCT",
|
|
1467
|
-
dayOfMonth: "END_OF_MONTH",
|
|
1468
|
-
time: "23:30",
|
|
1469
|
-
},
|
|
1470
|
-
},
|
|
1471
|
-
},
|
|
1472
|
-
},
|
|
1473
|
-
};
|
|
1474
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1475
|
-
return __generator(this, function (_a) {
|
|
1476
|
-
switch (_a.label) {
|
|
1477
|
-
case 0: return [4 /*yield*/, appClient.updateReports(params)];
|
|
1478
|
-
case 1:
|
|
1479
|
-
_a.sent();
|
|
1480
|
-
return [2 /*return*/];
|
|
1481
|
-
}
|
|
1482
|
-
});
|
|
1483
|
-
}); });
|
|
1484
|
-
it("should pass the path to the http client", function () {
|
|
1485
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/reports.json");
|
|
1486
|
-
});
|
|
1487
|
-
it("should send a put request", function () {
|
|
1488
|
-
expect(mockClient.getLogs()[0].method).toBe("put");
|
|
1489
|
-
});
|
|
1490
|
-
it("should pass app and rights as a param to the http client", function () {
|
|
1491
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
1492
|
-
});
|
|
1493
|
-
});
|
|
1494
|
-
describe("getAppActions", function () {
|
|
1495
|
-
var lang = "default";
|
|
1496
|
-
var params = { app: APP_ID, lang: lang };
|
|
1497
|
-
describe("without preview", function () {
|
|
1498
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1499
|
-
return __generator(this, function (_a) {
|
|
1500
|
-
switch (_a.label) {
|
|
1501
|
-
case 0: return [4 /*yield*/, appClient.getAppActions(params)];
|
|
1502
|
-
case 1:
|
|
1503
|
-
_a.sent();
|
|
1504
|
-
return [2 /*return*/];
|
|
1505
|
-
}
|
|
1506
|
-
});
|
|
1507
|
-
}); });
|
|
1508
|
-
it("should pass the path to the http client", function () {
|
|
1509
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/app/actions.json");
|
|
1510
|
-
});
|
|
1511
|
-
it("should send a get request", function () {
|
|
1512
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
1513
|
-
});
|
|
1514
|
-
it("should pass app and lang as a param to the http client", function () {
|
|
1515
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
1516
|
-
});
|
|
1517
|
-
});
|
|
1518
|
-
describe("preview: true", function () {
|
|
1519
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1520
|
-
return __generator(this, function (_a) {
|
|
1521
|
-
switch (_a.label) {
|
|
1522
|
-
case 0: return [4 /*yield*/, appClient.getAppActions(__assign(__assign({}, params), { preview: true }))];
|
|
1523
|
-
case 1:
|
|
1524
|
-
_a.sent();
|
|
1525
|
-
return [2 /*return*/];
|
|
1526
|
-
}
|
|
1527
|
-
});
|
|
1528
|
-
}); });
|
|
1529
|
-
it("should pass the path to the http client", function () {
|
|
1530
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/actions.json");
|
|
1531
|
-
});
|
|
1532
|
-
it("should send a get request", function () {
|
|
1533
|
-
expect(mockClient.getLogs()[0].method).toBe("get");
|
|
1534
|
-
});
|
|
1535
|
-
it("should pass app and lang as a param to the http client", function () {
|
|
1536
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
1537
|
-
});
|
|
1538
|
-
});
|
|
1539
|
-
});
|
|
1540
|
-
describe("updateAppActions", function () {
|
|
1541
|
-
var params = {
|
|
1542
|
-
app: APP_ID,
|
|
1543
|
-
actions: {
|
|
1544
|
-
Action_A: {
|
|
1545
|
-
name: "Action_A",
|
|
1546
|
-
index: "0",
|
|
1547
|
-
destApp: {
|
|
1548
|
-
code: "INVOICE",
|
|
1549
|
-
},
|
|
1550
|
-
mappings: [
|
|
1551
|
-
{
|
|
1552
|
-
srcType: "FIELD",
|
|
1553
|
-
srcField: "CompanyName",
|
|
1554
|
-
destField: "CompanyName",
|
|
1555
|
-
},
|
|
1556
|
-
{
|
|
1557
|
-
srcType: "FIELD",
|
|
1558
|
-
srcField: "DivisionName",
|
|
1559
|
-
destField: "DivisionName",
|
|
1560
|
-
},
|
|
1561
|
-
{
|
|
1562
|
-
srcType: "RECORD_URL",
|
|
1563
|
-
destField: "URL",
|
|
1564
|
-
},
|
|
1565
|
-
],
|
|
1566
|
-
entities: [
|
|
1567
|
-
{
|
|
1568
|
-
type: "USER",
|
|
1569
|
-
code: "Administrator",
|
|
1570
|
-
},
|
|
1571
|
-
],
|
|
1572
|
-
},
|
|
1573
|
-
},
|
|
1574
|
-
};
|
|
1575
|
-
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1576
|
-
return __generator(this, function (_a) {
|
|
1577
|
-
switch (_a.label) {
|
|
1578
|
-
case 0: return [4 /*yield*/, appClient.updateAppActions(params)];
|
|
1579
|
-
case 1:
|
|
1580
|
-
_a.sent();
|
|
1581
|
-
return [2 /*return*/];
|
|
1582
|
-
}
|
|
1583
|
-
});
|
|
1584
|
-
}); });
|
|
1585
|
-
it("should pass the path to the http client", function () {
|
|
1586
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/actions.json");
|
|
1587
|
-
});
|
|
1588
|
-
it("should send a put request", function () {
|
|
1589
|
-
expect(mockClient.getLogs()[0].method).toBe("put");
|
|
1590
|
-
});
|
|
1591
|
-
it("should pass app and actions as a param to the http client", function () {
|
|
1592
|
-
expect(mockClient.getLogs()[0].params).toEqual(params);
|
|
1593
|
-
});
|
|
1594
|
-
});
|
|
1595
|
-
});
|
|
1596
|
-
describe("AppClient with guestSpaceId", function () {
|
|
1597
|
-
it("should pass the path to the http client", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1598
|
-
var GUEST_SPACE_ID, lang, params, requestConfigBuilder, mockClient, appClient;
|
|
1599
|
-
return __generator(this, function (_a) {
|
|
1600
|
-
switch (_a.label) {
|
|
1601
|
-
case 0:
|
|
1602
|
-
GUEST_SPACE_ID = 2;
|
|
1603
|
-
lang = "default";
|
|
1604
|
-
params = { app: APP_ID, lang: lang };
|
|
1605
|
-
requestConfigBuilder = new KintoneRequestConfigBuilder_1.KintoneRequestConfigBuilder({
|
|
1606
|
-
baseUrl: "https://example.cybozu.com",
|
|
1607
|
-
auth: { type: "session" },
|
|
1608
|
-
});
|
|
1609
|
-
mockClient = (0, MockClient_1.buildMockClient)(requestConfigBuilder);
|
|
1610
|
-
appClient = new AppClient_1.AppClient(mockClient, GUEST_SPACE_ID);
|
|
1611
|
-
return [4 /*yield*/, appClient.getFormFields(params)];
|
|
1612
|
-
case 1:
|
|
1613
|
-
_a.sent();
|
|
1614
|
-
expect(mockClient.getLogs()[0].path).toBe("/k/guest/".concat(GUEST_SPACE_ID, "/v1/app/form/fields.json"));
|
|
1615
|
-
return [2 /*return*/];
|
|
1616
|
-
}
|
|
1617
|
-
});
|
|
1618
|
-
}); });
|
|
1619
|
-
});
|
|
1620
|
-
//# sourceMappingURL=AppClient.test.js.map
|