@api-client/core 0.12.16 → 0.12.18

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.
@@ -41725,13 +41725,13 @@
41725
41725
  "@id": "#191"
41726
41726
  },
41727
41727
  {
41728
- "@id": "#194"
41728
+ "@id": "#197"
41729
41729
  },
41730
41730
  {
41731
- "@id": "#200"
41731
+ "@id": "#194"
41732
41732
  },
41733
41733
  {
41734
- "@id": "#197"
41734
+ "@id": "#200"
41735
41735
  },
41736
41736
  {
41737
41737
  "@id": "#203"
@@ -42470,9 +42470,6 @@
42470
42470
  "@id": "#219"
42471
42471
  },
42472
42472
  {
42473
- "@id": "#219"
42474
- },
42475
- {
42476
42473
  "@id": "#210"
42477
42474
  },
42478
42475
  {
@@ -42480,6 +42477,9 @@
42480
42477
  },
42481
42478
  {
42482
42479
  "@id": "#216"
42480
+ },
42481
+ {
42482
+ "@id": "#219"
42483
42483
  }
42484
42484
  ],
42485
42485
  "doc:root": false,
@@ -43117,7 +43117,7 @@
43117
43117
  "doc:ExternalDomainElement",
43118
43118
  "doc:DomainElement"
43119
43119
  ],
43120
- "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",
43120
+ "doc:raw": "code: '5'\ndescription: 'Limited company'\n",
43121
43121
  "core:mediaType": "application/yaml",
