@api-client/core 0.13.5 → 0.13.6
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/amf/AmfShapeGenerator.js +1 -1
- package/build/src/amf/AmfShapeGenerator.js.map +1 -1
- package/build/src/amf/DataValueGenerator.js +1 -1
- package/build/src/amf/DataValueGenerator.js.map +1 -1
- package/build/src/amf/models/AmfDataNode.js +1 -1
- package/build/src/amf/models/AmfDataNode.js.map +1 -1
- package/build/src/browser.d.ts +1 -1
- package/build/src/browser.d.ts.map +1 -1
- package/build/src/browser.js.map +1 -1
- package/build/src/index.d.ts +2 -1
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +1 -0
- package/build/src/index.js.map +1 -1
- package/build/src/modeling/DataDomain.js +1 -1
- package/build/src/modeling/DataDomain.js.map +1 -1
- package/build/src/modeling/DomainAssociation.js +1 -1
- package/build/src/modeling/DomainAssociation.js.map +1 -1
- package/build/src/modeling/DomainEntity.js +1 -1
- package/build/src/modeling/DomainEntity.js.map +1 -1
- package/build/src/modeling/DomainFile.js +1 -1
- package/build/src/modeling/DomainFile.js.map +1 -1
- package/build/src/modeling/DomainModel.js +1 -1
- package/build/src/modeling/DomainModel.js.map +1 -1
- package/build/src/modeling/DomainNamespace.js +1 -1
- package/build/src/modeling/DomainNamespace.js.map +1 -1
- package/build/src/modeling/DomainProperty.js +1 -1
- package/build/src/modeling/DomainProperty.js.map +1 -1
- package/build/src/modeling/amf/ShapeGenerator.js +1 -1
- package/build/src/modeling/amf/ShapeGenerator.js.map +1 -1
- package/build/src/modeling/legacy/DataAssociation.js +1 -1
- package/build/src/modeling/legacy/DataAssociation.js.map +1 -1
- package/build/src/modeling/legacy/DataEntity.js +1 -1
- package/build/src/modeling/legacy/DataEntity.js.map +1 -1
- package/build/src/modeling/legacy/DataEntityBuilder.js +1 -1
- package/build/src/modeling/legacy/DataEntityBuilder.js.map +1 -1
- package/build/src/modeling/legacy/DataModel.js +1 -1
- package/build/src/modeling/legacy/DataModel.js.map +1 -1
- package/build/src/modeling/legacy/DataNamespace.js +1 -1
- package/build/src/modeling/legacy/DataNamespace.js.map +1 -1
- package/build/src/modeling/legacy/DataProperty.js +1 -1
- package/build/src/modeling/legacy/DataProperty.js.map +1 -1
- package/build/src/models/AuthorizationData.js +1 -1
- package/build/src/models/AuthorizationData.js.map +1 -1
- package/build/src/models/CertificateFile.js +1 -1
- package/build/src/models/CertificateFile.js.map +1 -1
- package/build/src/models/ClientCertificate.js +1 -1
- package/build/src/models/ClientCertificate.js.map +1 -1
- package/build/src/models/Environment.js +1 -1
- package/build/src/models/Environment.js.map +1 -1
- package/build/src/models/Folder.js +1 -1
- package/build/src/models/Folder.js.map +1 -1
- package/build/src/models/HostRule.js +1 -1
- package/build/src/models/HostRule.js.map +1 -1
- package/build/src/models/HttpProject.js +1 -1
- package/build/src/models/HttpProject.js.map +1 -1
- package/build/src/models/Project.js +1 -1
- package/build/src/models/Project.js.map +1 -1
- package/build/src/models/ProjectFolder.js +1 -1
- package/build/src/models/ProjectFolder.js.map +1 -1
- package/build/src/models/ProjectRequest.js +1 -1
- package/build/src/models/ProjectRequest.js.map +1 -1
- package/build/src/models/ProjectSchema.js +1 -1
- package/build/src/models/ProjectSchema.js.map +1 -1
- package/build/src/models/store/DataFile.js +1 -1
- package/build/src/models/store/DataFile.js.map +1 -1
- package/build/src/models/store/File.js +1 -1
- package/build/src/models/store/File.js.map +1 -1
- package/build/src/models/store/Invitation.js +1 -1
- package/build/src/models/store/Invitation.js.map +1 -1
- package/build/src/models/store/Organization.js +1 -1
- package/build/src/models/store/Organization.js.map +1 -1
- package/build/src/models/store/Permission.d.ts +34 -0
- package/build/src/models/store/Permission.d.ts.map +1 -1
- package/build/src/models/store/Permission.js +28 -2
- package/build/src/models/store/Permission.js.map +1 -1
- package/build/src/models/store/UserIdentity.js +1 -1
- package/build/src/models/store/UserIdentity.js.map +1 -1
- package/build/src/models/transformers/ArcDexieTransformer.js +1 -1
- package/build/src/models/transformers/ArcDexieTransformer.js.map +1 -1
- package/build/src/models/transformers/ArcLegacyTransformer.js +1 -1
- package/build/src/models/transformers/ArcLegacyTransformer.js.map +1 -1
- package/build/src/models/transformers/ArcPouchTransformer.js +1 -1
- package/build/src/models/transformers/ArcPouchTransformer.js.map +1 -1
- package/build/src/models/transformers/PostmanV21Transformer.js +1 -1
- package/build/src/models/transformers/PostmanV21Transformer.js.map +1 -1
- package/build/src/models/transformers/PostmanV2Transformer.js +1 -1
- package/build/src/models/transformers/PostmanV2Transformer.js.map +1 -1
- package/build/src/nanoid.d.ts +10 -0
- package/build/src/nanoid.d.ts.map +1 -0
- package/build/src/nanoid.js +11 -0
- package/build/src/nanoid.js.map +1 -0
- package/build/src/patch/PatchClient.js +1 -1
- package/build/src/patch/PatchClient.js.map +1 -1
- package/build/src/sdk/FilesSdk.js +1 -1
- package/build/src/sdk/FilesSdk.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/data/models/example-generator-api.json +14 -14
- package/package.json +2 -1
- package/src/amf/AmfShapeGenerator.ts +1 -1
- package/src/amf/DataValueGenerator.ts +1 -1
- package/src/amf/models/AmfDataNode.ts +1 -1
- package/src/modeling/DataDomain.ts +1 -1
- package/src/modeling/DomainAssociation.ts +1 -1
- package/src/modeling/DomainEntity.ts +1 -1
- package/src/modeling/DomainFile.ts +1 -1
- package/src/modeling/DomainModel.ts +1 -1
- package/src/modeling/DomainNamespace.ts +1 -1
- package/src/modeling/DomainProperty.ts +1 -1
- package/src/modeling/amf/ShapeGenerator.ts +1 -1
- package/src/modeling/legacy/DataAssociation.ts +1 -1
- package/src/modeling/legacy/DataEntity.ts +1 -1
- package/src/modeling/legacy/DataEntityBuilder.ts +1 -1
- package/src/modeling/legacy/DataModel.ts +1 -1
- package/src/modeling/legacy/DataNamespace.ts +1 -1
- package/src/modeling/legacy/DataProperty.ts +1 -1
- package/src/models/AuthorizationData.ts +1 -1
- package/src/models/CertificateFile.ts +1 -1
- package/src/models/ClientCertificate.ts +1 -1
- package/src/models/Environment.ts +1 -1
- package/src/models/Folder.ts +1 -1
- package/src/models/HostRule.ts +1 -1
- package/src/models/HttpProject.ts +1 -1
- package/src/models/Project.ts +1 -1
- package/src/models/ProjectFolder.ts +1 -1
- package/src/models/ProjectRequest.ts +1 -1
- package/src/models/ProjectSchema.ts +1 -1
- package/src/models/store/DataFile.ts +1 -1
- package/src/models/store/File.ts +1 -1
- package/src/models/store/Invitation.ts +1 -1
- package/src/models/store/Organization.ts +1 -1
- package/src/models/store/Permission.ts +59 -2
- package/src/models/store/UserIdentity.ts +1 -1
- package/src/models/transformers/ArcDexieTransformer.ts +1 -1
- package/src/models/transformers/ArcLegacyTransformer.ts +1 -1
- package/src/models/transformers/ArcPouchTransformer.ts +1 -1
- package/src/models/transformers/PostmanV21Transformer.ts +1 -1
- package/src/models/transformers/PostmanV2Transformer.ts +1 -1
- package/src/nanoid.ts +10 -0
- package/src/patch/PatchClient.ts +1 -1
- package/src/sdk/FilesSdk.ts +1 -1
- package/tests/unit/modeling/domain_file.spec.ts +4 -0
- package/tests/unit/models/File/new.spec.ts +2 -0
- package/tests/unit/models/File/toJSON.spec.ts +2 -0
- package/tests/unit/models/Folder/create.spec.ts +4 -0
- package/tests/unit/models/Permission/all.spec.ts +88 -0
- package/tests/unit/models/Project/create.spec.ts +4 -0
- package/tests/unit/runtime/proxy/HttpProjectProxy.spec.ts +1 -1
|
@@ -41734,10 +41734,10 @@
|
|
|
41734
41734
|
"@id": "#200"
|
|
41735
41735
|
},
|
|
41736
41736
|
{
|
|
41737
|
-
"@id": "#
|
|
41737
|
+
"@id": "#206"
|
|
41738
41738
|
},
|
|
41739
41739
|
{
|
|
41740
|
-
"@id": "#
|
|
41740
|
+
"@id": "#203"
|
|
41741
41741
|
},
|
|
41742
41742
|
{
|
|
41743
41743
|
"@id": "#209"
|
|
@@ -42470,15 +42470,15 @@
|
|
|
42470
42470
|
"@id": "#219"
|
|
42471
42471
|
},
|
|
42472
42472
|
{
|
|
42473
|
-
"@id": "#216"
|
|
42474
|
-
},
|
|
42475
|
-
{
|
|
42476
42473
|
"@id": "#210"
|
|
42477
42474
|
},
|
|
42478
42475
|
{
|
|
42479
42476
|
"@id": "#213"
|
|
42480
42477
|
},
|
|
42481
42478
|
{
|
|
42479
|
+
"@id": "#216"
|
|
42480
|
+
},
|
|
42481
|
+
{
|
|
42482
42482
|
"@id": "#219"
|
|
42483
42483
|
}
|
|
42484
42484
|
],
|
|
@@ -43180,7 +43180,7 @@
|
|
|
43180
43180
|
"doc:ExternalDomainElement",
|
|
43181
43181
|
"doc:DomainElement"
|
|
43182
43182
|
],
|
|
43183
|
-
"doc:raw": "code: '
|
|
43183
|
+
"doc:raw": "code: '7487'\ndescription: 'Financial and insurance activities'\ntype: \"PRIMARY\"\nclassificationCode: 'BE_NACEBEL2008'\nactivityGroupCode: 'ABCDE'\n",
|
|
43184
43184
|
"core:mediaType": "application/yaml",
|
|
43185
43185
|
"sourcemaps:sources": [
|
|
43186
43186
|
{
|
|
@@ -43201,7 +43201,7 @@
|
|
|
43201
43201
|
"doc:ExternalDomainElement",
|
|
43202
43202
|
"doc:DomainElement"
|
|
43203
43203
|
],
|
|
43204
|
-
"doc:raw": "code: '
|
|
43204
|
+
"doc:raw": "code: 'J'\ndescription: 'Information and communication'\n",
|
|
43205
43205
|
"core:mediaType": "application/yaml",
|
|
43206
43206
|
"sourcemaps:sources": [
|
|
43207
43207
|
{
|
|
@@ -43892,7 +43892,7 @@
|
|
|
43892
43892
|
"doc:ExternalDomainElement",
|
|
43893
43893
|
"doc:DomainElement"
|
|
43894
43894
|
],
|
|
43895
|
-
"doc:raw": "type: 'GENERAL'\ncountryDialCode : '+32'\nareaCode : '
|
|
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": "
|
|
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'\
|
|
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
|
{
|
|
@@ -44436,12 +44436,12 @@
|
|
|
44436
44436
|
{
|
|
44437
44437
|
"@id": "#205/source-map/lexical/element_0",
|
|
44438
44438
|
"sourcemaps:element": "amf://id#205",
|
|
44439
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44439
|
+
"sourcemaps:value": "[(1,0)-(6,0)]"
|
|
44440
44440
|
},
|
|
44441
44441
|
{
|
|
44442
44442
|
"@id": "#208/source-map/lexical/element_0",
|
|
44443
44443
|
"sourcemaps:element": "amf://id#208",
|
|
44444
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44444
|
+
"sourcemaps:value": "[(1,0)-(3,0)]"
|
|
44445
44445
|
},
|
|
44446
44446
|
{
|
|
44447
44447
|
"@id": "#223/source-map/lexical/element_0",
|
|
@@ -44781,12 +44781,12 @@
|
|
|
44781
44781
|
{
|
|
44782
44782
|
"@id": "#215/source-map/lexical/element_0",
|
|
44783
44783
|
"sourcemaps:element": "amf://id#215",
|
|
44784
|
-
"sourcemaps:value": "[(1,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)-(
|
|
44789
|
+
"sourcemaps:value": "[(1,0)-(7,0)]"
|
|
44790
44790
|
},
|
|
44791
44791
|
{
|
|
44792
44792
|
"@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.13.
|
|
4
|
+
"version": "0.13.6",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./browser.js": {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"types": "./build/src/index.d.ts"
|
|
19
19
|
},
|
|
20
20
|
"./package.json": "./package.json",
|
|
21
|
+
"./nanoid.js": "./build/src/nanoid*.js",
|
|
21
22
|
"./amf/*.js": "./build/src/amf/*.js",
|
|
22
23
|
"./amf/*": "./build/src/amf/*",
|
|
23
24
|
"./authorization/*.js": "./build/src/authorization/*.js",
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
unionShape,
|
|
26
26
|
} from './definitions/Shapes.js'
|
|
27
27
|
import { AmfDataNode } from './models/AmfDataNode.js'
|
|
28
|
-
import { nanoid } from 'nanoid'
|
|
28
|
+
import { nanoid } from '../nanoid.js'
|
|
29
29
|
import { DataEntityKind, DataPropertyKind } from '../models/kinds.js'
|
|
30
30
|
import { DataValueGenerator } from './DataValueGenerator.js'
|
|
31
31
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { nanoid } from 'nanoid'
|
|
1
|
+
import { nanoid } from '../../nanoid.js'
|
|
2
2
|
import { IAmfArrayNodeTypes, IAmfObjectNodeTypes, IAmfScalarNodeTypes } from '../AmfTypes.js'
|
|
3
3
|
import { IApiCustomDomainProperty } from '../definitions/Base.js'
|
|
4
4
|
import { AmfNamespace } from '../definitions/Namespace.js'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DataDomain } from './DataDomain.js'
|
|
2
2
|
import { DomainAssociationKind } from '../models/kinds.js'
|
|
3
3
|
import { DomainElement, type DomainElementSchema } from './DomainElement.js'
|
|
4
|
-
import { nanoid } from 'nanoid'
|
|
4
|
+
import { nanoid } from '../nanoid.js'
|
|
5
5
|
import { type IThing, Thing } from '../models/Thing.js'
|
|
6
6
|
import { observed, retargetChange, toRaw } from './observed.js'
|
|
7
7
|
import type { DomainEntity } from './DomainEntity.js'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DataDomain } from './DataDomain.js'
|
|
2
2
|
import { DomainAssociationKind, DomainEntityKind, DomainPropertyKind } from '../models/kinds.js'
|
|
3
3
|
import { DomainElement, type DomainElementSchema } from './DomainElement.js'
|
|
4
|
-
import { nanoid } from 'nanoid'
|
|
4
|
+
import { nanoid } from '../nanoid.js'
|
|
5
5
|
import { type IThing, Thing } from '../models/Thing.js'
|
|
6
6
|
import { observed, retargetChange, toRaw } from './observed.js'
|
|
7
7
|
import type { IShapeUnion } from '../amf/definitions/Shapes.js'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DataDomain } from './DataDomain.js'
|
|
2
2
|
import { DomainEntityKind, DomainModelKind } from '../models/kinds.js'
|
|
3
3
|
import { DomainElement, DomainElementSchema } from './DomainElement.js'
|
|
4
|
-
import { nanoid } from 'nanoid'
|
|
4
|
+
import { nanoid } from '../nanoid.js'
|
|
5
5
|
import { type IThing, Thing } from '../models/Thing.js'
|
|
6
6
|
import { observed, retargetChange } from './observed.js'
|
|
7
7
|
import type { DomainNamespace } from './DomainNamespace.js'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DataDomain } from './DataDomain.js'
|
|
2
2
|
import { DomainModelKind, DomainNamespaceKind } from '../models/kinds.js'
|
|
3
3
|
import { DomainElement, DomainElementSchema } from './DomainElement.js'
|
|
4
|
-
import { nanoid } from 'nanoid'
|
|
4
|
+
import { nanoid } from '../nanoid.js'
|
|
5
5
|
import { IThing, Thing } from '../models/Thing.js'
|
|
6
6
|
import { observed, retargetChange } from './observed.js'
|
|
7
7
|
import { DomainModel, DomainModelSchema } from './DomainModel.js'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DataDomain } from './DataDomain.js'
|
|
2
2
|
import { DomainPropertyKind } from '../models/kinds.js'
|
|
3
3
|
import { DomainElement, type DomainElementSchema } from './DomainElement.js'
|
|
4
|
-
import { nanoid } from 'nanoid'
|
|
4
|
+
import { nanoid } from '../nanoid.js'
|
|
5
5
|
import { type IThing, Thing } from '../models/Thing.js'
|
|
6
6
|
import { observed, retargetChange, toRaw } from './observed.js'
|
|
7
7
|
import {
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
} from '../../amf/definitions/Shapes.js'
|
|
28
28
|
import { AmfDataNode } from '../../amf/models/AmfDataNode.js'
|
|
29
29
|
import { DataValueGenerator } from '../../amf/DataValueGenerator.js'
|
|
30
|
-
import { nanoid } from 'nanoid'
|
|
30
|
+
import { nanoid } from '../../nanoid.js'
|
|
31
31
|
import { DomainEntityKind, DomainPropertyKind } from '../../models/kinds.js'
|
|
32
32
|
import type { PropertySchema } from '../types.js'
|
|
33
33
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AmfShapeGenerator } from '../../amf/AmfShapeGenerator.js'
|
|
2
2
|
import { IApiAssociationShape, IApiPropertyShape } from '../../amf/definitions/Shapes.js'
|
|
3
|
-
import { nanoid } from 'nanoid'
|
|
3
|
+
import { nanoid } from '../../nanoid.js'
|
|
4
4
|
import { IThing, Thing } from '../../models/Thing.js'
|
|
5
5
|
import { DataEntity, IDataEntity } from './DataEntity.js'
|
|
6
6
|
import { DataNamespace } from './DataNamespace.js'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IThing, Thing } from '../../models/Thing.js'
|
|
2
|
-
import { nanoid } from 'nanoid'
|
|
2
|
+
import { nanoid } from '../../nanoid.js'
|
|
3
3
|
import { DataNamespace } from './DataNamespace.js'
|
|
4
4
|
import { DataProperty } from './DataProperty.js'
|
|
5
5
|
import { type DataPropertyType } from '../DataFormat.js'
|
|
@@ -2,7 +2,7 @@ import { DataEntity } from './DataEntity.js'
|
|
|
2
2
|
import { DataNamespace } from './DataNamespace.js'
|
|
3
3
|
import { type DataPropertyType } from '../DataFormat.js'
|
|
4
4
|
import { type IThing, Thing } from '../../models/Thing.js'
|
|
5
|
-
import { nanoid } from 'nanoid'
|
|
5
|
+
import { nanoid } from '../../nanoid.js'
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* A fluent builder for constructing `DataEntity` instances.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IThing, Thing } from '../../models/Thing.js'
|
|
2
|
-
import { nanoid } from 'nanoid'
|
|
2
|
+
import { nanoid } from '../../nanoid.js'
|
|
3
3
|
import { DataEntity, IDataEntity } from './DataEntity.js'
|
|
4
4
|
import type { DataItemAdaptingOptions, DataNamespace } from './DataNamespace.js'
|
|
5
5
|
import { FileBreadcrumb } from '../../models/store/File.js'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IThing, Thing } from '../../models/Thing.js'
|
|
2
|
-
import { nanoid } from 'nanoid'
|
|
2
|
+
import { nanoid } from '../../nanoid.js'
|
|
3
3
|
import { DataNamespace } from './DataNamespace.js'
|
|
4
4
|
import { IApiPropertyShape } from '../../amf/definitions/Shapes.js'
|
|
5
5
|
import { AmfShapeGenerator } from '../../amf/AmfShapeGenerator.js'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Property, IProperty } from './Property.js'
|
|
2
2
|
import { Server, IServer } from './Server.js'
|
|
3
3
|
import { IThing, Thing } from './Thing.js'
|
|
4
|
-
import { nanoid } from 'nanoid'
|
|
4
|
+
import { nanoid } from '../nanoid.js'
|
|
5
5
|
import { ARCVariable } from './legacy/models/Variable.js'
|
|
6
6
|
import { IRequestAuthorization, RequestAuthorization } from './RequestAuthorization.js'
|
|
7
7
|
|
package/src/models/Folder.ts
CHANGED
package/src/models/HostRule.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { IProjectFolder, ProjectFolder } from './ProjectFolder.js'
|
|
|
12
12
|
import { IProjectRequest, ProjectRequest, Kind as ProjectRequestKind } from './ProjectRequest.js'
|
|
13
13
|
import { ProjectSchema, IProjectSchema } from './ProjectSchema.js'
|
|
14
14
|
import { Request } from './Request.js'
|
|
15
|
-
import { nanoid } from 'nanoid'
|
|
15
|
+
import { nanoid } from '../nanoid.js'
|
|
16
16
|
import { ARCSavedRequest, ARCHistoryRequest } from './legacy/request/ArcRequest.js'
|
|
17
17
|
import { ArcLegacyProject, ARCProject } from './legacy/models/ArcLegacyProject.js'
|
|
18
18
|
import { PostmanDataTransformer } from './transformers/PostmanDataTransformer.js'
|
package/src/models/Project.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { nanoid } from 'nanoid'
|
|
1
|
+
import { nanoid } from '../nanoid.js'
|
|
2
2
|
import { ProjectParent } from './ProjectParent.js'
|
|
3
3
|
import { type IProjectDefinitionProperty } from './ProjectDefinitionProperty.js'
|
|
4
4
|
import { ProjectItem, type IProjectItem } from './ProjectItem.js'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { nanoid } from 'nanoid'
|
|
1
|
+
import { nanoid } from '../nanoid.js'
|
|
2
2
|
import { ProjectDefinitionProperty, IProjectDefinitionProperty } from './ProjectDefinitionProperty.js'
|
|
3
3
|
import { ProjectFolder } from './ProjectFolder.js'
|
|
4
4
|
import { IHttpRequest, Kind as HttpRequestKind } from './HttpRequest.js'
|
package/src/models/store/File.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { nanoid } from 'nanoid'
|
|
1
|
+
import { nanoid } from '../../nanoid.js'
|
|
2
2
|
|
|
3
3
|
export const Kind = 'Core#Permission'
|
|
4
4
|
|
|
@@ -11,6 +11,12 @@ export type PermissionType = 'user' | 'group' | 'organization'
|
|
|
11
11
|
*/
|
|
12
12
|
export type PermissionRole = 'owner' | 'reader' | 'commenter' | 'writer'
|
|
13
13
|
const orderedRoles: PermissionRole[] = ['reader', 'commenter', 'writer', 'owner']
|
|
14
|
+
/**
|
|
15
|
+
* A predefined set of rules that can be used to determine the source of the permission.
|
|
16
|
+
* - `direct_user_grant`: The permission is granted directly to the user.
|
|
17
|
+
* - `creator_default_owner`: The permission is granted to the creator of the item as the default owner.
|
|
18
|
+
*/
|
|
19
|
+
export type PermissionSourceRule = 'direct_user_grant' | 'creator_default_owner' | 'parent_owner_editor_rule'
|
|
14
20
|
|
|
15
21
|
interface IBasePermission {
|
|
16
22
|
/**
|
|
@@ -54,6 +60,20 @@ interface IBasePermission {
|
|
|
54
60
|
* The store id of the user that added this permission.
|
|
55
61
|
*/
|
|
56
62
|
addingUser: string
|
|
63
|
+
/**
|
|
64
|
+
* The depth of the permission in the hierarchy.
|
|
65
|
+
* When `0` it means that the permissions do not use inheritance.
|
|
66
|
+
* When `1` it means the permission is set on the item itself.
|
|
67
|
+
* When `2` it means the permission is set on the parent item.
|
|
68
|
+
* When `3` it means the permission is set on the grandparent item, and so on.
|
|
69
|
+
* This is used to determine the depth of the permission in the hierarchy.
|
|
70
|
+
*/
|
|
71
|
+
depth: number
|
|
72
|
+
/**
|
|
73
|
+
* The source rule of the permission.
|
|
74
|
+
* This is used to determine how the permission was granted.
|
|
75
|
+
*/
|
|
76
|
+
sourceRule: PermissionSourceRule
|
|
57
77
|
}
|
|
58
78
|
|
|
59
79
|
/**
|
|
@@ -118,6 +138,20 @@ export class Permission {
|
|
|
118
138
|
* The store id of the entity that is being granted the permission.
|
|
119
139
|
*/
|
|
120
140
|
itemId = ''
|
|
141
|
+
/**
|
|
142
|
+
* The depth of the permission in the hierarchy.
|
|
143
|
+
* When `0` it means that the permissions do not use inheritance.
|
|
144
|
+
* When `1` it means the permission is set on the item itself.
|
|
145
|
+
* When `2` it means the permission is set on the parent item.
|
|
146
|
+
* When `3` it means the permission is set on the grandparent item, and so on.
|
|
147
|
+
* This is used to determine the depth of the permission in the hierarchy.
|
|
148
|
+
*/
|
|
149
|
+
depth = 0
|
|
150
|
+
/**
|
|
151
|
+
* The source rule of the permission.
|
|
152
|
+
* This is used to determine how the permission was granted.
|
|
153
|
+
*/
|
|
154
|
+
sourceRule: PermissionSourceRule = 'direct_user_grant'
|
|
121
155
|
|
|
122
156
|
/**
|
|
123
157
|
* Creates a Permission object for a user.
|
|
@@ -136,6 +170,8 @@ export class Permission {
|
|
|
136
170
|
role,
|
|
137
171
|
type: 'user',
|
|
138
172
|
addingUser,
|
|
173
|
+
depth: 0,
|
|
174
|
+
sourceRule: 'direct_user_grant',
|
|
139
175
|
}
|
|
140
176
|
return new Permission(init)
|
|
141
177
|
}
|
|
@@ -157,6 +193,8 @@ export class Permission {
|
|
|
157
193
|
role,
|
|
158
194
|
type: 'group',
|
|
159
195
|
addingUser,
|
|
196
|
+
depth: 0,
|
|
197
|
+
sourceRule: 'direct_user_grant',
|
|
160
198
|
}
|
|
161
199
|
return new Permission(init)
|
|
162
200
|
}
|
|
@@ -182,6 +220,8 @@ export class Permission {
|
|
|
182
220
|
role,
|
|
183
221
|
type: 'organization',
|
|
184
222
|
addingUser,
|
|
223
|
+
depth: 0,
|
|
224
|
+
sourceRule: 'direct_user_grant',
|
|
185
225
|
}
|
|
186
226
|
return new Permission(init)
|
|
187
227
|
}
|
|
@@ -212,6 +252,8 @@ export class Permission {
|
|
|
212
252
|
role: 'reader',
|
|
213
253
|
type: 'user',
|
|
214
254
|
addingUser: '',
|
|
255
|
+
depth: 0,
|
|
256
|
+
sourceRule: 'direct_user_grant',
|
|
215
257
|
}
|
|
216
258
|
}
|
|
217
259
|
this.new(init)
|
|
@@ -221,7 +263,18 @@ export class Permission {
|
|
|
221
263
|
if (!Permission.isPermission(init)) {
|
|
222
264
|
throw new Error(`Not a permission.`)
|
|
223
265
|
}
|
|
224
|
-
const {
|
|
266
|
+
const {
|
|
267
|
+
key = nanoid(),
|
|
268
|
+
granteeId,
|
|
269
|
+
role,
|
|
270
|
+
type,
|
|
271
|
+
displayName,
|
|
272
|
+
expirationTime,
|
|
273
|
+
addingUser,
|
|
274
|
+
itemId,
|
|
275
|
+
depth,
|
|
276
|
+
sourceRule,
|
|
277
|
+
} = init
|
|
225
278
|
this.kind = Kind
|
|
226
279
|
this.key = key
|
|
227
280
|
this.granteeId = granteeId
|
|
@@ -229,6 +282,8 @@ export class Permission {
|
|
|
229
282
|
this.role = role
|
|
230
283
|
this.type = type
|
|
231
284
|
this.addingUser = addingUser
|
|
285
|
+
this.depth = depth || 0
|
|
286
|
+
this.sourceRule = sourceRule || 'direct_user_grant'
|
|
232
287
|
if (displayName) {
|
|
233
288
|
this.displayName = displayName
|
|
234
289
|
} else {
|
|
@@ -296,6 +351,8 @@ export class Permission {
|
|
|
296
351
|
addingUser: this.addingUser,
|
|
297
352
|
granteeId: this.granteeId,
|
|
298
353
|
itemId: this.itemId,
|
|
354
|
+
depth: this.depth,
|
|
355
|
+
sourceRule: this.sourceRule,
|
|
299
356
|
}
|
|
300
357
|
if (this.displayName) {
|
|
301
358
|
result.displayName = this.displayName
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { nanoid } from 'nanoid'
|
|
2
|
+
import { nanoid } from '../../nanoid.js'
|
|
3
3
|
import { BaseTransformer, dataValue } from './BaseTransformer.js'
|
|
4
4
|
import { ArcExportObject, ExportArcProjects, ExportArcSavedRequest } from '../legacy/DataExport.js'
|
|
5
5
|
|
|
@@ -4,7 +4,7 @@ import { HttpProject, IHttpProject, Kind as ProjectKind } from '../HttpProject.j
|
|
|
4
4
|
import { ProjectFolder } from '../ProjectFolder.js'
|
|
5
5
|
import { ProjectRequest } from '../ProjectRequest.js'
|
|
6
6
|
import { IMultipartBody } from '../../lib/transformers/PayloadSerializer.js'
|
|
7
|
-
import { nanoid } from 'nanoid'
|
|
7
|
+
import { nanoid } from '../../nanoid.js'
|
|
8
8
|
import { Environment } from '../Environment.js'
|
|
9
9
|
import { Thing } from '../Thing.js'
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ import { HttpProject, IHttpProject, Kind as HttpProjectKind } from '../HttpProje
|
|
|
4
4
|
import { ProjectFolder } from '../ProjectFolder.js'
|
|
5
5
|
import { ProjectRequest } from '../ProjectRequest.js'
|
|
6
6
|
import { IMultipartBody } from '../../lib/transformers/PayloadSerializer.js'
|
|
7
|
-
import { nanoid } from 'nanoid'
|
|
7
|
+
import { nanoid } from '../../nanoid.js'
|
|
8
8
|
import { Environment } from '../Environment.js'
|
|
9
9
|
import { Thing } from '../Thing.js'
|
|
10
10
|
|
package/src/nanoid.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { customAlphabet } from 'nanoid'
|
|
2
|
+
/**
|
|
3
|
+
* The data store uses the LTREE for storing hierarchical data.
|
|
4
|
+
* The PG extension for LTREE requires the keys to be
|
|
5
|
+
* alphanumeric and underscore characters only.
|
|
6
|
+
* This is a custom nanoid generator that generates
|
|
7
|
+
* 21 character long IDs using the allowed characters. The same the API is using.
|
|
8
|
+
*/
|
|
9
|
+
const nanoid = customAlphabet('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_', 21)
|
|
10
|
+
export { nanoid }
|
package/src/patch/PatchClient.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Operation } from '@api-client/json/patch/types.js'
|
|
2
2
|
import { JsonDocument } from '@api-client/json/patch/json_document.js'
|
|
3
|
-
import { nanoid } from 'nanoid'
|
|
3
|
+
import { nanoid } from '../nanoid.js'
|
|
4
4
|
import type { MediaPatchInfo, PatchInfo } from './types.js'
|
|
5
5
|
|
|
6
6
|
/**
|
package/src/sdk/FilesSdk.ts
CHANGED
|
@@ -12,7 +12,7 @@ import type { FileBreadcrumb, IFile } from '../models/store/File.js'
|
|
|
12
12
|
import { FolderKind, CertificateFileKind, ProjectKind, DomainFileKind } from '../models/kinds.js'
|
|
13
13
|
import type { ContextListResult, IBulkOperationResult, ContextListOptions } from '../events/BaseEvents.js'
|
|
14
14
|
import type { IAccessAddOperation, IAccessRemoveOperation, PermissionRole } from '../models/store/Permission.js'
|
|
15
|
-
import { nanoid } from 'nanoid'
|
|
15
|
+
import { nanoid } from '../nanoid.js'
|
|
16
16
|
import { Folder, type IFolder } from '../models/Folder.js'
|
|
17
17
|
import type { AccessPatchInfo, MediaPatchInfo, MediaPatchRevision, PatchInfo } from '../patch/types.js'
|
|
18
18
|
import { Exception } from '../exceptions/exception.js'
|
|
@@ -72,6 +72,8 @@ test.group('constructor()', () => {
|
|
|
72
72
|
role: 'commenter',
|
|
73
73
|
type: 'organization',
|
|
74
74
|
itemId: '678',
|
|
75
|
+
depth: 0,
|
|
76
|
+
sourceRule: 'creator_default_owner',
|
|
75
77
|
},
|
|
76
78
|
],
|
|
77
79
|
lastModified: { byMe: false, time: 0, user: 'id', name: 'test' },
|
|
@@ -112,6 +114,8 @@ test.group('constructor()', () => {
|
|
|
112
114
|
role: 'commenter',
|
|
113
115
|
type: 'organization',
|
|
114
116
|
itemId: '678',
|
|
117
|
+
depth: 0,
|
|
118
|
+
sourceRule: 'creator_default_owner',
|
|
115
119
|
},
|
|
116
120
|
],
|
|
117
121
|
lastModified: { byMe: false, time: 0, user: 'id', name: 'test' },
|