@api-client/core 0.13.6 → 0.14.0

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.
Files changed (46) hide show
  1. package/build/src/modeling/DomainFile.d.ts +2 -3
  2. package/build/src/modeling/DomainFile.d.ts.map +1 -1
  3. package/build/src/modeling/DomainFile.js +4 -8
  4. package/build/src/modeling/DomainFile.js.map +1 -1
  5. package/build/src/models/CertificateFile.d.ts +2 -3
  6. package/build/src/models/CertificateFile.d.ts.map +1 -1
  7. package/build/src/models/CertificateFile.js +4 -8
  8. package/build/src/models/CertificateFile.js.map +1 -1
  9. package/build/src/models/Folder.d.ts +1 -2
  10. package/build/src/models/Folder.d.ts.map +1 -1
  11. package/build/src/models/Folder.js +2 -4
  12. package/build/src/models/Folder.js.map +1 -1
  13. package/build/src/models/Project.d.ts +2 -3
  14. package/build/src/models/Project.d.ts.map +1 -1
  15. package/build/src/models/Project.js +4 -8
  16. package/build/src/models/Project.js.map +1 -1
  17. package/build/src/models/store/DataFile.d.ts +2 -4
  18. package/build/src/models/store/DataFile.d.ts.map +1 -1
  19. package/build/src/models/store/DataFile.js +4 -9
  20. package/build/src/models/store/DataFile.js.map +1 -1
  21. package/build/src/models/store/File.d.ts +1 -21
  22. package/build/src/models/store/File.d.ts.map +1 -1
  23. package/build/src/models/store/File.js +3 -23
  24. package/build/src/models/store/File.js.map +1 -1
  25. package/build/src/sdk/FilesSdk.js +1 -1
  26. package/build/src/sdk/FilesSdk.js.map +1 -1
  27. package/build/tsconfig.tsbuildinfo +1 -1
  28. package/data/models/example-generator-api.json +16 -16
  29. package/eslint.config.js +1 -0
  30. package/package.json +5 -5
  31. package/src/modeling/DomainFile.ts +4 -8
  32. package/src/models/CertificateFile.ts +4 -12
  33. package/src/models/Folder.ts +2 -4
  34. package/src/models/Project.ts +4 -8
  35. package/src/models/store/DataFile.ts +4 -9
  36. package/src/models/store/File.ts +4 -35
  37. package/src/sdk/FilesSdk.ts +1 -1
  38. package/tests/unit/modeling/domain_file.spec.ts +4 -27
  39. package/tests/unit/models/Certificate/from_name.spec.ts +3 -15
  40. package/tests/unit/models/File/constructor.spec.ts +0 -1
  41. package/tests/unit/models/File/new.spec.ts +0 -13
  42. package/tests/unit/models/File/shortcutTo.spec.ts +1 -2
  43. package/tests/unit/models/File/toJSON.spec.ts +0 -13
  44. package/tests/unit/models/File/updateByMeMeta.spec.ts +4 -6
  45. package/tests/unit/models/Folder/create.spec.ts +2 -23
  46. package/tests/unit/models/Project/create.spec.ts +6 -32
