@api-client/core 0.20.9 → 0.20.10
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/build/src/mocking/ModelingMock.d.ts +26 -0
- package/build/src/mocking/ModelingMock.d.ts.map +1 -1
- package/build/src/mocking/ModelingMock.js +48 -0
- package/build/src/mocking/ModelingMock.js.map +1 -1
- package/build/src/sdk/SdkMock.d.ts +0 -3
- package/build/src/sdk/SdkMock.d.ts.map +1 -1
- package/build/src/sdk/SdkMock.js +60 -86
- package/build/src/sdk/SdkMock.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/mocking/ModelingMock.ts +54 -0
- package/src/sdk/SdkMock.ts +60 -95
package/build/src/sdk/SdkMock.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { setupWorker, } from '@jarrodek/amw';
|
|
2
|
-
import { isAtomicFilter
|
|
2
|
+
import { isAtomicFilter } from '../events/BaseEvents.js';
|
|
3
3
|
import { RouteBuilder } from './RouteBuilder.js';
|
|
4
4
|
import { ModelingMock } from '../mocking/ModelingMock.js';
|
|
5
5
|
import { DataDomain } from '../modeling/DataDomain.js';
|
|
@@ -107,7 +107,7 @@ export class SdkMock {
|
|
|
107
107
|
*/
|
|
108
108
|
list: async (init, options) => {
|
|
109
109
|
const { mock } = this;
|
|
110
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapList(this.gen.organization.organizations(init?.size ?? 5), init), init);
|
|
110
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapList(this.gen.organization.organizations(init?.size ?? 5), init), init);
|
|
111
111
|
await mock.add({
|
|
112
112
|
match: {
|
|
113
113
|
uri: RouteBuilder.organizations(),
|
|
@@ -122,7 +122,7 @@ export class SdkMock {
|
|
|
122
122
|
*/
|
|
123
123
|
create: async (init, options) => {
|
|
124
124
|
const { mock } = this;
|
|
125
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.organization.organization()), init);
|
|
125
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.organization.organization()), init);
|
|
126
126
|
await mock.add({
|
|
127
127
|
match: {
|
|
128
128
|
uri: RouteBuilder.organizations(),
|
|
@@ -134,7 +134,7 @@ export class SdkMock {
|
|
|
134
134
|
invitations: {
|
|
135
135
|
list: async (init, options) => {
|
|
136
136
|
const { mock } = this;
|
|
137
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapList(this.gen.invitation.invitations(init?.size ?? 5), init), init);
|
|
137
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapList(this.gen.invitation.invitations(init?.size ?? 5), init), init);
|
|
138
138
|
await mock.add({
|
|
139
139
|
match: {
|
|
140
140
|
uri: RouteBuilder.invitations(':oid'),
|
|
@@ -145,7 +145,7 @@ export class SdkMock {
|
|
|
145
145
|
},
|
|
146
146
|
create: async (init, options) => {
|
|
147
147
|
const { mock } = this;
|
|
148
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.invitation.invitation()), init);
|
|
148
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.invitation.invitation()), init);
|
|
149
149
|
await mock.add({
|
|
150
150
|
match: {
|
|
151
151
|
uri: RouteBuilder.invitations(':oid'),
|
|
@@ -156,7 +156,7 @@ export class SdkMock {
|
|
|
156
156
|
},
|
|
157
157
|
findByToken: async (init, options) => {
|
|
158
158
|
const { mock } = this;
|
|
159
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.invitation.invitation()), init);
|
|
159
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.invitation.invitation()), init);
|
|
160
160
|
await mock.add({
|
|
161
161
|
match: {
|
|
162
162
|
uri: RouteBuilder.findInvitation(),
|
|
@@ -167,7 +167,7 @@ export class SdkMock {
|
|
|
167
167
|
},
|
|
168
168
|
decline: async (init, options) => {
|
|
169
169
|
const { mock } = this;
|
|
170
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.invitation.invitation()), init);
|
|
170
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.invitation.invitation()), init);
|
|
171
171
|
await mock.add({
|
|
172
172
|
match: {
|
|
173
173
|
uri: RouteBuilder.declineInvitation(':oid', ':id'),
|
|
@@ -178,7 +178,7 @@ export class SdkMock {
|
|
|
178
178
|
},
|
|
179
179
|
delete: async (init, options) => {
|
|
180
180
|
const { mock } = this;
|
|
181
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.invitation.invitation()), init);
|
|
181
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.invitation.invitation()), init);
|
|
182
182
|
await mock.add({
|
|
183
183
|
match: {
|
|
184
184
|
uri: RouteBuilder.invitation(':oid', ':id'),
|
|
@@ -189,7 +189,7 @@ export class SdkMock {
|
|
|
189
189
|
},
|
|
190
190
|
patch: async (init, options) => {
|
|
191
191
|
const { mock } = this;
|
|
192
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.invitation.invitation()), init);
|
|
192
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.invitation.invitation()), init);
|
|
193
193
|
await mock.add({
|
|
194
194
|
match: {
|
|
195
195
|
uri: RouteBuilder.invitation(':oid', ':id'),
|
|
@@ -200,7 +200,7 @@ export class SdkMock {
|
|
|
200
200
|
},
|
|
201
201
|
resend: async (init, options) => {
|
|
202
202
|
const { mock } = this;
|
|
203
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.invitation.invitation()), init);
|
|
203
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.invitation.invitation()), init);
|
|
204
204
|
await mock.add({
|
|
205
205
|
match: {
|
|
206
206
|
uri: RouteBuilder.resendInvitation(':oid', ':id'),
|
|
@@ -213,7 +213,7 @@ export class SdkMock {
|
|
|
213
213
|
users: {
|
|
214
214
|
list: async (init, options) => {
|
|
215
215
|
const { mock } = this;
|
|
216
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapList(this.gen.users.users(init?.size ?? 5), init), init);
|
|
216
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapList(this.gen.users.users(init?.size ?? 5), init), init);
|
|
217
217
|
await mock.add({
|
|
218
218
|
match: {
|
|
219
219
|
uri: RouteBuilder.organizationUsers(':oid'),
|
|
@@ -224,7 +224,7 @@ export class SdkMock {
|
|
|
224
224
|
},
|
|
225
225
|
read: async (init, options) => {
|
|
226
226
|
const { mock } = this;
|
|
227
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.users.user()), init);
|
|
227
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.users.user()), init);
|
|
228
228
|
await mock.add({
|
|
229
229
|
match: {
|
|
230
230
|
uri: RouteBuilder.organizationUser(':oid', ':id'),
|
|
@@ -236,7 +236,7 @@ export class SdkMock {
|
|
|
236
236
|
readBatch: async (init, options) => {
|
|
237
237
|
const { mock } = this;
|
|
238
238
|
const path = RouteBuilder.organizationUserBatch(':oid');
|
|
239
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapList(this.gen.users.users(init?.size ?? 5), init), init);
|
|
239
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapList(this.gen.users.users(init?.size ?? 5), init), init);
|
|
240
240
|
await mock.add({
|
|
241
241
|
match: {
|
|
242
242
|
uri: path,
|
|
@@ -247,7 +247,7 @@ export class SdkMock {
|
|
|
247
247
|
},
|
|
248
248
|
activate: async (init, options) => {
|
|
249
249
|
const { mock } = this;
|
|
250
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.users.user()), init);
|
|
250
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.users.user()), init);
|
|
251
251
|
await mock.add({
|
|
252
252
|
match: {
|
|
253
253
|
uri: RouteBuilder.organizationUserActivate(':oid', ':id'),
|
|
@@ -258,7 +258,7 @@ export class SdkMock {
|
|
|
258
258
|
},
|
|
259
259
|
deactivate: async (init, options) => {
|
|
260
260
|
const { mock } = this;
|
|
261
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.users.user()), init);
|
|
261
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.users.user()), init);
|
|
262
262
|
await mock.add({
|
|
263
263
|
match: {
|
|
264
264
|
uri: RouteBuilder.organizationUserDeactivate(':oid', ':id'),
|
|
@@ -286,7 +286,7 @@ export class SdkMock {
|
|
|
286
286
|
*/
|
|
287
287
|
validate: async (init, options) => {
|
|
288
288
|
const { mock } = this;
|
|
289
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.organization.organizationSlugValidateResponse()), init);
|
|
289
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.organization.organizationSlugValidateResponse()), init);
|
|
290
290
|
await mock.add({
|
|
291
291
|
match: {
|
|
292
292
|
uri: RouteBuilder.orgSlugValidate(),
|
|
@@ -301,7 +301,7 @@ export class SdkMock {
|
|
|
301
301
|
*/
|
|
302
302
|
generate: async (init, options) => {
|
|
303
303
|
const { mock } = this;
|
|
304
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.organization.organizationSlugGenerateResponse()), init);
|
|
304
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.organization.organizationSlugGenerateResponse()), init);
|
|
305
305
|
await mock.add({
|
|
306
306
|
match: {
|
|
307
307
|
uri: RouteBuilder.orgSlugGenerate(),
|
|
@@ -322,7 +322,7 @@ export class SdkMock {
|
|
|
322
322
|
*/
|
|
323
323
|
list: async (init, options) => {
|
|
324
324
|
const { mock } = this;
|
|
325
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapList(this.gen.group.groups(init?.size ?? 5), init), init);
|
|
325
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapList(this.gen.group.groups(init?.size ?? 5), init), init);
|
|
326
326
|
await mock.add({
|
|
327
327
|
match: {
|
|
328
328
|
uri: RouteBuilder.groups(':oid'),
|
|
@@ -337,7 +337,7 @@ export class SdkMock {
|
|
|
337
337
|
*/
|
|
338
338
|
create: async (init, options) => {
|
|
339
339
|
const { mock } = this;
|
|
340
|
-
const respond = this.createDefaultResponse(201, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.group.group()), init);
|
|
340
|
+
const respond = this.createDefaultResponse(201, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.group.group()), init);
|
|
341
341
|
await mock.add({
|
|
342
342
|
match: {
|
|
343
343
|
uri: RouteBuilder.groups(':oid'),
|
|
@@ -352,7 +352,7 @@ export class SdkMock {
|
|
|
352
352
|
*/
|
|
353
353
|
update: async (init, options) => {
|
|
354
354
|
const { mock } = this;
|
|
355
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.group.group()), init);
|
|
355
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.group.group()), init);
|
|
356
356
|
await mock.add({
|
|
357
357
|
match: {
|
|
358
358
|
uri: RouteBuilder.group(':oid', ':key'),
|
|
@@ -381,7 +381,7 @@ export class SdkMock {
|
|
|
381
381
|
*/
|
|
382
382
|
addUsers: async (init, options) => {
|
|
383
383
|
const { mock } = this;
|
|
384
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.group.group()), init);
|
|
384
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.group.group()), init);
|
|
385
385
|
await mock.add({
|
|
386
386
|
match: {
|
|
387
387
|
uri: RouteBuilder.groupUsers(':oid', ':key'),
|
|
@@ -395,7 +395,7 @@ export class SdkMock {
|
|
|
395
395
|
*/
|
|
396
396
|
removeUsers: async (init, options) => {
|
|
397
397
|
const { mock } = this;
|
|
398
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.group.group()), init);
|
|
398
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.group.group()), init);
|
|
399
399
|
await mock.add({
|
|
400
400
|
match: {
|
|
401
401
|
uri: RouteBuilder.groupUsers(':oid', ':key'),
|
|
@@ -409,7 +409,7 @@ export class SdkMock {
|
|
|
409
409
|
sessions: {
|
|
410
410
|
list: async (init, options) => {
|
|
411
411
|
const { mock } = this;
|
|
412
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapList(this.gen.ai.sessions('general', init?.size ?? 5), init), init);
|
|
412
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapList(this.gen.ai.sessions('general', init?.size ?? 5), init), init);
|
|
413
413
|
await mock.add({
|
|
414
414
|
match: {
|
|
415
415
|
uri: RouteBuilder.aiSessions(':oid', ':app'),
|
|
@@ -420,7 +420,7 @@ export class SdkMock {
|
|
|
420
420
|
},
|
|
421
421
|
create: async (init, options) => {
|
|
422
422
|
const { mock } = this;
|
|
423
|
-
const respond = this.createDefaultResponse(201, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.ai.session()), init);
|
|
423
|
+
const respond = this.createDefaultResponse(201, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.ai.session()), init);
|
|
424
424
|
await mock.add({
|
|
425
425
|
match: {
|
|
426
426
|
uri: RouteBuilder.aiSessions(':oid', ':app'),
|
|
@@ -431,7 +431,7 @@ export class SdkMock {
|
|
|
431
431
|
},
|
|
432
432
|
read: async (init, options) => {
|
|
433
433
|
const { mock } = this;
|
|
434
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.ai.session()), init);
|
|
434
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.ai.session()), init);
|
|
435
435
|
await mock.add({
|
|
436
436
|
match: {
|
|
437
437
|
uri: RouteBuilder.aiSession(':oid', ':app', ':sid'),
|
|
@@ -442,7 +442,7 @@ export class SdkMock {
|
|
|
442
442
|
},
|
|
443
443
|
update: async (init, options) => {
|
|
444
444
|
const { mock } = this;
|
|
445
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.ai.session()), init);
|
|
445
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.ai.session()), init);
|
|
446
446
|
await mock.add({
|
|
447
447
|
match: {
|
|
448
448
|
uri: RouteBuilder.aiSession(':oid', ':app', ':sid'),
|
|
@@ -466,7 +466,7 @@ export class SdkMock {
|
|
|
466
466
|
messages: {
|
|
467
467
|
list: async (init, options) => {
|
|
468
468
|
const { mock } = this;
|
|
469
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapList(this.gen.ai.messages(init?.size ?? 5), init), init);
|
|
469
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapList(this.gen.ai.messages(init?.size ?? 5), init), init);
|
|
470
470
|
await mock.add({
|
|
471
471
|
match: {
|
|
472
472
|
uri: RouteBuilder.aiMessages(':oid', ':sid'),
|
|
@@ -477,7 +477,7 @@ export class SdkMock {
|
|
|
477
477
|
},
|
|
478
478
|
update: async (init, options) => {
|
|
479
479
|
const { mock } = this;
|
|
480
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.ai.message()), init);
|
|
480
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.ai.message()), init);
|
|
481
481
|
await mock.add({
|
|
482
482
|
match: {
|
|
483
483
|
uri: RouteBuilder.aiMessage(':oid', ':sid', ':mid'),
|
|
@@ -521,7 +521,7 @@ export class SdkMock {
|
|
|
521
521
|
*/
|
|
522
522
|
me: async (init, options) => {
|
|
523
523
|
const { mock } = this;
|
|
524
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.users.user()), init);
|
|
524
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.users.user()), init);
|
|
525
525
|
await mock.add({
|
|
526
526
|
match: {
|
|
527
527
|
uri: RouteBuilder.usersMe(),
|
|
@@ -540,7 +540,7 @@ export class SdkMock {
|
|
|
540
540
|
*/
|
|
541
541
|
list: async (init, options) => {
|
|
542
542
|
const { mock } = this;
|
|
543
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapList(this.gen.files.files(init?.size ?? 5), init), init);
|
|
543
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapList(this.gen.files.files(init?.size ?? 5), init), init);
|
|
544
544
|
await mock.add({
|
|
545
545
|
match: {
|
|
546
546
|
uri: RouteBuilder.files(':oid'),
|
|
@@ -554,7 +554,7 @@ export class SdkMock {
|
|
|
554
554
|
*/
|
|
555
555
|
createMeta: async (init, options) => {
|
|
556
556
|
const { mock } = this;
|
|
557
|
-
const respond = this.createDefaultResponse(201, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.files.file()), init);
|
|
557
|
+
const respond = this.createDefaultResponse(201, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.files.file()), init);
|
|
558
558
|
await mock.add({
|
|
559
559
|
match: {
|
|
560
560
|
uri: RouteBuilder.files(':oid'),
|
|
@@ -592,7 +592,7 @@ export class SdkMock {
|
|
|
592
592
|
*/
|
|
593
593
|
createFolder: async (init, options) => {
|
|
594
594
|
const { mock } = this;
|
|
595
|
-
const respond = this.createDefaultResponse(201, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.files.folder()), init);
|
|
595
|
+
const respond = this.createDefaultResponse(201, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.files.folder()), init);
|
|
596
596
|
await mock.add({
|
|
597
597
|
match: {
|
|
598
598
|
uri: RouteBuilder.files(':oid'),
|
|
@@ -606,7 +606,7 @@ export class SdkMock {
|
|
|
606
606
|
*/
|
|
607
607
|
read: async (init, options) => {
|
|
608
608
|
const { mock } = this;
|
|
609
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.files.file()), init);
|
|
609
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.files.file()), init);
|
|
610
610
|
await mock.add({
|
|
611
611
|
match: {
|
|
612
612
|
uri: RouteBuilder.file(':oid', ':id'),
|
|
@@ -623,7 +623,7 @@ export class SdkMock {
|
|
|
623
623
|
const respond = this.createDefaultResponse(200, {
|
|
624
624
|
'content-type': 'application/json',
|
|
625
625
|
'x-version': `${this.gen.faker.number.int({ min: 1, max: 100 })}`,
|
|
626
|
-
}, () => this.wrapResource({ data: this.gen.faker.lorem.sentences() }), init);
|
|
626
|
+
}, () => this.gen.wrapResource({ data: this.gen.faker.lorem.sentences() }), init);
|
|
627
627
|
await mock.add({
|
|
628
628
|
match: {
|
|
629
629
|
uri: RouteBuilder.fileMedia(':oid', ':id'),
|
|
@@ -637,7 +637,7 @@ export class SdkMock {
|
|
|
637
637
|
*/
|
|
638
638
|
readBulk: async (init, options) => {
|
|
639
639
|
const { mock } = this;
|
|
640
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapList(this.gen.files.files(init?.size ?? 5), { cursor: false }), init);
|
|
640
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapList(this.gen.files.files(init?.size ?? 5), { cursor: false }), init);
|
|
641
641
|
await mock.add({
|
|
642
642
|
match: {
|
|
643
643
|
uri: RouteBuilder.filesBatch(':oid'),
|
|
@@ -651,7 +651,7 @@ export class SdkMock {
|
|
|
651
651
|
*/
|
|
652
652
|
patch: async (init, options) => {
|
|
653
653
|
const { mock } = this;
|
|
654
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.files.file()), init);
|
|
654
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.files.file()), init);
|
|
655
655
|
await mock.add({
|
|
656
656
|
match: {
|
|
657
657
|
uri: RouteBuilder.file(':oid', ':id'),
|
|
@@ -665,7 +665,7 @@ export class SdkMock {
|
|
|
665
665
|
*/
|
|
666
666
|
patchMedia: async (init, options) => {
|
|
667
667
|
const { mock } = this;
|
|
668
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.patch.mediaPatchRevision()), init);
|
|
668
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.patch.mediaPatchRevision()), init);
|
|
669
669
|
await mock.add({
|
|
670
670
|
match: {
|
|
671
671
|
uri: RouteBuilder.fileMedia(':oid', ':id'),
|
|
@@ -707,7 +707,7 @@ export class SdkMock {
|
|
|
707
707
|
*/
|
|
708
708
|
patchUsers: async (init, options) => {
|
|
709
709
|
const { mock } = this;
|
|
710
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapResource(this.gen.files.file()), init);
|
|
710
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapResource(this.gen.files.file()), init);
|
|
711
711
|
await mock.add({
|
|
712
712
|
match: {
|
|
713
713
|
uri: RouteBuilder.filesAccess(':oid', ':id'),
|
|
@@ -733,7 +733,7 @@ export class SdkMock {
|
|
|
733
733
|
*/
|
|
734
734
|
listUsers: async (init, options) => {
|
|
735
735
|
const { mock } = this;
|
|
736
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapList(this.gen.users.users(init?.size ?? 5), init), init);
|
|
736
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapList(this.gen.users.users(init?.size ?? 5), init), init);
|
|
737
737
|
await mock.add({
|
|
738
738
|
match: {
|
|
739
739
|
uri: RouteBuilder.fileUsers(':oid', ':id'),
|
|
@@ -747,7 +747,7 @@ export class SdkMock {
|
|
|
747
747
|
*/
|
|
748
748
|
breadcrumbs: async (init, options) => {
|
|
749
749
|
const { mock } = this;
|
|
750
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapList(this.gen.files.fileBreadcrumbs(init?.size ?? 5), init), init);
|
|
750
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapList(this.gen.files.fileBreadcrumbs(init?.size ?? 5), init), init);
|
|
751
751
|
await mock.add({
|
|
752
752
|
match: {
|
|
753
753
|
uri: RouteBuilder.fileBreadcrumbs(':oid', ':id'),
|
|
@@ -767,7 +767,7 @@ export class SdkMock {
|
|
|
767
767
|
shared = {
|
|
768
768
|
list: async (init, options) => {
|
|
769
769
|
const { mock } = this;
|
|
770
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapList(this.gen.files.files(init?.size ?? 5), init), init);
|
|
770
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapList(this.gen.files.files(init?.size ?? 5), init), init);
|
|
771
771
|
await mock.add({
|
|
772
772
|
match: {
|
|
773
773
|
uri: RouteBuilder.shared(':oid'),
|
|
@@ -783,7 +783,7 @@ export class SdkMock {
|
|
|
783
783
|
trash = {
|
|
784
784
|
list: async (init, options) => {
|
|
785
785
|
const { mock } = this;
|
|
786
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapList(this.gen.trash.trashEntries(init?.size ?? 5), init), init);
|
|
786
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapList(this.gen.trash.trashEntries(init?.size ?? 5), init), init);
|
|
787
787
|
await mock.add({
|
|
788
788
|
match: {
|
|
789
789
|
uri: RouteBuilder.trash(':oid'),
|
|
@@ -883,7 +883,7 @@ export class SdkMock {
|
|
|
883
883
|
}
|
|
884
884
|
});
|
|
885
885
|
}
|
|
886
|
-
return this.wrapList(data, init);
|
|
886
|
+
return this.gen.wrapList(data, init);
|
|
887
887
|
}, init);
|
|
888
888
|
await mock.add({
|
|
889
889
|
match: {
|
|
@@ -905,7 +905,7 @@ export class SdkMock {
|
|
|
905
905
|
env: payload.env,
|
|
906
906
|
...(payload.env === DeploymentEnvironment.PROD ? { version: payload.version } : {}),
|
|
907
907
|
});
|
|
908
|
-
return this.wrapResource(obj);
|
|
908
|
+
return this.gen.wrapResource(obj);
|
|
909
909
|
}, init);
|
|
910
910
|
await mock.add({
|
|
911
911
|
match: {
|
|
@@ -922,7 +922,7 @@ export class SdkMock {
|
|
|
922
922
|
key: req.params.id,
|
|
923
923
|
orgId: req.params.oid,
|
|
924
924
|
});
|
|
925
|
-
return this.wrapResource(obj);
|
|
925
|
+
return this.gen.wrapResource(obj);
|
|
926
926
|
}, init);
|
|
927
927
|
await mock.add({
|
|
928
928
|
match: {
|
|
@@ -940,7 +940,7 @@ export class SdkMock {
|
|
|
940
940
|
orgId: req.params.oid,
|
|
941
941
|
status: DeploymentStatus.Inactive,
|
|
942
942
|
});
|
|
943
|
-
return this.wrapResource(obj);
|
|
943
|
+
return this.gen.wrapResource(obj);
|
|
944
944
|
}, init);
|
|
945
945
|
await mock.add({
|
|
946
946
|
match: {
|
|
@@ -967,7 +967,7 @@ export class SdkMock {
|
|
|
967
967
|
if (hasDev) {
|
|
968
968
|
obj.dev = this.gen.deployments.deployment();
|
|
969
969
|
}
|
|
970
|
-
return this.wrapResource(obj);
|
|
970
|
+
return this.gen.wrapResource(obj);
|
|
971
971
|
}, init);
|
|
972
972
|
await mock.add({
|
|
973
973
|
match: {
|
|
@@ -979,7 +979,7 @@ export class SdkMock {
|
|
|
979
979
|
},
|
|
980
980
|
list: async (init, options) => {
|
|
981
981
|
const { mock } = this;
|
|
982
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapList(this.gen.deployments.deploymentApis(init?.size ?? 5), { cursor: false }), init);
|
|
982
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapList(this.gen.deployments.deploymentApis(init?.size ?? 5), { cursor: false }), init);
|
|
983
983
|
await mock.add({
|
|
984
984
|
match: {
|
|
985
985
|
uri: RouteBuilder.deploymentsApis(':oid'),
|
|
@@ -996,7 +996,7 @@ export class SdkMock {
|
|
|
996
996
|
dataCatalog = {
|
|
997
997
|
list: async (init, options) => {
|
|
998
998
|
const { mock } = this;
|
|
999
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapList(this.gen.dataCatalog.dataCatalogsWithVersion(init?.size ?? 5), init), init);
|
|
999
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapList(this.gen.dataCatalog.dataCatalogsWithVersion(init?.size ?? 5), init), init);
|
|
1000
1000
|
await mock.add({
|
|
1001
1001
|
match: {
|
|
1002
1002
|
uri: RouteBuilder.dataCatalog(),
|
|
@@ -1007,7 +1007,7 @@ export class SdkMock {
|
|
|
1007
1007
|
},
|
|
1008
1008
|
listVersions: async (init, options) => {
|
|
1009
1009
|
const { mock } = this;
|
|
1010
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.wrapList(this.gen.dataCatalog.versionInfos(init?.size ?? 5), init), init);
|
|
1010
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => this.gen.wrapList(this.gen.dataCatalog.versionInfos(init?.size ?? 5), init), init);
|
|
1011
1011
|
await mock.add({
|
|
1012
1012
|
match: {
|
|
1013
1013
|
uri: RouteBuilder.dataCatalogEntryVersions(':id'),
|
|
@@ -1025,7 +1025,7 @@ export class SdkMock {
|
|
|
1025
1025
|
item: obj,
|
|
1026
1026
|
kind: obj.kind,
|
|
1027
1027
|
};
|
|
1028
|
-
return this.wrapResource(result);
|
|
1028
|
+
return this.gen.wrapResource(result);
|
|
1029
1029
|
}, init);
|
|
1030
1030
|
await mock.add({
|
|
1031
1031
|
match: {
|
|
@@ -1039,7 +1039,7 @@ export class SdkMock {
|
|
|
1039
1039
|
const { mock } = this;
|
|
1040
1040
|
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, (req) => {
|
|
1041
1041
|
const obj = this.gen.dataCatalog.dataCatalog({ key: req.params.id });
|
|
1042
|
-
return this.wrapResource(obj);
|
|
1042
|
+
return this.gen.wrapResource(obj);
|
|
1043
1043
|
}, init);
|
|
1044
1044
|
await mock.add({
|
|
1045
1045
|
match: {
|
|
@@ -1058,7 +1058,7 @@ export class SdkMock {
|
|
|
1058
1058
|
item: obj,
|
|
1059
1059
|
kind: obj.kind,
|
|
1060
1060
|
};
|
|
1061
|
-
return this.wrapResource(result);
|
|
1061
|
+
return this.gen.wrapResource(result);
|
|
1062
1062
|
}, init);
|
|
1063
1063
|
await mock.add({
|
|
1064
1064
|
match: {
|
|
@@ -1077,7 +1077,7 @@ export class SdkMock {
|
|
|
1077
1077
|
item: obj,
|
|
1078
1078
|
kind: obj.kind,
|
|
1079
1079
|
};
|
|
1080
|
-
return this.wrapResource(result);
|
|
1080
|
+
return this.gen.wrapResource(result);
|
|
1081
1081
|
}, init);
|
|
1082
1082
|
await mock.add({
|
|
1083
1083
|
match: {
|
|
@@ -1097,7 +1097,7 @@ export class SdkMock {
|
|
|
1097
1097
|
item: body,
|
|
1098
1098
|
kind: body.kind,
|
|
1099
1099
|
};
|
|
1100
|
-
return this.wrapResource(result);
|
|
1100
|
+
return this.gen.wrapResource(result);
|
|
1101
1101
|
}, init);
|
|
1102
1102
|
await mock.add({
|
|
1103
1103
|
match: {
|
|
@@ -1111,7 +1111,7 @@ export class SdkMock {
|
|
|
1111
1111
|
const { mock } = this;
|
|
1112
1112
|
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, (req) => {
|
|
1113
1113
|
const obj = this.gen.dataCatalog.dataCatalogVersion({ key: req.params.vid, catalogKey: req.params.id });
|
|
1114
|
-
return this.wrapResource(obj);
|
|
1114
|
+
return this.gen.wrapResource(obj);
|
|
1115
1115
|
}, init);
|
|
1116
1116
|
await mock.add({
|
|
1117
1117
|
match: {
|
|
@@ -1133,7 +1133,7 @@ export class SdkMock {
|
|
|
1133
1133
|
});
|
|
1134
1134
|
data.push(domain.toJSON());
|
|
1135
1135
|
}
|
|
1136
|
-
return this.wrapList(data, { cursor: false });
|
|
1136
|
+
return this.gen.wrapList(data, { cursor: false });
|
|
1137
1137
|
}, init);
|
|
1138
1138
|
await mock.add({
|
|
1139
1139
|
match: {
|
|
@@ -1157,7 +1157,7 @@ export class SdkMock {
|
|
|
1157
1157
|
item: obj,
|
|
1158
1158
|
kind: obj.kind,
|
|
1159
1159
|
};
|
|
1160
|
-
return this.wrapResource(result);
|
|
1160
|
+
return this.gen.wrapResource(result);
|
|
1161
1161
|
}, init);
|
|
1162
1162
|
await mock.add({
|
|
1163
1163
|
match: {
|
|
@@ -1178,7 +1178,7 @@ export class SdkMock {
|
|
|
1178
1178
|
item: obj,
|
|
1179
1179
|
kind: obj.kind,
|
|
1180
1180
|
};
|
|
1181
|
-
return this.wrapResource(result);
|
|
1181
|
+
return this.gen.wrapResource(result);
|
|
1182
1182
|
}, init);
|
|
1183
1183
|
await mock.add({
|
|
1184
1184
|
match: {
|
|
@@ -1193,7 +1193,7 @@ export class SdkMock {
|
|
|
1193
1193
|
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => {
|
|
1194
1194
|
const obj = this.gen.dataCatalog.dataCatalog();
|
|
1195
1195
|
obj.versions = this.gen.dataCatalog.versionInfos(1);
|
|
1196
|
-
return this.wrapResource(obj);
|
|
1196
|
+
return this.gen.wrapResource(obj);
|
|
1197
1197
|
}, init);
|
|
1198
1198
|
await mock.add({
|
|
1199
1199
|
match: {
|
|
@@ -1235,19 +1235,6 @@ export class SdkMock {
|
|
|
1235
1235
|
}
|
|
1236
1236
|
return limit;
|
|
1237
1237
|
}
|
|
1238
|
-
createCursorOption(init = {}) {
|
|
1239
|
-
if (init.cursor === false) {
|
|
1240
|
-
return undefined;
|
|
1241
|
-
}
|
|
1242
|
-
if (typeof init.cursor === 'string') {
|
|
1243
|
-
return init.cursor;
|
|
1244
|
-
}
|
|
1245
|
-
const hasCursor = init.cursor === true ? true : this.gen.faker.datatype.boolean();
|
|
1246
|
-
if (!hasCursor) {
|
|
1247
|
-
return undefined;
|
|
1248
|
-
}
|
|
1249
|
-
return this.gen.faker.internet.jwt();
|
|
1250
|
-
}
|
|
1251
1238
|
createDefaultResponse(status, headers, body, userConfig) {
|
|
1252
1239
|
let respond;
|
|
1253
1240
|
if (userConfig?.response) {
|
|
@@ -1276,18 +1263,5 @@ export class SdkMock {
|
|
|
1276
1263
|
}
|
|
1277
1264
|
return respond;
|
|
1278
1265
|
}
|
|
1279
|
-
wrapResource(resource) {
|
|
1280
|
-
const wrapper = {
|
|
1281
|
-
data: resource,
|
|
1282
|
-
};
|
|
1283
|
-
return JSON.stringify(wrapper);
|
|
1284
|
-
}
|
|
1285
|
-
wrapList(items, init) {
|
|
1286
|
-
const obj = {
|
|
1287
|
-
data: items,
|
|
1288
|
-
cursor: this.createCursorOption(init),
|
|
1289
|
-
};
|
|
1290
|
-
return JSON.stringify(obj);
|
|
1291
|
-
}
|
|
1292
1266
|
}
|
|
1293
1267
|
//# sourceMappingURL=SdkMock.js.map
|