@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.
@@ -42065,13 +42065,13 @@
42065
42065
  "@id": "#191"
42066
42066
  },
42067
42067
  {
42068
- "@id": "#197"
42068
+ "@id": "#200"
42069
42069
  },
42070
42070
  {
42071
42071
  "@id": "#194"
42072
42072
  },
42073
42073
  {
42074
- "@id": "#200"
42074
+ "@id": "#197"
42075
42075
  },
42076
42076
  {
42077
42077
  "@id": "#203"
@@ -42813,10 +42813,10 @@
42813
42813
  "@id": "#210"
42814
42814
  },
42815
42815
  {
42816
- "@id": "#216"
42816
+ "@id": "#213"
42817
42817
  },
42818
42818
  {
42819
- "@id": "#213"
42819
+ "@id": "#216"
42820
42820
  },
42821
42821
  {
42822
42822
  "@id": "#219"
@@ -43478,7 +43478,7 @@
43478
43478
  "doc:ExternalDomainElement",
43479
43479
  "doc:DomainElement"
43480
43480
  ],
43481
- "doc:raw": "addressType: 'REGISTERED-OFFICE-ADDRESS'\nstreetName: 'UITBREIDINGSTRAAT'\nhouseNumber: '84'\nhouseNumberAddition: '/1'\npostalCode: '2600'\ncity: 'BERCHEM (ANTWERPEN)'\ncountry: 'Belgium'\ncountryCode: 'BE'\nfullFormatedAddress: \"UITBREIDINGSTRAAT 84 /1, 2600 BERCHEM (ANTWERPEN), BELIUM\"\n",
43481
+ "doc:raw": "class: '3'\ndescription: '150 - 300'\nnumberOfFte: 5500\nnumberOfEmployees: 5232\n",
43482
43482
  "core:mediaType": "application/yaml",