@@ -4,19 +4,16 @@ import { File, ThingKind, IFile } from '../../../../src/index.js'
4
4
  test.group('File.toJSON()', (group) => {
5
5
  let file: File
6
6
  let base: IFile
7
- const organization = 'test123'
8
7
 
9
8
  group.each.setup(() => {
10
9
  file = new File()
11
10
  base = {
12
11
  kind: 'test-kind',
13
- organization,
14
12
  info: {
15
13
  kind: ThingKind,
16
14
  name: 'hello',
17
15
  description: 'a desc',
18
16
  },
19
- owner: 'me',
20
17
  key: '123',
21
18
  parents: ['p1'],
22
19
  permissionIds: ['pr1'],
@@ -43,21 +40,11 @@ test.group('File.toJSON()', (group) => {
43
40
  assert.equal(result.key, base.key)
44
41
  })
45
42
 
46
- test('sets the organization', ({ assert }) => {
47
- const result = file.toJSON()
48
- assert.equal(result.organization, organization)
49
- })
50
-
51
43
  test('sets the kind', ({ assert }) => {
52
44
  const result = file.toJSON()
53
45
  assert.equal(result.kind, base.kind)
54
46
  })
55
47
 
56
- test('sets the owner', ({ assert }) => {
57
- const result = file.toJSON()
58
- assert.equal(result.owner, base.owner)
59
- })
60
-
61
48
  test('sets the info', ({ assert }) => {
62
49
  const result = file.toJSON()
63
50
  assert.deepEqual(result.info, base.info)
@@ -2,10 +2,8 @@ import { test } from '@japa/runner'
2
2
  import { File, Folder } from '../../../../src/index.js'
3
3
 
4
4
  test.group('File.updateByMeMeta()', () => {
5
- const organization = 'test123'
6
-
7
5
  test('sets deletedInfo.byMe for the same user', ({ assert }) => {
8
- const schema = Folder.fromName('s1', organization).toJSON()
6
+ const schema = Folder.fromName('s1').toJSON()
9
7
  schema.deletedInfo = {
10
8
  byMe: false,
11
9
  time: 1,
@@ -17,7 +15,7 @@ test.group('File.updateByMeMeta()', () => {
17
15
  })
18
16
 
19
17
  test('sets deletedInfo.byMe for the different user', ({ assert }) => {
20
- const schema = Folder.fromName('s1', organization).toJSON()
18
+ const schema = Folder.fromName('s1').toJSON()
21
19
  schema.deletedInfo = {
22
20
  byMe: false,
23
21
  time: 1,
@@ -29,7 +27,7 @@ test.group('File.updateByMeMeta()', () => {
29
27
  })
30
28
 
31
29
  test('sets lastModified.byMe for the same user', ({ assert }) => {
32
- const schema = Folder.fromName('s1', organization).toJSON()
30
+ const schema = Folder.fromName('s1').toJSON()
33
31
  schema.lastModified = {
34
32
  byMe: false,
35
33
  time: 1,
@@ -41,7 +39,7 @@ test.group('File.updateByMeMeta()', () => {
41
39
  })
42
40
 
43
41
  test('sets lastModified.byMe for the different user', ({ assert }) => {
44
- const schema = Folder.fromName('s1', organization).toJSON()
42
+ const schema = Folder.fromName('s1').toJSON()
45
43
  schema.lastModified = {
46
44
  byMe: false,
47
45
  time: 1,
@@ -1,35 +1,22 @@
1
1
  import { test } from '@japa/runner'
2
2
  import { Folder, FolderKind, IFolder, ThingKind } from '../../../../src/index.js'
3
3
 
4
- const organization = 'test-organization'
5
-
6
4
  test.group('Folder.fromName()', () => {
7
5
  test('sets the kind', ({ assert }) => {
8
- const result = Folder.fromName('name', organization)
6
+ const result = Folder.fromName('name')
9
7
  assert.equal(result.kind, FolderKind)
10
8
  })
11
9
 
12
- test('sets the organization', ({ assert }) => {
13
- const result = Folder.fromName('name', organization)
14
- assert.equal(result.organization, organization)
15
- })
16
-
17
10
  test('sets the name', ({ assert }) => {
18
- const result = Folder.fromName('name', organization)
11
+ const result = Folder.fromName('name')
19
12
  assert.equal(result.info.name, 'name')
20
13
  })
21
-
22
- test('sets the passed owner', ({ assert }) => {
23
- const result = Folder.fromName('name', organization, 'me')
24
- assert.equal(result.owner, 'me')
25
- })
26
14
  })
27
15
 
28
16
  test.group('Folder.constructor()', () => {
29
17
  test('creates a default Folder', ({ assert }) => {
30
18
  const result = new Folder()
31
19
  assert.equal(result.kind, FolderKind)
32
- assert.isUndefined(result.owner)
33
20
  assert.typeOf(result.key, 'string')
34
21
  assert.typeOf(result.lastModified, 'object')
35
22
  })
@@ -37,13 +24,11 @@ test.group('Folder.constructor()', () => {
37
24
  test('creates a Folder from the schema values', ({ assert }) => {
38
25
  const schema: IFolder = {
39
26
  kind: FolderKind,
40
- organization,
41
27
  info: {
42
28
  kind: ThingKind,
43
29
  name: 'hello',
44
30
  description: 'a desc',
45
31
  },
46
- owner: 'me',
47
32
  key: '123',
48
33
  parents: ['p1'],
49
34
  permissionIds: ['pr1'],
@@ -65,9 +50,7 @@ test.group('Folder.constructor()', () => {
65
50
  }
66
51
  const result = new Folder(schema)
67
52
  assert.equal(result.kind, FolderKind)
68
- assert.equal(result.organization, organization)
69
53
  assert.equal(result.info.name, 'hello')
70
- assert.equal(result.owner, 'me')
71
54
  assert.equal(result.key, '123')
72
55
  assert.deepEqual(result.parents, ['p1'])
73
56
  assert.deepEqual(result.permissionIds, ['pr1'])
@@ -79,13 +62,11 @@ test.group('Folder.constructor()', () => {
79
62
  test('creates a Folder from the JSON schema string', ({ assert }) => {
80
63
  const schema: IFolder = {
81
64
  kind: FolderKind,
82
- organization,
83
65
  info: {
84
66
  kind: ThingKind,
85
67
  name: 'hello',
86
68
  description: 'a desc',
87
69
  },
88
- owner: 'me',
89
70
  key: '123',
90
71
  parents: ['p1'],
91
72
  permissionIds: ['pr1'],
@@ -106,9 +87,7 @@ test.group('Folder.constructor()', () => {
106
87
  }
107
88
  const result = new Folder(JSON.stringify(schema))
108
89
  assert.equal(result.kind, FolderKind)
109
- assert.equal(result.organization, organization)
110
90
  assert.equal(result.info.name, 'hello')
111
- assert.equal(result.owner, 'me')
112
91
  assert.equal(result.key, '123')
113
92
  assert.deepEqual(result.lastModified, schema.lastModified)
114
93
  })
@@ -1,68 +1,50 @@
1
1
  import { test } from '@japa/runner'
2
2
  import { HttpProject, IProject, Project, ProjectKind, ThingKind } from '../../../../src/index.js'
3
3
 
4
- const organization = 'test-organization'
5
-
6
4
  test.group('Project.fromProject()', () => {
7
5
  test('sets the kind', ({ assert }) => {
8
6
  const p1 = HttpProject.fromName('p1')
9
- const result = Project.fromProject(p1, organization)
7
+ const result = Project.fromProject(p1)
10
8
  assert.equal(result.kind, ProjectKind)
11
9
  })
12
10
 
13
- test('sets the organization', ({ assert }) => {
14
- const p1 = HttpProject.fromName('p1')
15
- const result = Project.fromProject(p1, organization)
16
- assert.equal(result.organization, organization)
17
- })
18
-
19
11
  test('sets the name', ({ assert }) => {
20
12
  const p1 = HttpProject.fromName('p1')
21
- const result = Project.fromProject(p1, organization)
13
+ const result = Project.fromProject(p1)
22
14
  assert.equal(result.info.name, 'p1')
23
15
  })
24
16
 
25
17
  test('sets the key', ({ assert }) => {
26
18
  const p1 = HttpProject.fromName('p1')
27
- const result = Project.fromProject(p1, organization)
19
+ const result = Project.fromProject(p1)
28
20
  assert.equal(result.key, p1.key)
29
21
  })
30
22
 
31
23
  test('respects schema instead of instance', ({ assert }) => {
32
24
  const p1 = HttpProject.fromName('p1')
33
- const result = Project.fromProject(p1.toJSON(), organization)
25
+ const result = Project.fromProject(p1.toJSON())
34
26
  assert.equal(result.info.name, 'p1')
35
27
  })
36
28
  })
37
29
 
38
30
  test.group('Project.fromName()', () => {
39
31
  test('creates project from a name', ({ assert }) => {
40
- const project = Project.fromName('test', 'org-id')
32
+ const project = Project.fromName('test')
41
33
  assert.equal(project.info.name, 'test')
42
34
  assert.equal(project.kind, ProjectKind)
43
- assert.isUndefined(project.owner)
44
- assert.equal(project.organization, 'org-id')
45
- })
46
-
47
- test('sets the owner', ({ assert }) => {
48
- const project = Project.fromName('test', 'org-id', 'owner-test')
49
- assert.equal(project.owner, 'owner-test')
50
35
  })
51
36
  })
52
37
 
53
38
  test.group('Project.constructor()', () => {
54
39
  test('creates project from a name', ({ assert }) => {
55
- const project = Project.fromName('test', 'org-id')
40
+ const project = Project.fromName('test')
56
41
  assert.equal(project.info.name, 'test')
57
42
  assert.equal(project.kind, ProjectKind)
58
- assert.isUndefined(project.owner)
59
- assert.equal(project.organization, 'org-id')
60
43
  })
61
44
 
62
45
  test('creates a default project', ({ assert }) => {
63
46
  const result = new Project()
64
47
  assert.equal(result.kind, ProjectKind)
65
- assert.isUndefined(result.owner)
66
48
  assert.typeOf(result.key, 'string')
67
49
  assert.typeOf(result.lastModified, 'object')
68
50
  })
@@ -70,13 +52,11 @@ test.group('Project.constructor()', () => {
70
52
  test('creates a project from the schema values', ({ assert }) => {
71
53
  const schema: IProject = {
72
54
  kind: ProjectKind,
73
- organization,
74
55
  info: {
75
56
  kind: ThingKind,
76
57
  name: 'hello',
77
58
  description: 'a desc',
78
59
  },
79
- owner: 'me',
80
60
  key: '123',
81
61
  parents: ['p1'],
82
62
  permissionIds: ['pr1'],
@@ -98,9 +78,7 @@ test.group('Project.constructor()', () => {
98
78
  }
99
79
  const result = new Project(schema)
100
80
  assert.equal(result.kind, ProjectKind)
101
- assert.equal(result.organization, organization)
102
81
  assert.equal(result.info.name, 'hello')
103
- assert.equal(result.owner, 'me')
104
82
  assert.equal(result.key, '123')
105
83
  assert.deepEqual(result.parents, ['p1'])
106
84
  assert.deepEqual(result.permissionIds, ['pr1'])
@@ -112,13 +90,11 @@ test.group('Project.constructor()', () => {
112
90
  test('creates a project from the JSON schema string', ({ assert }) => {
113
91
  const schema: IProject = {
114
92
  kind: ProjectKind,
115
- organization,
116
93
  info: {
117
94
  kind: ThingKind,
118
95
  name: 'hello',
119
96
  description: 'a desc',
120
97
  },
121
- owner: 'me',
122
98
  key: '123',
123
99
  parents: ['p1'],
124
100
  permissionIds: ['pr1'],
@@ -139,9 +115,7 @@ test.group('Project.constructor()', () => {
139
115
  }
140
116
  const result = new Project(JSON.stringify(schema))
141
117
  assert.equal(result.kind, ProjectKind)
142
- assert.equal(result.organization, organization)
143
118
  assert.equal(result.info.name, 'hello')
144
- assert.equal(result.owner, 'me')
145
119
  assert.equal(result.key, '123')
146
120
  assert.deepEqual(result.lastModified, schema.lastModified)
147
121
  })