43122
43122
  "sourcemaps:sources": [
43123
43123
  {
@@ -43138,7 +43138,7 @@
43138
43138
  "doc:ExternalDomainElement",
43139
43139
  "doc:DomainElement"
43140
43140
  ],
43141
- "doc:raw": "class: '3'\ndescription: '150 - 300'\nnumberOfFte: 5500\nnumberOfEmployees: 5232\n",
43141
+ "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",
43142
43142
  "core:mediaType": "application/yaml",
43143
43143
  "sourcemaps:sources": [
43144
43144
  {
@@ -43159,7 +43159,7 @@
43159
43159
  "doc:ExternalDomainElement",
43160
43160
  "doc:DomainElement"
43161
43161
  ],
43162
- "doc:raw": "code: '5'\ndescription: 'Limited company'\n",
43162
+ "doc:raw": "class: '3'\ndescription: '150 - 300'\nnumberOfFte: 5500\nnumberOfEmployees: 5232\n",
43163
43163
  "core:mediaType": "application/yaml",
43164
43164
  "sourcemaps:sources": [
43165
43165
  {
@@ -43892,7 +43892,7 @@
43892
43892
  "doc:ExternalDomainElement",
43893
43893
  "doc:DomainElement"
43894
43894
  ],
43895
- "doc:raw": "type: 'GENERAL'\ncountryDialCode : '+32'\nareaCode : '21'\nsubscriberNumber: '12.87.00'\nformatted: '+32-(0)21 302099'\n",
43895
+ "doc:raw": "type: 'GENERAL'\ncountryDialCode : '+32'\nareaCode : '22'\nsubscriberNumber: '12.87.00'\nformatted: '+32-(0)22 000000'\n",
43896
43896
  "core:mediaType": "application/yaml",
43897
43897
  "sourcemaps:sources": [
43898
43898
  {
@@ -43913,7 +43913,7 @@
43913
43913
  "doc:ExternalDomainElement",
43914
43914
  "doc:DomainElement"
43915
43915
  ],
43916
- "doc:raw": "-\n type: 'GENERAL'\n value: 'info@company.be'\n-\n type: 'IT_DEPT'\n value: 'it-service@company.be'\n",
43916
+ "doc:raw": "type: 'GENERAL'\ncountryDialCode : '+32'\nareaCode : '21'\nsubscriberNumber: '12.87.00'\nformatted: '+32-(0)21 302099'\n",
43917
43917
  "core:mediaType": "application/yaml",
43918
43918
  "sourcemaps:sources": [
43919
43919
  {
@@ -43934,7 +43934,7 @@
43934
43934
  "doc:ExternalDomainElement",
43935
43935
  "doc:DomainElement"
43936
43936
  ],
43937
- "doc:raw": "type: \"GENERAL\"\nvalue: \"www.company.be\"\n",
43937
+ "doc:raw": "-\n type: 'GENERAL'\n value: 'info@company.be'\n-\n type: 'IT_DEPT'\n value: 'it-service@company.be'\n",
43938
43938
  "core:mediaType": "application/yaml",
43939
43939
  "sourcemaps:sources": [
43940
43940
  {
@@ -43955,7 +43955,7 @@
43955
43955
  "doc:ExternalDomainElement",
43956
43956
  "doc:DomainElement"
43957
43957
  ],
43958
- "doc:raw": "type: 'GENERAL'\ncountryDialCode : '+32'\nareaCode : '22'\nsubscriberNumber: '12.87.00'\nformatted: '+32-(0)22 000000'\n",
43958
+ "doc:raw": "type: \"GENERAL\"\nvalue: \"www.company.be\"\n",
43959
43959
  "core:mediaType": "application/yaml",
43960
43960
  "sourcemaps:sources": [
43961
43961
  {
@@ -44421,17 +44421,17 @@
44421
44421
  {
44422
44422
  "@id": "#196/source-map/lexical/element_0",
44423
44423
  "sourcemaps:element": "amf://id#196",
44424
- "sourcemaps:value": "[(1,0)-(10,0)]"
44424
+ "sourcemaps:value": "[(1,0)-(3,0)]"
44425
44425
  },
44426
44426
  {
44427
44427
  "@id": "#199/source-map/lexical/element_0",
44428
44428
  "sourcemaps:element": "amf://id#199",
44429
- "sourcemaps:value": "[(1,0)-(5,0)]"
44429
+ "sourcemaps:value": "[(1,0)-(10,0)]"
44430
44430
  },
44431
44431
  {
44432
44432
  "@id": "#202/source-map/lexical/element_0",
44433
44433
  "sourcemaps:element": "amf://id#202",
44434
- "sourcemaps:value": "[(1,0)-(3,0)]"
44434
+ "sourcemaps:value": "[(1,0)-(5,0)]"
44435
44435
  },
44436
44436
  {
44437
44437
  "@id": "#205/source-map/lexical/element_0",
@@ -44781,17 +44781,17 @@
44781
44781
  {
44782
44782
  "@id": "#215/source-map/lexical/element_0",
44783
44783
  "sourcemaps:element": "amf://id#215",
44784
- "sourcemaps:value": "[(1,0)-(7,0)]"
44784
+ "sourcemaps:value": "[(1,0)-(6,0)]"
44785
44785
  },
44786
44786
  {
44787
44787
  "@id": "#218/source-map/lexical/element_0",
44788
44788
  "sourcemaps:element": "amf://id#218",
44789
- "sourcemaps:value": "[(1,0)-(3,0)]"
44789
+ "sourcemaps:value": "[(1,0)-(7,0)]"
44790
44790
  },
44791
44791
  {
44792
44792
  "@id": "#221/source-map/lexical/element_0",
44793
44793
  "sourcemaps:element": "amf://id#221",
44794
- "sourcemaps:value": "[(1,0)-(6,0)]"
44794
+ "sourcemaps:value": "[(1,0)-(3,0)]"
44795
44795
  },
44796
44796
  {
44797
44797
  "@id": "#338/source-map/synthesized-field/element_1",
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.12.16",
4
+ "version": "0.12.18",
5
5
  "license": "Apache-2.0",
6
6
  "exports": {
7
7
  "./browser.js": {
@@ -7,6 +7,10 @@ export interface AuthRedirectOptions {
7
7
  * The path or the full URL
8
8
  */
9
9
  redirect?: string
10
+ /**
11
+ * The invitation token to register the user in a specific organization.
12
+ */
13
+ token?: string
10
14
  /**
11
15
  * Whether to `redirect` the current tab or to create a new one
12
16
  */
@@ -21,25 +25,18 @@ export class AuthSdk extends SdkBase {
21
25
  * @param redirect The path or the full URL
22
26
  */
23
27
  oauthRedirect(provider: AuthProviders, opts: AuthRedirectOptions = {}): Window | null {
24
- const { redirect, type = 'redirect' } = opts
28
+ const { redirect, token, type = 'redirect' } = opts
25
29
  const base = new URL(this.sdk.baseUri)
26
- let url: URL
27
- switch (provider) {
28
- case 'google':
29
- url = new URL('/auth/google/redirect', base)
30
- break
31
- case 'github':
32
- url = new URL('/auth/github/redirect', base)
33
- break
34
- case 'linkedin':
35
- url = new URL('/auth/linkedin/redirect', base)
36
- break
37
- default:
38
- throw new Error(`Invalid provider: ${provider}`)
30
+ if (!['google', 'github', 'linkedin'].includes(provider)) {
31
+ throw new Error(`Invalid provider: ${provider}`)
39
32
  }
33
+ const url = new URL(`/auth/${provider}/redirect`, base)
40
34
  if (redirect) {
41
35
  url.searchParams.set('r', redirect)
42
36
  }
37
+ if (token) {
38
+ url.searchParams.set('token', token)
39
+ }
43
40
  if (type === 'redirect') {
44
41
  window.location.href = url.toString()
45
42
  return null
@@ -326,7 +326,7 @@ export class FilesSdk extends SdkBase {
326
326
  async readBulk(organization: string, keys: string[], request: SdkOptions = {}): Promise<IBulkOperationResult<IFile>> {
327
327
  const { token } = request
328
328
  const url = this.sdk.getUrl(RouteBuilder.filesBatch(organization))
329
- const body = JSON.stringify(keys)
329
+ const body = JSON.stringify({ ids: keys })
330
330
  const result = await this.sdk.http.post(url.toString(), { token, body })
331
331
  this.inspectCommonStatusCodes(result)
332
332
  const E_PREFIX = 'Unable to read files in bulk. '