@api-client/core 0.18.60 → 0.18.62
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/modeling/rules/MatchResourceOwner.d.ts +13 -4
- package/build/src/modeling/rules/MatchResourceOwner.d.ts.map +1 -1
- package/build/src/modeling/rules/MatchResourceOwner.js +17 -4
- package/build/src/modeling/rules/MatchResourceOwner.js.map +1 -1
- package/build/src/sdk/DataCatalogSdk.d.ts +8 -1
- package/build/src/sdk/DataCatalogSdk.d.ts.map +1 -1
- package/build/src/sdk/DataCatalogSdk.js +12 -2
- package/build/src/sdk/DataCatalogSdk.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/data/models/example-generator-api.json +23 -23
- package/package.json +1 -1
- package/src/modeling/rules/MatchResourceOwner.ts +22 -7
- package/src/sdk/DataCatalogSdk.ts +12 -2
- package/tests/unit/modeling/rules/MatchResourceOwner.spec.ts +21 -1
|
@@ -42062,6 +42062,9 @@
|
|
|
42062
42062
|
"@id": "#209"
|
|
42063
42063
|
},
|
|
42064
42064
|
{
|
|
42065
|
+
"@id": "#206"
|
|
42066
|
+
},
|
|
42067
|
+
{
|
|
42065
42068
|
"@id": "#191"
|
|
42066
42069
|
},
|
|
42067
42070
|
{
|
|
@@ -42071,13 +42074,10 @@
|
|
|
42071
42074
|
"@id": "#197"
|
|
42072
42075
|
},
|
|
42073
42076
|
{
|
|
42074
|
-
"@id": "#203"
|
|
42075
|
-
},
|
|
42076
|
-
{
|
|
42077
42077
|
"@id": "#200"
|
|
42078
42078
|
},
|
|
42079
42079
|
{
|
|
42080
|
-
"@id": "#
|
|
42080
|
+
"@id": "#203"
|
|
42081
42081
|
},
|
|
42082
42082
|
{
|
|
42083
42083
|
"@id": "#209"
|
|
@@ -42813,13 +42813,13 @@
|
|
|
42813
42813
|
"@id": "#210"
|
|
42814
42814
|
},
|
|
42815
42815
|
{
|
|
42816
|
-
"@id": "#219"
|
|
42817
|
-
},
|
|
42818
|
-
{
|
|
42819
42816
|
"@id": "#213"
|
|
42820
42817
|
},
|
|
42821
42818
|
{
|
|
42822
42819
|
"@id": "#216"
|
|
42820
|
+
},
|
|
42821
|
+
{
|
|
42822
|
+
"@id": "#219"
|
|
42823
42823
|
}
|
|
42824
42824
|
],
|
|
42825
42825
|
"doc:root": false,
|
|
@@ -43436,7 +43436,7 @@
|
|
|
43436
43436
|
"doc:ExternalDomainElement",
|
|
43437
43437
|
"doc:DomainElement"
|
|
43438
43438
|
],
|
|
43439
|
-
"doc:raw": "
|
|
43439
|
+
"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",
|
|
43440
43440
|
"core:mediaType": "application/yaml",
|
|
43441
43441
|
"sourcemaps:sources": [
|
|
43442
43442
|
{
|
|
@@ -43457,7 +43457,7 @@
|
|
|
43457
43457
|
"doc:ExternalDomainElement",
|
|
43458
43458
|
"doc:DomainElement"
|
|
43459
43459
|
],
|
|
43460
|
-
"doc:raw": "
|
|
43460
|
+
"doc:raw": "code: '5'\ndescription: 'Limited company'\n",
|
|
43461
43461
|
"core:mediaType": "application/yaml",
|
|
43462
43462
|
"sourcemaps:sources": [
|
|
43463
43463
|
{
|
|
@@ -43478,7 +43478,7 @@
|
|
|
43478
43478
|
"doc:ExternalDomainElement",
|
|
43479
43479
|
"doc:DomainElement"
|
|
43480
43480
|
],
|
|
43481
|
-
"doc:raw": "
|
|
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
|
{
|
|
@@ -43520,7 +43520,7 @@
|
|
|
43520
43520
|
"doc:ExternalDomainElement",
|
|
43521
43521
|
"doc:DomainElement"
|
|
43522
43522
|
],
|
|
43523
|
-
"doc:raw": "
|
|
43523
|
+
"doc:raw": "code: '7487'\ndescription: 'Financial and insurance activities'\ntype: \"PRIMARY\"\nclassificationCode: 'BE_NACEBEL2008'\nactivityGroupCode: 'ABCDE'\n",
|
|
43524
43524
|
"core:mediaType": "application/yaml",
|
|
43525
43525
|
"sourcemaps:sources": [
|
|
43526
43526
|
{
|
|
@@ -43541,7 +43541,7 @@
|
|
|
43541
43541
|
"doc:ExternalDomainElement",
|
|
43542
43542
|
"doc:DomainElement"
|
|
43543
43543
|
],
|
|
43544
|
-
"doc:raw": "
|
|
43544
|
+
"doc:raw": "countryCode: \"BE\"\ngraydonEnterpriseId: 1057155523\nregistrationId: \"0422319093\"\nvatNumber: \"BE0422319093\"\ngraydonCompanyId: \"0422319093\"\nisBranchOffice: false\n",
|
|
43545
43545
|
"core:mediaType": "application/yaml",
|
|
43546
43546
|
"sourcemaps:sources": [
|
|
43547
43547
|
{
|
|
@@ -44253,7 +44253,7 @@
|
|
|
44253
44253
|
"doc:ExternalDomainElement",
|
|
44254
44254
|
"doc:DomainElement"
|
|
44255
44255
|
],
|
|
44256
|
-
"doc:raw": "
|
|
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:
|
|
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
|
{
|
|
@@ -44295,7 +44295,7 @@
|
|
|
44295
44295
|
"doc:ExternalDomainElement",
|
|
44296
44296
|
"doc:DomainElement"
|
|
44297
44297
|
],
|
|
44298
|
-
"doc:raw": "type:
|
|
44298
|
+
"doc:raw": "type: \"GENERAL\"\nvalue: \"www.company.be\"\n",
|
|
44299
44299
|
"core:mediaType": "application/yaml",
|
|
44300
44300
|
"sourcemaps:sources": [
|
|
44301
44301
|
{
|
|
@@ -44756,17 +44756,17 @@
|
|
|
44756
44756
|
{
|
|
44757
44757
|
"@id": "#193/source-map/lexical/element_0",
|
|
44758
44758
|
"sourcemaps:element": "amf://id#193",
|
|
44759
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44759
|
+
"sourcemaps:value": "[(1,0)-(10,0)]"
|
|
44760
44760
|
},
|
|
44761
44761
|
{
|
|
44762
44762
|
"@id": "#196/source-map/lexical/element_0",
|
|
44763
44763
|
"sourcemaps:element": "amf://id#196",
|
|
44764
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44764
|
+
"sourcemaps:value": "[(1,0)-(3,0)]"
|
|
44765
44765
|
},
|
|
44766
44766
|
{
|
|
44767
44767
|
"@id": "#199/source-map/lexical/element_0",
|
|
44768
44768
|
"sourcemaps:element": "amf://id#199",
|
|
44769
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44769
|
+
"sourcemaps:value": "[(1,0)-(5,0)]"
|
|
44770
44770
|
},
|
|
44771
44771
|
{
|
|
44772
44772
|
"@id": "#202/source-map/lexical/element_0",
|
|
@@ -44776,12 +44776,12 @@
|
|
|
44776
44776
|
{
|
|
44777
44777
|
"@id": "#205/source-map/lexical/element_0",
|
|
44778
44778
|
"sourcemaps:element": "amf://id#205",
|
|
44779
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44779
|
+
"sourcemaps:value": "[(1,0)-(6,0)]"
|
|
44780
44780
|
},
|
|
44781
44781
|
{
|
|
44782
44782
|
"@id": "#208/source-map/lexical/element_0",
|
|
44783
44783
|
"sourcemaps:element": "amf://id#208",
|
|
44784
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44784
|
+
"sourcemaps:value": "[(1,0)-(7,0)]"
|
|
44785
44785
|
},
|
|
44786
44786
|
{
|
|
44787
44787
|
"@id": "#223/source-map/lexical/element_0",
|
|
@@ -45121,17 +45121,17 @@
|
|
|
45121
45121
|
{
|
|
45122
45122
|
"@id": "#215/source-map/lexical/element_0",
|
|
45123
45123
|
"sourcemaps:element": "amf://id#215",
|
|
45124
|
-
"sourcemaps:value": "[(1,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)-(
|
|
45129
|
+
"sourcemaps:value": "[(1,0)-(7,0)]"
|
|
45130
45130
|
},
|
|
45131
45131
|
{
|
|
45132
45132
|
"@id": "#221/source-map/lexical/element_0",
|
|
45133
45133
|
"sourcemaps:element": "amf://id#221",
|
|
45134
|
-
"sourcemaps:value": "[(1,0)-(
|
|
45134
|
+
"sourcemaps:value": "[(1,0)-(3,0)]"
|
|
45135
45135
|
},
|
|
45136
45136
|
{
|
|
45137
45137
|
"@id": "#338/source-map/synthesized-field/element_1",
|
package/package.json
CHANGED
|
@@ -9,13 +9,22 @@ import { observed } from '../../decorators/observed.js'
|
|
|
9
9
|
export interface MatchResourceOwnerAccessRuleSchema extends AccessRuleSchema {
|
|
10
10
|
type: 'matchResourceOwner'
|
|
11
11
|
/**
|
|
12
|
-
* The property on the resource that
|
|
13
|
-
*
|
|
12
|
+
* The property on the resource that references the user's ID (the key in the semantically annotated `User` entity).
|
|
13
|
+
*
|
|
14
|
+
* When the current exposed entity has a property annotated with the "ResourceOwnerIdentifier" semantic,
|
|
15
|
+
* this property should be used. It directly references the user's key.
|
|
14
16
|
*
|
|
15
17
|
* The domain model should annotate this property with the "ResourceOwnerIdentifier" semantic
|
|
16
18
|
* to indicate that it is used for ownership checks.
|
|
17
19
|
*/
|
|
18
|
-
property
|
|
20
|
+
property?: string
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The target for the ownership check.
|
|
24
|
+
* - `property`: The check is performed against a specific property on the resource (default).
|
|
25
|
+
* - `user-entity`: The check is performed against the entity itself (used when the entity represents the user).
|
|
26
|
+
*/
|
|
27
|
+
target?: 'property' | 'user-entity'
|
|
19
28
|
}
|
|
20
29
|
|
|
21
30
|
/**
|
|
@@ -26,18 +35,24 @@ export interface MatchResourceOwnerAccessRuleSchema extends AccessRuleSchema {
|
|
|
26
35
|
export class MatchResourceOwnerAccessRule extends AccessRule implements MatchResourceOwnerAccessRuleSchema {
|
|
27
36
|
override readonly type: 'matchResourceOwner'
|
|
28
37
|
|
|
29
|
-
@observed() accessor property: string
|
|
38
|
+
@observed() accessor property: string | undefined
|
|
39
|
+
@observed() accessor target: 'property' | 'user-entity'
|
|
30
40
|
|
|
31
41
|
constructor(state: Partial<MatchResourceOwnerAccessRuleSchema> = {}) {
|
|
32
42
|
super(state)
|
|
33
43
|
this.type = 'matchResourceOwner'
|
|
34
|
-
this.property = state.property
|
|
44
|
+
this.property = state.property
|
|
45
|
+
this.target = state.target ?? 'property'
|
|
35
46
|
}
|
|
36
47
|
|
|
37
48
|
override toJSON(): MatchResourceOwnerAccessRuleSchema {
|
|
38
|
-
|
|
49
|
+
const json: MatchResourceOwnerAccessRuleSchema = {
|
|
39
50
|
...(super.toJSON() as MatchResourceOwnerAccessRuleSchema),
|
|
40
|
-
|
|
51
|
+
target: this.target,
|
|
52
|
+
}
|
|
53
|
+
if (this.property) {
|
|
54
|
+
json.property = this.property
|
|
41
55
|
}
|
|
56
|
+
return json
|
|
42
57
|
}
|
|
43
58
|
}
|
|
@@ -388,9 +388,19 @@ export class DataCatalogSdk extends SdkBase {
|
|
|
388
388
|
return data
|
|
389
389
|
}
|
|
390
390
|
|
|
391
|
-
|
|
391
|
+
/**
|
|
392
|
+
* Checks the publication status of a data domain.
|
|
393
|
+
* @param domainKey The key of the data domain to check.
|
|
394
|
+
* @param oid The optional ID of the organization. Optional for public domains.
|
|
395
|
+
* @param request The request options.
|
|
396
|
+
* @returns The publication status of the data domain.
|
|
397
|
+
*/
|
|
398
|
+
async checkPublicationStatus(domainKey: string, oid?: string, request: SdkOptions = {}): Promise<DataCatalogStatus> {
|
|
392
399
|
const { token } = request
|
|
393
|
-
const url = this.sdk.getUrl(RouteBuilder.dataCatalogStatus(
|
|
400
|
+
const url = this.sdk.getUrl(RouteBuilder.dataCatalogStatus(domainKey))
|
|
401
|
+
if (oid) {
|
|
402
|
+
url.searchParams.set('oid', oid)
|
|
403
|
+
}
|
|
394
404
|
const result = await this.sdk.http.get(url.toString(), { token })
|
|
395
405
|
this.inspectCommonStatusCodes(result)
|
|
396
406
|
const E_PREFIX = 'Unable to check data domain publication status. '
|
|
@@ -5,7 +5,8 @@ test.group('MatchResourceOwnerAccessRule', () => {
|
|
|
5
5
|
test('initializes with default values', ({ assert }) => {
|
|
6
6
|
const rule = new MatchResourceOwnerAccessRule()
|
|
7
7
|
assert.equal(rule.type, 'matchResourceOwner')
|
|
8
|
-
assert.
|
|
8
|
+
assert.isUndefined(rule.property)
|
|
9
|
+
assert.equal(rule.target, 'property')
|
|
9
10
|
}).tags(['@modeling', '@rule', '@match-resource-owner'])
|
|
10
11
|
|
|
11
12
|
test('initializes with provided values', ({ assert }) => {
|
|
@@ -13,6 +14,15 @@ test.group('MatchResourceOwnerAccessRule', () => {
|
|
|
13
14
|
|
|
14
15
|
assert.equal(rule.type, 'matchResourceOwner')
|
|
15
16
|
assert.equal(rule.property, 'creatorId')
|
|
17
|
+
assert.equal(rule.target, 'property')
|
|
18
|
+
}).tags(['@modeling', '@rule', '@match-resource-owner'])
|
|
19
|
+
|
|
20
|
+
test('initializes with target user-entity', ({ assert }) => {
|
|
21
|
+
const rule = new MatchResourceOwnerAccessRule({ target: 'user-entity' })
|
|
22
|
+
|
|
23
|
+
assert.equal(rule.type, 'matchResourceOwner')
|
|
24
|
+
assert.isUndefined(rule.property)
|
|
25
|
+
assert.equal(rule.target, 'user-entity')
|
|
16
26
|
}).tags(['@modeling', '@rule', '@match-resource-owner'])
|
|
17
27
|
|
|
18
28
|
test('toJSON returns valid schema', ({ assert }) => {
|
|
@@ -21,6 +31,16 @@ test.group('MatchResourceOwnerAccessRule', () => {
|
|
|
21
31
|
|
|
22
32
|
assert.equal(json.type, 'matchResourceOwner')
|
|
23
33
|
assert.equal(json.property, 'creatorId')
|
|
34
|
+
assert.equal(json.target, 'property')
|
|
35
|
+
}).tags(['@modeling', '@rule', '@match-resource-owner', '@serialization'])
|
|
36
|
+
|
|
37
|
+
test('toJSON omits property when undefined', ({ assert }) => {
|
|
38
|
+
const rule = new MatchResourceOwnerAccessRule({ target: 'user-entity' })
|
|
39
|
+
const json = rule.toJSON()
|
|
40
|
+
|
|
41
|
+
assert.equal(json.type, 'matchResourceOwner')
|
|
42
|
+
assert.isUndefined(json.property)
|
|
43
|
+
assert.equal(json.target, 'user-entity')
|
|
24
44
|
}).tags(['@modeling', '@rule', '@match-resource-owner', '@serialization'])
|
|
25
45
|
|
|
26
46
|
test('notifies change when property changes', async ({ assert }) => {
|