43483
43483
  "sourcemaps:sources": [
43484
43484
  {
@@ -43499,7 +43499,7 @@
43499
43499
  "doc:ExternalDomainElement",
43500
43500
  "doc:DomainElement"
43501
43501
  ],
43502
- "doc:raw": "class: '3'\ndescription: '150 - 300'\nnumberOfFte: 5500\nnumberOfEmployees: 5232\n",
43502
+ "doc:raw": "addressType: 'REGISTERED-OFFICE-ADDRESS'\nstreetName: 'UITBREIDINGSTRAAT'\nhouseNumber: '84'\nhouseNumberAddition: '/1'\npostalCode: '2600'\ncity: 'BERCHEM (ANTWERPEN)'\ncountry: 'Belgium'\ncountryCode: 'BE'\nfullFormatedAddress: \"UITBREIDINGSTRAAT 84 /1, 2600 BERCHEM (ANTWERPEN), BELIUM\"\n",
43503
43503
  "core:mediaType": "application/yaml",
43504
43504
  "sourcemaps:sources": [
43505
43505
  {
@@ -44253,7 +44253,7 @@
44253
44253
  "doc:ExternalDomainElement",
44254
44254
  "doc:DomainElement"
44255
44255
  ],
44256
- "doc:raw": "-\n type: 'GENERAL'\n value: 'info@company.be'\n-\n type: 'IT_DEPT'\n value: 'it-service@company.be'\n",
44256
+ "doc:raw": "type: 'GENERAL'\ncountryDialCode : '+32'\nareaCode : '21'\nsubscriberNumber: '12.87.00'\nformatted: '+32-(0)21 302099'\n",
44257
44257
  "core:mediaType": "application/yaml",
44258
44258
  "sourcemaps:sources": [
44259
44259
  {
@@ -44274,7 +44274,7 @@
44274
44274
  "doc:ExternalDomainElement",
44275
44275
  "doc:DomainElement"
44276
44276
  ],
44277
- "doc:raw": "type: 'GENERAL'\ncountryDialCode : '+32'\nareaCode : '21'\nsubscriberNumber: '12.87.00'\nformatted: '+32-(0)21 302099'\n",
44277
+ "doc:raw": "-\n type: 'GENERAL'\n value: 'info@company.be'\n-\n type: 'IT_DEPT'\n value: 'it-service@company.be'\n",
44278
44278
  "core:mediaType": "application/yaml",
44279
44279
  "sourcemaps:sources": [
44280
44280
  {
@@ -44766,12 +44766,12 @@
44766
44766
  {
44767
44767
  "@id": "#199/source-map/lexical/element_0",
44768
44768
  "sourcemaps:element": "amf://id#199",
44769
- "sourcemaps:value": "[(1,0)-(10,0)]"
44769
+ "sourcemaps:value": "[(1,0)-(5,0)]"
44770
44770
  },
44771
44771
  {
44772
44772
  "@id": "#202/source-map/lexical/element_0",
44773
44773
  "sourcemaps:element": "amf://id#202",
44774
- "sourcemaps:value": "[(1,0)-(5,0)]"
44774
+ "sourcemaps:value": "[(1,0)-(10,0)]"
44775
44775
  },
44776
44776
  {
44777
44777
  "@id": "#205/source-map/lexical/element_0",
@@ -45121,12 +45121,12 @@
45121
45121
  {
45122
45122
  "@id": "#215/source-map/lexical/element_0",
45123
45123
  "sourcemaps:element": "amf://id#215",
45124
- "sourcemaps:value": "[(1,0)-(7,0)]"
45124
+ "sourcemaps:value": "[(1,0)-(6,0)]"
45125
45125
  },
45126
45126
  {
45127
45127
  "@id": "#218/source-map/lexical/element_0",
45128
45128
  "sourcemaps:element": "amf://id#218",
45129
- "sourcemaps:value": "[(1,0)-(6,0)]"
45129
+ "sourcemaps:value": "[(1,0)-(7,0)]"
45130
45130
  },
45131
45131
  {
45132
45132
  "@id": "#221/source-map/lexical/element_0",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@api-client/core",
3
3
  "description": "The API Client's core client library. Works in NodeJS and in a ES enabled browser.",
4
- "version": "0.18.41",
4
+ "version": "0.18.47",
5
5
  "license": "Apache-2.0",
6
6
  "exports": {
7
7
  "./browser.js": {
@@ -12,8 +12,8 @@ export class ModelingMock {
12
12
  faker: Faker = faker
13
13
  organization = new Organization()
14
14
  group = new Group()
15
- user = new User()
16
- file = new File()
15
+ users = new User()
16
+ files = new File()
17
17
  invitation = new Invitation()
18
18
  trash = new Trash()
19
19
  patch = new Patch()
@@ -568,7 +568,7 @@ export class FilesSdk extends SdkBase {
568
568
  const url = this.sdk.getUrl(RouteBuilder.fileBreadcrumbs(organization, key))
569
569
  const result = await this.sdk.http.get(url.toString(), { token })
570
570
  this.inspectCommonStatusCodes(result)
571
- const E_PREFIX = 'Unable to read a file. '
571
+ const E_PREFIX = 'Unable to read breadcrumbs. '
572
572
  if (result.status !== 200) {
573
573
  this.logInvalidResponse(result)
574
574
  throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)
package/src/sdk/Sdk.ts CHANGED
@@ -38,13 +38,21 @@ export abstract class Sdk {
38
38
  */
39
39
  auth = new AuthSdk(this)
40
40
  /**
41
- * The user organizations features.
41
+ * The user files features.
42
42
  */
43
- file = new FilesSdk(this)
43
+ files = new FilesSdk(this)
44
44
  /**
45
- * Reads user information.
45
+ * @deprecated Use `files` instead.
46
46
  */
47
- user = new UsersSdk(this)
47
+ file = this.files
48
+ /**
49
+ * User management features.
50
+ */
51
+ users = new UsersSdk(this)
52
+ /**
53
+ * @deprecated Use `users` instead.
54
+ */
55
+ user = this.users
48
56
  /**
49
57
  * The HTTP(S) requests.
50
58
  */
@@ -450,7 +450,7 @@ export class SdkMock {
450
450
  // status: 200,
451
451
  // headers: { 'content-type': 'application/json' },
452
452
  // body: JSON.stringify({
453
- // items: this.gen.user.users(init?.size ?? 5),
453
+ // items: this.gen.users.users(init?.size ?? 5),
454
454
  // cursor: this.createCursorOption(init),
455
455
  // } as ContextListResult<IUser>),
456
456
  // }
@@ -459,7 +459,7 @@ export class SdkMock {
459
459
  { 'content-type': 'application/json' },
460
460
  () => {
461
461
  const obj: ContextListResult<IUser> = {
462
- items: this.gen.user.users(init?.size ?? 5),
462
+ items: this.gen.users.users(init?.size ?? 5),
463
463
  cursor: this.createCursorOption(init),
464
464
  }
465
465
  return JSON.stringify(obj)
@@ -482,12 +482,12 @@ export class SdkMock {
482
482
  // const respond = init?.response ?? {
483
483
  // status: 200,
484
484
  // headers: { 'content-type': 'application/json' },
485
- // body: JSON.stringify(this.gen.user.user()),
485
+ // body: JSON.stringify(this.gen.users.user()),
486
486
  // }
487
487
  const respond = this.createDefaultResponse(
488
488
  200,
489
489
  { 'content-type': 'application/json' },
490
- () => JSON.stringify(this.gen.user.user()),
490
+ () => JSON.stringify(this.gen.users.user()),
491
491
  init
492
492
  )
493
493
  await mock.add(
@@ -508,7 +508,7 @@ export class SdkMock {
508
508
  status: 200,
509
509
  headers: { 'content-type': 'application/json' },
510
510
  body: JSON.stringify({
511
- items: this.gen.user.users(init?.size ?? 5),
511
+ items: this.gen.users.users(init?.size ?? 5),
512
512
  cursor: this.createCursorOption(init),
513
513
  } as ContextListResult<IUser>),
514
514
  }
@@ -528,12 +528,12 @@ export class SdkMock {
528
528
  // const respond = init?.response ?? {
529
529
  // status: 200,
530
530
  // headers: { 'content-type': 'application/json' },
531
- // body: JSON.stringify(this.gen.user.user()),
531
+ // body: JSON.stringify(this.gen.users.user()),
532
532
  // }
533
533
  const respond = this.createDefaultResponse(
534
534
  200,
535
535
  { 'content-type': 'application/json' },
536
- () => JSON.stringify(this.gen.user.user()),
536
+ () => JSON.stringify(this.gen.users.user()),
537
537
  init
538
538
  )
539
539
  await mock.add(
@@ -552,12 +552,12 @@ export class SdkMock {
552
552
  // const respond = init?.response ?? {
553
553
  // status: 200,
554
554
  // headers: { 'content-type': 'application/json' },
555
- // body: JSON.stringify(this.gen.user.user()),
555
+ // body: JSON.stringify(this.gen.users.user()),
556
556
  // }
557
557
  const respond = this.createDefaultResponse(
558
558
  200,
559
559
  { 'content-type': 'application/json' },
560
- () => JSON.stringify(this.gen.user.user()),
560
+ () => JSON.stringify(this.gen.users.user()),
561
561
  init
562
562
  )
563
563
  await mock.add(
@@ -783,12 +783,12 @@ export class SdkMock {
783
783
  // const respond = init?.response ?? {
784
784
  // status: 200,
785
785
  // headers: { 'content-type': 'application/json' },
786
- // body: JSON.stringify(this.gen.user.user()),
786
+ // body: JSON.stringify(this.gen.users.user()),
787
787
  // }
788
788
  const respond = this.createDefaultResponse(
789
789
  200,
790
790
  { 'content-type': 'application/json' },
791
- () => JSON.stringify(this.gen.user.user()),
791
+ () => JSON.stringify(this.gen.users.user()),
792
792
  init
793
793
  )
794
794
  await mock.add(
@@ -807,7 +807,7 @@ export class SdkMock {
807
807
  /**
808
808
  * Files API mocks.
809
809
  */
810
- file = {
810
+ files = {
811
811
  /**
812
812
  * Mocks the `file.list()` method.
813
813
  */
@@ -817,7 +817,7 @@ export class SdkMock {
817
817
  // status: 200,
818
818
  // headers: { 'content-type': 'application/json' },
819
819
  // body: JSON.stringify({
820
- // items: this.gen.file.files(init?.size ?? 5),
820
+ // items: this.gen.files.files(init?.size ?? 5),
821
821
  // cursor: this.createCursorOption(init),
822
822
  // } as ContextListResult<IFile>),
823
823
  // }
@@ -826,7 +826,7 @@ export class SdkMock {
826
826
  { 'content-type': 'application/json' },
827
827
  () => {
828
828
  const obj: ContextListResult<IFile> = {
829
- items: this.gen.file.files(init?.size ?? 5),
829
+ items: this.gen.files.files(init?.size ?? 5),
830
830
  cursor: this.createCursorOption(init),
831
831
  }
832
832
  return JSON.stringify(obj)
@@ -853,12 +853,12 @@ export class SdkMock {
853
853
  // const respond = init?.response ?? {
854
854
  // status: 201,
855
855
  // headers: { 'content-type': 'application/json' },
856
- // body: JSON.stringify(this.gen.file.file()),
856
+ // body: JSON.stringify(this.gen.files.file()),
857
857
  // }
858
858
  const respond = this.createDefaultResponse(
859
859
  201,
860
860
  { 'content-type': 'application/json' },
861
- () => JSON.stringify(this.gen.file.file()),
861
+ () => JSON.stringify(this.gen.files.file()),
862
862
  init
863
863
  )
864
864
  await mock.add(
@@ -898,11 +898,11 @@ export class SdkMock {
898
898
  * Mocks the `file.create()` method.
899
899
  */
900
900
  create: async (init?: MockResult, options?: InterceptOptions): Promise<void> => {
901
- await this.file.createMeta(init, options)
901
+ await this.files.createMeta(init, options)
902
902
  // When SDK's file.create() is called, it responds with
903
903
  // what the result of file.createMeta() would be.
904
904
  // Because of that, we don't need to configure the media request.
905
- await this.file.createMedia(undefined, options)
905
+ await this.files.createMedia(undefined, options)
906
906
  },
907
907
 
908
908
  /**
@@ -913,12 +913,12 @@ export class SdkMock {
913
913
  // const respond = init?.response ?? {
914
914
  // status: 201,
915
915
  // headers: { 'content-type': 'application/json' },
916
- // body: JSON.stringify(this.gen.file.folder()),
916
+ // body: JSON.stringify(this.gen.files.folder()),
917
917
  // }
918
918
  const respond = this.createDefaultResponse(
919
919
  201,
920
920
  { 'content-type': 'application/json' },
921
- () => JSON.stringify(this.gen.file.folder()),
921
+ () => JSON.stringify(this.gen.files.folder()),
922
922
  init
923
923
  )
924
924
  await mock.add(
@@ -941,12 +941,12 @@ export class SdkMock {
941
941
  // const respond = init?.response ?? {
942
942
  // status: 200,
943
943
  // headers: { 'content-type': 'application/json' },
944
- // body: JSON.stringify(this.gen.file.file()),
944
+ // body: JSON.stringify(this.gen.files.file()),
945
945
  // }
946
946
  const respond = this.createDefaultResponse(
947
947
  200,
948
948
  { 'content-type': 'application/json' },
949
- () => JSON.stringify(this.gen.file.file()),
949
+ () => JSON.stringify(this.gen.files.file()),
950
950
  init
951
951
  )
952
952
  await mock.add(
@@ -1004,7 +1004,7 @@ export class SdkMock {
1004
1004
  // status: 200,
1005
1005
  // headers: { 'content-type': 'application/json' },
1006
1006
  // body: JSON.stringify({
1007
- // items: this.gen.file.files(init?.size ?? 5),
1007
+ // items: this.gen.files.files(init?.size ?? 5),
1008
1008
  // } as IBulkOperationResult<IFile>),
1009
1009
  // }
1010
1010
  const respond = this.createDefaultResponse(
@@ -1012,7 +1012,7 @@ export class SdkMock {
1012
1012
  { 'content-type': 'application/json' },
1013
1013
  () => {
1014
1014
  const obj: IBulkOperationResult<IFile> = {
1015
- items: this.gen.file.files(init?.size ?? 5),
1015
+ items: this.gen.files.files(init?.size ?? 5),
1016
1016
  }
1017
1017
  return JSON.stringify(obj)
1018
1018
  },
@@ -1038,12 +1038,12 @@ export class SdkMock {
1038
1038
  // const respond = init?.response ?? {
1039
1039
  // status: 200,
1040
1040
  // headers: { 'content-type': 'application/json' },
1041
- // body: JSON.stringify(this.gen.file.file()),
1041
+ // body: JSON.stringify(this.gen.files.file()),
1042
1042
  // }
1043
1043
  const respond = this.createDefaultResponse(
1044
1044
  200,
1045
1045
  { 'content-type': 'application/json' },
1046
- () => JSON.stringify(this.gen.file.file()),
1046
+ () => JSON.stringify(this.gen.files.file()),
1047
1047
  init
1048
1048
  )
1049
1049
  await mock.add(
@@ -1136,12 +1136,12 @@ export class SdkMock {
1136
1136
  // const respond = init?.response ?? {
1137
1137
  // status: 200,
1138
1138
  // headers: { 'content-type': 'application/json' },
1139
- // body: JSON.stringify(this.gen.file.file()),
1139
+ // body: JSON.stringify(this.gen.files.file()),
1140
1140
  // }
1141
1141
  const respond = this.createDefaultResponse(
1142
1142
  200,
1143
1143
  { 'content-type': 'application/json' },
1144
- () => JSON.stringify(this.gen.file.file()),
1144
+ () => JSON.stringify(this.gen.files.file()),
1145
1145
  init
1146
1146
  )
1147
1147
  await mock.add(
@@ -1160,14 +1160,14 @@ export class SdkMock {
1160
1160
  * Mocks the `file.addUser()` method.
1161
1161
  */
1162
1162
  addUser: async (init?: MockResult, options?: InterceptOptions): Promise<void> => {
1163
- await this.file.patchUsers(init, options)
1163
+ await this.files.patchUsers(init, options)
1164
1164
  },
1165
1165
 
1166
1166
  /**
1167
1167
  * Mocks the `file.removeUser()` method.
1168
1168
  */
1169
1169
  removeUser: async (init?: MockResult, options?: InterceptOptions): Promise<void> => {
1170
- await this.file.patchUsers(init, options)
1170
+ await this.files.patchUsers(init, options)
1171
1171
  },
1172
1172
 
1173
1173
  /**
@@ -1179,7 +1179,7 @@ export class SdkMock {
1179
1179
  // status: 200,
1180
1180
  // headers: { 'content-type': 'application/json' },
1181
1181
  // body: JSON.stringify({
1182
- // items: this.gen.user.users(init?.size ?? 5),
1182
+ // items: this.gen.users.users(init?.size ?? 5),
1183
1183
  // cursor: this.createCursorOption(init),
1184
1184
  // } as ContextListResult<IUser>),
1185
1185
  // }
@@ -1188,7 +1188,7 @@ export class SdkMock {
1188
1188
  { 'content-type': 'application/json' },
1189
1189
  () => {
1190
1190
  const obj: ContextListResult<IUser> = {
1191
- items: this.gen.user.users(init?.size ?? 5),
1191
+ items: this.gen.users.users(init?.size ?? 5),
1192
1192
  cursor: this.createCursorOption(init),
1193
1193
  }
1194
1194
  return JSON.stringify(obj)
@@ -1216,7 +1216,7 @@ export class SdkMock {
1216
1216
  // status: 200,
1217
1217
  // headers: { 'content-type': 'application/json' },
1218
1218
  // body: JSON.stringify({
1219
- // items: this.gen.file.fileBreadcrumbs(init?.size ?? 5),
1219
+ // items: this.gen.files.fileBreadcrumbs(init?.size ?? 5),
1220
1220
  // cursor: this.createCursorOption(init),
1221
1221
  // } as ContextListResult<FileBreadcrumb>),
1222
1222
  // }
@@ -1225,7 +1225,7 @@ export class SdkMock {
1225
1225
  { 'content-type': 'application/json' },
1226
1226
  () => {
1227
1227
  const obj: ContextListResult<FileBreadcrumb> = {
1228
- items: this.gen.file.fileBreadcrumbs(init?.size ?? 5),
1228
+ items: this.gen.files.fileBreadcrumbs(init?.size ?? 5),
1229
1229
  cursor: this.createCursorOption(init),
1230
1230
  }
1231
1231
  return JSON.stringify(obj)
@@ -1245,6 +1245,11 @@ export class SdkMock {
1245
1245
  },
1246
1246
  }
1247
1247
 
1248
+ /**
1249
+ * @deprecated Use `files` instead.
1250
+ */
1251
+ file = this.files
1252
+
1248
1253
  /**
1249
1254
  * Shared API mocks.
1250
1255
  */
@@ -1255,7 +1260,7 @@ export class SdkMock {
1255
1260
  // status: 200,
1256
1261
  // headers: { 'content-type': 'application/json' },
1257
1262
  // body: JSON.stringify({
1258
- // items: this.gen.file.files(init?.size ?? 5),
1263
+ // items: this.gen.files.files(init?.size ?? 5),
1259
1264
  // cursor: this.createCursorOption(init),
1260
1265
  // } as ContextListResult<IFile>),
1261
1266
  // }
@@ -1264,7 +1269,7 @@ export class SdkMock {
1264
1269
  { 'content-type': 'application/json' },
1265
1270
  () => {
1266
1271
  const obj: ContextListResult<IFile> = {
1267
- items: this.gen.file.files(init?.size ?? 5),
1272
+ items: this.gen.files.files(init?.size ?? 5),
1268
1273
  cursor: this.createCursorOption(init),
1269
1274
  }
1270
1275
  return JSON.stringify(obj)
@@ -29,7 +29,7 @@ export class SharedSdk extends SdkBase {
29
29
  this.sdk.appendListOptions(url, options)
30
30
  const result = await this.sdk.http.get(url.toString(), { token })
31
31
  this.inspectCommonStatusCodes(result)
32
- const E_PREFIX = 'Unable to list organizations. '
32
+ const E_PREFIX = 'Unable to list shared files. '
33
33
  if (result.status !== 200) {
34
34
  this.logInvalidResponse(result)
35
35
  throw this.createApiError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.body)
@@ -1,33 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <title>Oauth2 callback window</title>
6
- <style>
7
- *[hidden] {
8
- display: none;
9
- }
10
- </style>
11
- </head>
12
- <body>
13
- <h1>Sending the authorization data to the application</h1>
14
- <p id="general-error" hidden>
15
- The window wasn't opened as a popup and therefore it can't pass the authorization information.<br />
16
- This is an error.
17
- </p>
18
- <script>
19
- const messageTarget = window.opener || window.parent || window.top
20
- if (!messageTarget || messageTarget === window || !messageTarget.postMessage) {
21
- const elm = document.getElementById('general-error')
22
- elm.removeAttribute('hidden')
23
- } else {
24
- const search = window.location.search.substr(1)
25
- if (search) {
26
- messageTarget.postMessage(search, '*')
27
- } else {
28
- messageTarget.postMessage(window.location.hash.substr(1), '*')
29
- }
30
- }
31
- </script>
32
- </body>
33
- </html>