@api-client/core 0.18.41 → 0.18.47
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 +2 -2
- package/build/src/mocking/ModelingMock.d.ts.map +1 -1
- package/build/src/mocking/ModelingMock.js +2 -2
- package/build/src/mocking/ModelingMock.js.map +1 -1
- package/build/src/sdk/FilesSdk.js +1 -1
- package/build/src/sdk/FilesSdk.js.map +1 -1
- package/build/src/sdk/Sdk.d.ts +10 -2
- package/build/src/sdk/Sdk.d.ts.map +1 -1
- package/build/src/sdk/Sdk.js +12 -4
- package/build/src/sdk/Sdk.js.map +1 -1
- package/build/src/sdk/SdkMock.d.ts +73 -0
- package/build/src/sdk/SdkMock.d.ts.map +1 -1
- package/build/src/sdk/SdkMock.js +40 -36
- package/build/src/sdk/SdkMock.js.map +1 -1
- package/build/src/sdk/SharedSdk.js +1 -1
- package/build/src/sdk/SharedSdk.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/data/models/example-generator-api.json +12 -12
- package/package.json +1 -1
- package/src/mocking/ModelingMock.ts +2 -2
- package/src/sdk/FilesSdk.ts +1 -1
- package/src/sdk/Sdk.ts +12 -4
- package/src/sdk/SdkMock.ts +41 -36
- package/src/sdk/SharedSdk.ts +1 -1
- package/build/oauth-popup.html +0 -33
package/build/src/sdk/SdkMock.js
CHANGED
|
@@ -313,13 +313,13 @@ export class SdkMock {
|
|
|
313
313
|
// status: 200,
|
|
314
314
|
// headers: { 'content-type': 'application/json' },
|
|
315
315
|
// body: JSON.stringify({
|
|
316
|
-
// items: this.gen.
|
|
316
|
+
// items: this.gen.users.users(init?.size ?? 5),
|
|
317
317
|
// cursor: this.createCursorOption(init),
|
|
318
318
|
// } as ContextListResult<IUser>),
|
|
319
319
|
// }
|
|
320
320
|
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => {
|
|
321
321
|
const obj = {
|
|
322
|
-
items: this.gen.
|
|
322
|
+
items: this.gen.users.users(init?.size ?? 5),
|
|
323
323
|
cursor: this.createCursorOption(init),
|
|
324
324
|
};
|
|
325
325
|
return JSON.stringify(obj);
|
|
@@ -337,9 +337,9 @@ export class SdkMock {
|
|
|
337
337
|
// const respond = init?.response ?? {
|
|
338
338
|
// status: 200,
|
|
339
339
|
// headers: { 'content-type': 'application/json' },
|
|
340
|
-
// body: JSON.stringify(this.gen.
|
|
340
|
+
// body: JSON.stringify(this.gen.users.user()),
|
|
341
341
|
// }
|
|
342
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => JSON.stringify(this.gen.
|
|
342
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => JSON.stringify(this.gen.users.user()), init);
|
|
343
343
|
await mock.add({
|
|
344
344
|
match: {
|
|
345
345
|
uri: RouteBuilder.organizationUser(':oid', ':id'),
|
|
@@ -355,7 +355,7 @@ export class SdkMock {
|
|
|
355
355
|
status: 200,
|
|
356
356
|
headers: { 'content-type': 'application/json' },
|
|
357
357
|
body: JSON.stringify({
|
|
358
|
-
items: this.gen.
|
|
358
|
+
items: this.gen.users.users(init?.size ?? 5),
|
|
359
359
|
cursor: this.createCursorOption(init),
|
|
360
360
|
}),
|
|
361
361
|
};
|
|
@@ -372,9 +372,9 @@ export class SdkMock {
|
|
|
372
372
|
// const respond = init?.response ?? {
|
|
373
373
|
// status: 200,
|
|
374
374
|
// headers: { 'content-type': 'application/json' },
|
|
375
|
-
// body: JSON.stringify(this.gen.
|
|
375
|
+
// body: JSON.stringify(this.gen.users.user()),
|
|
376
376
|
// }
|
|
377
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => JSON.stringify(this.gen.
|
|
377
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => JSON.stringify(this.gen.users.user()), init);
|
|
378
378
|
await mock.add({
|
|
379
379
|
match: {
|
|
380
380
|
uri: RouteBuilder.organizationUserActivate(':oid', ':id'),
|
|
@@ -388,9 +388,9 @@ export class SdkMock {
|
|
|
388
388
|
// const respond = init?.response ?? {
|
|
389
389
|
// status: 200,
|
|
390
390
|
// headers: { 'content-type': 'application/json' },
|
|
391
|
-
// body: JSON.stringify(this.gen.
|
|
391
|
+
// body: JSON.stringify(this.gen.users.user()),
|
|
392
392
|
// }
|
|
393
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => JSON.stringify(this.gen.
|
|
393
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => JSON.stringify(this.gen.users.user()), init);
|
|
394
394
|
await mock.add({
|
|
395
395
|
match: {
|
|
396
396
|
uri: RouteBuilder.organizationUserDeactivate(':oid', ':id'),
|
|
@@ -558,9 +558,9 @@ export class SdkMock {
|
|
|
558
558
|
// const respond = init?.response ?? {
|
|
559
559
|
// status: 200,
|
|
560
560
|
// headers: { 'content-type': 'application/json' },
|
|
561
|
-
// body: JSON.stringify(this.gen.
|
|
561
|
+
// body: JSON.stringify(this.gen.users.user()),
|
|
562
562
|
// }
|
|
563
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => JSON.stringify(this.gen.
|
|
563
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => JSON.stringify(this.gen.users.user()), init);
|
|
564
564
|
await mock.add({
|
|
565
565
|
match: {
|
|
566
566
|
uri: RouteBuilder.usersMe(),
|
|
@@ -573,7 +573,7 @@ export class SdkMock {
|
|
|
573
573
|
/**
|
|
574
574
|
* Files API mocks.
|
|
575
575
|
*/
|
|
576
|
-
|
|
576
|
+
files = {
|
|
577
577
|
/**
|
|
578
578
|
* Mocks the `file.list()` method.
|
|
579
579
|
*/
|
|
@@ -583,13 +583,13 @@ export class SdkMock {
|
|
|
583
583
|
// status: 200,
|
|
584
584
|
// headers: { 'content-type': 'application/json' },
|
|
585
585
|
// body: JSON.stringify({
|
|
586
|
-
// items: this.gen.
|
|
586
|
+
// items: this.gen.files.files(init?.size ?? 5),
|
|
587
587
|
// cursor: this.createCursorOption(init),
|
|
588
588
|
// } as ContextListResult<IFile>),
|
|
589
589
|
// }
|
|
590
590
|
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => {
|
|
591
591
|
const obj = {
|
|
592
|
-
items: this.gen.
|
|
592
|
+
items: this.gen.files.files(init?.size ?? 5),
|
|
593
593
|
cursor: this.createCursorOption(init),
|
|
594
594
|
};
|
|
595
595
|
return JSON.stringify(obj);
|
|
@@ -610,9 +610,9 @@ export class SdkMock {
|
|
|
610
610
|
// const respond = init?.response ?? {
|
|
611
611
|
// status: 201,
|
|
612
612
|
// headers: { 'content-type': 'application/json' },
|
|
613
|
-
// body: JSON.stringify(this.gen.
|
|
613
|
+
// body: JSON.stringify(this.gen.files.file()),
|
|
614
614
|
// }
|
|
615
|
-
const respond = this.createDefaultResponse(201, { 'content-type': 'application/json' }, () => JSON.stringify(this.gen.
|
|
615
|
+
const respond = this.createDefaultResponse(201, { 'content-type': 'application/json' }, () => JSON.stringify(this.gen.files.file()), init);
|
|
616
616
|
await mock.add({
|
|
617
617
|
match: {
|
|
618
618
|
uri: RouteBuilder.files(':oid'),
|
|
@@ -642,11 +642,11 @@ export class SdkMock {
|
|
|
642
642
|
* Mocks the `file.create()` method.
|
|
643
643
|
*/
|
|
644
644
|
create: async (init, options) => {
|
|
645
|
-
await this.
|
|
645
|
+
await this.files.createMeta(init, options);
|
|
646
646
|
// When SDK's file.create() is called, it responds with
|
|
647
647
|
// what the result of file.createMeta() would be.
|
|
648
648
|
// Because of that, we don't need to configure the media request.
|
|
649
|
-
await this.
|
|
649
|
+
await this.files.createMedia(undefined, options);
|
|
650
650
|
},
|
|
651
651
|
/**
|
|
652
652
|
* Mocks the `file.createFolder()` method.
|
|
@@ -656,9 +656,9 @@ export class SdkMock {
|
|
|
656
656
|
// const respond = init?.response ?? {
|
|
657
657
|
// status: 201,
|
|
658
658
|
// headers: { 'content-type': 'application/json' },
|
|
659
|
-
// body: JSON.stringify(this.gen.
|
|
659
|
+
// body: JSON.stringify(this.gen.files.folder()),
|
|
660
660
|
// }
|
|
661
|
-
const respond = this.createDefaultResponse(201, { 'content-type': 'application/json' }, () => JSON.stringify(this.gen.
|
|
661
|
+
const respond = this.createDefaultResponse(201, { 'content-type': 'application/json' }, () => JSON.stringify(this.gen.files.folder()), init);
|
|
662
662
|
await mock.add({
|
|
663
663
|
match: {
|
|
664
664
|
uri: RouteBuilder.files(':oid'),
|
|
@@ -675,9 +675,9 @@ export class SdkMock {
|
|
|
675
675
|
// const respond = init?.response ?? {
|
|
676
676
|
// status: 200,
|
|
677
677
|
// headers: { 'content-type': 'application/json' },
|
|
678
|
-
// body: JSON.stringify(this.gen.
|
|
678
|
+
// body: JSON.stringify(this.gen.files.file()),
|
|
679
679
|
// }
|
|
680
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => JSON.stringify(this.gen.
|
|
680
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => JSON.stringify(this.gen.files.file()), init);
|
|
681
681
|
await mock.add({
|
|
682
682
|
match: {
|
|
683
683
|
uri: RouteBuilder.file(':oid', ':id'),
|
|
@@ -720,12 +720,12 @@ export class SdkMock {
|
|
|
720
720
|
// status: 200,
|
|
721
721
|
// headers: { 'content-type': 'application/json' },
|
|
722
722
|
// body: JSON.stringify({
|
|
723
|
-
// items: this.gen.
|
|
723
|
+
// items: this.gen.files.files(init?.size ?? 5),
|
|
724
724
|
// } as IBulkOperationResult<IFile>),
|
|
725
725
|
// }
|
|
726
726
|
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => {
|
|
727
727
|
const obj = {
|
|
728
|
-
items: this.gen.
|
|
728
|
+
items: this.gen.files.files(init?.size ?? 5),
|
|
729
729
|
};
|
|
730
730
|
return JSON.stringify(obj);
|
|
731
731
|
}, init);
|
|
@@ -745,9 +745,9 @@ export class SdkMock {
|
|
|
745
745
|
// const respond = init?.response ?? {
|
|
746
746
|
// status: 200,
|
|
747
747
|
// headers: { 'content-type': 'application/json' },
|
|
748
|
-
// body: JSON.stringify(this.gen.
|
|
748
|
+
// body: JSON.stringify(this.gen.files.file()),
|
|
749
749
|
// }
|
|
750
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => JSON.stringify(this.gen.
|
|
750
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => JSON.stringify(this.gen.files.file()), init);
|
|
751
751
|
await mock.add({
|
|
752
752
|
match: {
|
|
753
753
|
uri: RouteBuilder.file(':oid', ':id'),
|
|
@@ -817,9 +817,9 @@ export class SdkMock {
|
|
|
817
817
|
// const respond = init?.response ?? {
|
|
818
818
|
// status: 200,
|
|
819
819
|
// headers: { 'content-type': 'application/json' },
|
|
820
|
-
// body: JSON.stringify(this.gen.
|
|
820
|
+
// body: JSON.stringify(this.gen.files.file()),
|
|
821
821
|
// }
|
|
822
|
-
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => JSON.stringify(this.gen.
|
|
822
|
+
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => JSON.stringify(this.gen.files.file()), init);
|
|
823
823
|
await mock.add({
|
|
824
824
|
match: {
|
|
825
825
|
uri: RouteBuilder.filesAccess(':oid', ':id'),
|
|
@@ -832,13 +832,13 @@ export class SdkMock {
|
|
|
832
832
|
* Mocks the `file.addUser()` method.
|
|
833
833
|
*/
|
|
834
834
|
addUser: async (init, options) => {
|
|
835
|
-
await this.
|
|
835
|
+
await this.files.patchUsers(init, options);
|
|
836
836
|
},
|
|
837
837
|
/**
|
|
838
838
|
* Mocks the `file.removeUser()` method.
|
|
839
839
|
*/
|
|
840
840
|
removeUser: async (init, options) => {
|
|
841
|
-
await this.
|
|
841
|
+
await this.files.patchUsers(init, options);
|
|
842
842
|
},
|
|
843
843
|
/**
|
|
844
844
|
* Mocks the `file.listUsers()` method.
|
|
@@ -849,13 +849,13 @@ export class SdkMock {
|
|
|
849
849
|
// status: 200,
|
|
850
850
|
// headers: { 'content-type': 'application/json' },
|
|
851
851
|
// body: JSON.stringify({
|
|
852
|
-
// items: this.gen.
|
|
852
|
+
// items: this.gen.users.users(init?.size ?? 5),
|
|
853
853
|
// cursor: this.createCursorOption(init),
|
|
854
854
|
// } as ContextListResult<IUser>),
|
|
855
855
|
// }
|
|
856
856
|
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => {
|
|
857
857
|
const obj = {
|
|
858
|
-
items: this.gen.
|
|
858
|
+
items: this.gen.users.users(init?.size ?? 5),
|
|
859
859
|
cursor: this.createCursorOption(init),
|
|
860
860
|
};
|
|
861
861
|
return JSON.stringify(obj);
|
|
@@ -877,13 +877,13 @@ export class SdkMock {
|
|
|
877
877
|
// status: 200,
|
|
878
878
|
// headers: { 'content-type': 'application/json' },
|
|
879
879
|
// body: JSON.stringify({
|
|
880
|
-
// items: this.gen.
|
|
880
|
+
// items: this.gen.files.fileBreadcrumbs(init?.size ?? 5),
|
|
881
881
|
// cursor: this.createCursorOption(init),
|
|
882
882
|
// } as ContextListResult<FileBreadcrumb>),
|
|
883
883
|
// }
|
|
884
884
|
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => {
|
|
885
885
|
const obj = {
|
|
886
|
-
items: this.gen.
|
|
886
|
+
items: this.gen.files.fileBreadcrumbs(init?.size ?? 5),
|
|
887
887
|
cursor: this.createCursorOption(init),
|
|
888
888
|
};
|
|
889
889
|
return JSON.stringify(obj);
|
|
@@ -897,6 +897,10 @@ export class SdkMock {
|
|
|
897
897
|
}, options);
|
|
898
898
|
},
|
|
899
899
|
};
|
|
900
|
+
/**
|
|
901
|
+
* @deprecated Use `files` instead.
|
|
902
|
+
*/
|
|
903
|
+
file = this.files;
|
|
900
904
|
/**
|
|
901
905
|
* Shared API mocks.
|
|
902
906
|
*/
|
|
@@ -907,13 +911,13 @@ export class SdkMock {
|
|
|
907
911
|
// status: 200,
|
|
908
912
|
// headers: { 'content-type': 'application/json' },
|
|
909
913
|
// body: JSON.stringify({
|
|
910
|
-
// items: this.gen.
|
|
914
|
+
// items: this.gen.files.files(init?.size ?? 5),
|
|
911
915
|
// cursor: this.createCursorOption(init),
|
|
912
916
|
// } as ContextListResult<IFile>),
|
|
913
917
|
// }
|
|
914
918
|
const respond = this.createDefaultResponse(200, { 'content-type': 'application/json' }, () => {
|
|
915
919
|
const obj = {
|
|
916
|
-
items: this.gen.
|
|
920
|
+
items: this.gen.files.files(init?.size ?? 5),
|
|
917
921
|
cursor: this.createCursorOption(init),
|
|
918
922
|
};
|
|
919
923
|
return JSON.stringify(obj);
|