@api-client/core 0.19.16 → 0.19.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.
Files changed (203) hide show
  1. package/build/src/browser.d.ts +12 -12
  2. package/build/src/browser.d.ts.map +1 -1
  3. package/build/src/browser.js +3 -3
  4. package/build/src/browser.js.map +1 -1
  5. package/build/src/exceptions/exception.d.ts +56 -0
  6. package/build/src/exceptions/exception.d.ts.map +1 -1
  7. package/build/src/exceptions/exception.js +111 -14
  8. package/build/src/exceptions/exception.js.map +1 -1
  9. package/build/src/index.d.ts +12 -12
  10. package/build/src/index.d.ts.map +1 -1
  11. package/build/src/index.js +3 -3
  12. package/build/src/index.js.map +1 -1
  13. package/build/src/mocking/ProjectMock.d.ts +1 -1
  14. package/build/src/mocking/ProjectMock.d.ts.map +1 -1
  15. package/build/src/mocking/ProjectMock.js.map +1 -1
  16. package/build/src/mocking/lib/File.d.ts +5 -5
  17. package/build/src/mocking/lib/File.d.ts.map +1 -1
  18. package/build/src/mocking/lib/File.js.map +1 -1
  19. package/build/src/mocking/lib/Organization.d.ts +3 -3
  20. package/build/src/mocking/lib/Organization.d.ts.map +1 -1
  21. package/build/src/mocking/lib/Organization.js +2 -1
  22. package/build/src/mocking/lib/Organization.js.map +1 -1
  23. package/build/src/mocking/lib/Permission.d.ts +6 -6
  24. package/build/src/mocking/lib/Permission.d.ts.map +1 -1
  25. package/build/src/mocking/lib/Permission.js.map +1 -1
  26. package/build/src/mocking/lib/User.d.ts +8 -4
  27. package/build/src/mocking/lib/User.d.ts.map +1 -1
  28. package/build/src/mocking/lib/User.js.map +1 -1
  29. package/build/src/modeling/ApiFile.d.ts +8 -4
  30. package/build/src/modeling/ApiFile.d.ts.map +1 -1
  31. package/build/src/modeling/ApiFile.js.map +1 -1
  32. package/build/src/modeling/ApiModel.d.ts +2 -2
  33. package/build/src/modeling/ApiModel.d.ts.map +1 -1
  34. package/build/src/modeling/ApiModel.js.map +1 -1
  35. package/build/src/modeling/DataDomain.d.ts +2 -2
  36. package/build/src/modeling/DataDomain.d.ts.map +1 -1
  37. package/build/src/modeling/DataDomain.js.map +1 -1
  38. package/build/src/modeling/DomainAssociation.d.ts +2 -2
  39. package/build/src/modeling/DomainAssociation.d.ts.map +1 -1
  40. package/build/src/modeling/DomainAssociation.js.map +1 -1
  41. package/build/src/modeling/DomainEntity.d.ts +2 -2
  42. package/build/src/modeling/DomainEntity.d.ts.map +1 -1
  43. package/build/src/modeling/DomainEntity.js.map +1 -1
  44. package/build/src/modeling/DomainFile.d.ts +8 -4
  45. package/build/src/modeling/DomainFile.d.ts.map +1 -1
  46. package/build/src/modeling/DomainFile.js.map +1 -1
  47. package/build/src/modeling/DomainModel.d.ts +2 -2
  48. package/build/src/modeling/DomainModel.d.ts.map +1 -1
  49. package/build/src/modeling/DomainModel.js.map +1 -1
  50. package/build/src/modeling/DomainNamespace.d.ts +2 -2
  51. package/build/src/modeling/DomainNamespace.d.ts.map +1 -1
  52. package/build/src/modeling/DomainNamespace.js.map +1 -1
  53. package/build/src/modeling/DomainProperty.d.ts +2 -2
  54. package/build/src/modeling/DomainProperty.d.ts.map +1 -1
  55. package/build/src/modeling/DomainProperty.js.map +1 -1
  56. package/build/src/modeling/helpers/Intelisense.d.ts +38 -38
  57. package/build/src/modeling/helpers/Intelisense.d.ts.map +1 -1
  58. package/build/src/modeling/helpers/Intelisense.js.map +1 -1
  59. package/build/src/models/AiMessage.d.ts +3 -3
  60. package/build/src/models/AiMessage.d.ts.map +1 -1
  61. package/build/src/models/AiMessage.js.map +1 -1
  62. package/build/src/models/AiSession.d.ts +3 -3
  63. package/build/src/models/AiSession.d.ts.map +1 -1
  64. package/build/src/models/AiSession.js.map +1 -1
  65. package/build/src/models/CertificateFile.d.ts +2 -2
  66. package/build/src/models/CertificateFile.d.ts.map +1 -1
  67. package/build/src/models/CertificateFile.js.map +1 -1
  68. package/build/src/models/Environment.d.ts +2 -2
  69. package/build/src/models/Environment.d.ts.map +1 -1
  70. package/build/src/models/Environment.js.map +1 -1
  71. package/build/src/models/Folder.d.ts +9 -5
  72. package/build/src/models/Folder.d.ts.map +1 -1
  73. package/build/src/models/Folder.js.map +1 -1
  74. package/build/src/models/HttpProject.d.ts +2 -2
  75. package/build/src/models/HttpProject.d.ts.map +1 -1
  76. package/build/src/models/HttpProject.js.map +1 -1
  77. package/build/src/models/ProjectFolder.d.ts +2 -2
  78. package/build/src/models/ProjectFolder.d.ts.map +1 -1
  79. package/build/src/models/ProjectFolder.js.map +1 -1
  80. package/build/src/models/Request.d.ts +3 -3
  81. package/build/src/models/Request.d.ts.map +1 -1
  82. package/build/src/models/Request.js.map +1 -1
  83. package/build/src/models/Thing.d.ts +9 -5
  84. package/build/src/models/Thing.d.ts.map +1 -1
  85. package/build/src/models/Thing.js.map +1 -1
  86. package/build/src/models/TrashEntry.d.ts +2 -2
  87. package/build/src/models/TrashEntry.d.ts.map +1 -1
  88. package/build/src/models/TrashEntry.js.map +1 -1
  89. package/build/src/models/store/Capabilities.d.ts +5 -1
  90. package/build/src/models/store/Capabilities.d.ts.map +1 -1
  91. package/build/src/models/store/Capabilities.js.map +1 -1
  92. package/build/src/models/store/Deletion.d.ts +5 -1
  93. package/build/src/models/store/Deletion.d.ts.map +1 -1
  94. package/build/src/models/store/Deletion.js.map +1 -1
  95. package/build/src/models/store/File.d.ts +45 -37
  96. package/build/src/models/store/File.d.ts.map +1 -1
  97. package/build/src/models/store/File.js +1 -1
  98. package/build/src/models/store/File.js.map +1 -1
  99. package/build/src/models/store/Group.d.ts +3 -3
  100. package/build/src/models/store/Group.d.ts.map +1 -1
  101. package/build/src/models/store/Group.js.map +1 -1
  102. package/build/src/models/store/Invitation.d.ts +3 -3
  103. package/build/src/models/store/Invitation.d.ts.map +1 -1
  104. package/build/src/models/store/Invitation.js.map +1 -1
  105. package/build/src/models/store/Modification.d.ts +5 -1
  106. package/build/src/models/store/Modification.d.ts.map +1 -1
  107. package/build/src/models/store/Modification.js.map +1 -1
  108. package/build/src/models/store/Organization.d.ts +18 -13
  109. package/build/src/models/store/Organization.d.ts.map +1 -1
  110. package/build/src/models/store/Organization.js +29 -47
  111. package/build/src/models/store/Organization.js.map +1 -1
  112. package/build/src/models/store/Permission.d.ts +9 -5
  113. package/build/src/models/store/Permission.d.ts.map +1 -1
  114. package/build/src/models/store/Permission.js.map +1 -1
  115. package/build/src/models/store/User.d.ts +18 -6
  116. package/build/src/models/store/User.d.ts.map +1 -1
  117. package/build/src/models/store/User.js.map +1 -1
  118. package/build/src/models/store/UserIdentity.d.ts +9 -5
  119. package/build/src/models/store/UserIdentity.d.ts.map +1 -1
  120. package/build/src/models/store/UserIdentity.js.map +1 -1
  121. package/build/src/sdk/FilesSdk.d.ts +15 -15
  122. package/build/src/sdk/FilesSdk.d.ts.map +1 -1
  123. package/build/src/sdk/FilesSdk.js +1 -1
  124. package/build/src/sdk/FilesSdk.js.map +1 -1
  125. package/build/src/sdk/OrganizationsSdk.d.ts +9 -9
  126. package/build/src/sdk/OrganizationsSdk.d.ts.map +1 -1
  127. package/build/src/sdk/OrganizationsSdk.js.map +1 -1
  128. package/build/src/sdk/SdkMock.js +6 -6
  129. package/build/src/sdk/SdkMock.js.map +1 -1
  130. package/build/src/sdk/SharedSdk.d.ts +2 -2
  131. package/build/src/sdk/SharedSdk.d.ts.map +1 -1
  132. package/build/src/sdk/SharedSdk.js.map +1 -1
  133. package/build/src/sdk/StoreSdkNode.d.ts +1 -1
  134. package/build/src/sdk/StoreSdkNode.d.ts.map +1 -1
  135. package/build/src/sdk/StoreSdkNode.js.map +1 -1
  136. package/build/src/sdk/StoreSdkWeb.d.ts +1 -1
  137. package/build/src/sdk/StoreSdkWeb.d.ts.map +1 -1
  138. package/build/src/sdk/StoreSdkWeb.js.map +1 -1
  139. package/build/src/sdk/UsersSdk.d.ts +5 -5
  140. package/build/src/sdk/UsersSdk.d.ts.map +1 -1
  141. package/build/src/sdk/UsersSdk.js.map +1 -1
  142. package/build/tsconfig.tsbuildinfo +1 -1
  143. package/package.json +1 -1
  144. package/src/exceptions/exception.ts +119 -15
  145. package/src/mocking/ProjectMock.ts +1 -1
  146. package/src/mocking/lib/File.ts +5 -5
  147. package/src/mocking/lib/Organization.ts +5 -3
  148. package/src/mocking/lib/Permission.ts +8 -8
  149. package/src/mocking/lib/User.ts +11 -6
  150. package/src/modeling/ApiFile.ts +11 -6
  151. package/src/modeling/ApiModel.ts +2 -2
  152. package/src/modeling/DataDomain.ts +2 -2
  153. package/src/modeling/DomainAssociation.ts +2 -2
  154. package/src/modeling/DomainEntity.ts +2 -2
  155. package/src/modeling/DomainFile.ts +11 -6
  156. package/src/modeling/DomainModel.ts +2 -2
  157. package/src/modeling/DomainNamespace.ts +2 -2
  158. package/src/modeling/DomainProperty.ts +2 -2
  159. package/src/modeling/helpers/Intelisense.ts +41 -38
  160. package/src/models/AiMessage.ts +3 -3
  161. package/src/models/AiSession.ts +3 -3
  162. package/src/models/CertificateFile.ts +2 -2
  163. package/src/models/Environment.ts +2 -2
  164. package/src/models/Folder.ts +13 -8
  165. package/src/models/HttpProject.ts +2 -2
  166. package/src/models/ProjectFolder.ts +2 -2
  167. package/src/models/Request.ts +3 -3
  168. package/src/models/Thing.ts +14 -9
  169. package/src/models/TrashEntry.ts +2 -2
  170. package/src/models/store/Capabilities.ts +6 -1
  171. package/src/models/store/Deletion.ts +6 -1
  172. package/src/models/store/File.ts +53 -43
  173. package/src/models/store/Group.ts +3 -3
  174. package/src/models/store/Invitation.ts +3 -3
  175. package/src/models/store/Modification.ts +6 -1
  176. package/src/models/store/Organization.ts +45 -60
  177. package/src/models/store/Permission.ts +17 -12
  178. package/src/models/store/User.ts +21 -6
  179. package/src/models/store/UserIdentity.ts +13 -8
  180. package/src/sdk/FilesSdk.ts +29 -25
  181. package/src/sdk/OrganizationsSdk.ts +20 -16
  182. package/src/sdk/SdkMock.ts +16 -16
  183. package/src/sdk/SharedSdk.ts +3 -3
  184. package/src/sdk/StoreSdkNode.ts +3 -3
  185. package/src/sdk/StoreSdkWeb.ts +3 -3
  186. package/src/sdk/UsersSdk.ts +6 -6
  187. package/tests/unit/exceptions/exception.spec.ts +261 -0
  188. package/tests/unit/mocking/current/File.spec.ts +5 -5
  189. package/tests/unit/mocking/current/Organization.spec.ts +4 -3
  190. package/tests/unit/mocking/current/Permission.spec.ts +2 -2
  191. package/tests/unit/mocking/current/User.spec.ts +2 -2
  192. package/tests/unit/modeling/domain_file.spec.ts +3 -3
  193. package/tests/unit/models/File/createFileCapabilities.spec.ts +3 -3
  194. package/tests/unit/models/File/new.spec.ts +2 -2
  195. package/tests/unit/models/File/setDeleted.spec.ts +3 -3
  196. package/tests/unit/models/File/setLastModified.spec.ts +3 -3
  197. package/tests/unit/models/File/toJSON.spec.ts +2 -2
  198. package/tests/unit/models/Folder/create.spec.ts +3 -3
  199. package/tests/unit/models/Permission/all.spec.ts +3 -3
  200. package/tests/unit/models/store/Invitation.spec.ts +2 -2
  201. package/tests/unit/models/store/Organization.spec.ts +100 -0
  202. package/tests/unit/models/store/Permission.spec.ts +16 -6
  203. package/tests/unit/models/thing.spec.ts +3 -3
@@ -1,7 +1,7 @@
1
- import type { IDeletion } from './Deletion.js'
1
+ import type { DeletionSchema } from './Deletion.js'
2
2
  import type { UserOrganizationGrantType } from './Organization.js'
3
3
 
4
- export interface IEmail {
4
+ export interface EmailSchema {
5
5
  /**
6
6
  * When available the email of the user.
7
7
  */
@@ -13,7 +13,12 @@ export interface IEmail {
13
13
  verified?: boolean
14
14
  }
15
15
 
16
- export interface IUserPicture {
16
+ /**
17
+ * @deprecated Use {@link EmailSchema} instead.
18
+ */
19
+ export type IEmail = EmailSchema
20
+
21
+ export interface UserPictureSchema {
17
22
  /**
18
23
  * When available, the URL to the user's picture image.
19
24
  */
@@ -24,6 +29,11 @@ export interface IUserPicture {
24
29
  data?: string
25
30
  }
26
31
 
32
+ /**
33
+ * @deprecated Use {@link UserPictureSchema} instead.
34
+ */
35
+ export type IUserPicture = UserPictureSchema
36
+
27
37
  export const Kind = 'Core#User'
28
38
 
29
39
  export type UserStatus = 'active' | 'deleted' | 'suspended' | 'pending'
@@ -36,7 +46,7 @@ export type UserStatus = 'active' | 'deleted' | 'suspended' | 'pending'
36
46
  * Note, the store implementation may have additional fields that support external
37
47
  * identity providers. However, this is not exposed to the user through the API.
38
48
  */
39
- export interface IUser {
49
+ export interface UserSchema {
40
50
  kind: typeof Kind
41
51
  /**
42
52
  * The data store key of the user.
@@ -53,7 +63,7 @@ export interface IUser {
53
63
  /**
54
64
  * The user picture to render.
55
65
  */
56
- picture?: IUserPicture
66
+ picture?: UserPictureSchema
57
67
  /**
58
68
  * A general purpose tags field.
59
69
  */
@@ -109,5 +119,10 @@ export interface IUser {
109
119
  * The information about the delete information.
110
120
  * Always set when the `delete` is true.
111
121
  */
112
- deletedInfo?: IDeletion
122
+ deletedInfo?: DeletionSchema
113
123
  }
124
+
125
+ /**
126
+ * @deprecated Use {@link UserSchema} instead.
127
+ */
128
+ export type IUser = UserSchema
@@ -9,7 +9,7 @@ type Provider = 'google'
9
9
  * This association allows the user to use different identity providers that map to the same user, as long as the
10
10
  * email stays consistent.
11
11
  */
12
- export interface IUserIdentity {
12
+ export interface UserIdentitySchema {
13
13
  kind: typeof Kind
14
14
  /**
15
15
  * The database ID
@@ -39,7 +39,12 @@ export interface IUserIdentity {
39
39
  hostDomain?: string
40
40
  }
41
41
 
42
- export class UserIdentity implements IUserIdentity {
42
+ /**
43
+ * @deprecated Use {@link UserIdentitySchema} instead.
44
+ */
45
+ export type IUserIdentity = UserIdentitySchema
46
+
47
+ export class UserIdentity implements UserIdentitySchema {
43
48
  kind: typeof Kind = Kind
44
49
  key = ''
45
50
  userId = ''
@@ -48,8 +53,8 @@ export class UserIdentity implements IUserIdentity {
48
53
  emailVerified = false
49
54
  hostDomain?: string
50
55
 
51
- constructor(input?: string | IUserIdentity) {
52
- let init: IUserIdentity
56
+ constructor(input?: string | UserIdentitySchema) {
57
+ let init: UserIdentitySchema
53
58
  if (typeof input === 'string') {
54
59
  init = JSON.parse(input)
55
60
  } else if (typeof input === 'object') {
@@ -67,7 +72,7 @@ export class UserIdentity implements IUserIdentity {
67
72
  this.new(init)
68
73
  }
69
74
 
70
- new(init: IUserIdentity): void {
75
+ new(init: UserIdentitySchema): void {
71
76
  if (!UserIdentity.isUserIdentity(init)) {
72
77
  throw new Error(`Not a UserIdentity.`)
73
78
  }
@@ -86,15 +91,15 @@ export class UserIdentity implements IUserIdentity {
86
91
  }
87
92
 
88
93
  static isUserIdentity(input: unknown): boolean {
89
- const typed = input as IUserIdentity
94
+ const typed = input as UserIdentitySchema
90
95
  if (!input || typed.kind !== Kind) {
91
96
  return false
92
97
  }
93
98
  return true
94
99
  }
95
100
 
96
- toJSON(): IUserIdentity {
97
- const result: IUserIdentity = {
101
+ toJSON(): UserIdentitySchema {
102
+ const result: UserIdentitySchema = {
98
103
  kind: Kind,
99
104
  key: this.key,
100
105
  provider: this.provider,
@@ -7,13 +7,13 @@ import {
7
7
  SdkOptions,
8
8
  } from './SdkBase.js'
9
9
  import { RouteBuilder } from './RouteBuilder.js'
10
- import type { IUser } from '../models/store/User.js'
11
- import type { FileBreadcrumb, IFile } from '../models/store/File.js'
10
+ import type { UserSchema } from '../models/store/User.js'
11
+ import type { FileBreadcrumb, FileSchema } 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
15
  import { nanoid } from '../nanoid.js'
16
- import { Folder, type IFolder } from '../models/Folder.js'
16
+ import { Folder, type FolderSchema } from '../models/Folder.js'
17
17
  import type { AccessPatchInfo, MediaPatchInfo, MediaPatchRevision, PatchInfo } from '../patch/types.js'
18
18
  import { Exception } from '../exceptions/exception.js'
19
19
 
@@ -57,7 +57,7 @@ export class FilesSdk extends SdkBase {
57
57
  organization: string,
58
58
  options: ContextListOptions = {},
59
59
  request: SdkOptions = {}
60
- ): Promise<ContextListResult<IFile>> {
60
+ ): Promise<ContextListResult<FileSchema>> {
61
61
  const { token } = request
62
62
  const opts = { ...options }
63
63
  const url = this.sdk.getUrl(RouteBuilder.files(organization))
@@ -72,7 +72,7 @@ export class FilesSdk extends SdkBase {
72
72
  if (!result.body) {
73
73
  throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
74
74
  }
75
- let data: ContextListResult<IFile>
75
+ let data: ContextListResult<FileSchema>
76
76
  try {
77
77
  data = JSON.parse(result.body)
78
78
  } catch {
@@ -94,12 +94,12 @@ export class FilesSdk extends SdkBase {
94
94
  * @returns The id of the created file meta.
95
95
  */
96
96
  async create(
97
- meta: IFile,
97
+ meta: FileSchema,
98
98
  contents: unknown,
99
99
  organization: string,
100
100
  opts: IFileCreateOptions = {},
101
101
  request: SdkOptions = {}
102
- ): Promise<IFile> {
102
+ ): Promise<FileSchema> {
103
103
  const result = await this.createMeta(meta, organization, opts, request)
104
104
  await this.createMedia(contents, organization, result.key, opts, request)
105
105
  return result
@@ -108,17 +108,17 @@ export class FilesSdk extends SdkBase {
108
108
  /**
109
109
  * Creates a file in the store.
110
110
  *
111
- * @param file The definition of a file that extends the IFile interface.
111
+ * @param file The definition of a file that extends the FileSchema interface.
112
112
  * @param opts Optional options when creating a file
113
113
  * @param request Optional request options.
114
114
  * @returns The key of the creates file.
115
115
  */
116
116
  async createMeta(
117
- file: IFile,
117
+ file: FileSchema,
118
118
  organization: string,
119
119
  opts: IMetaCreateOptions = {},
120
120
  request: SdkOptions = {}
121
- ): Promise<IFile> {
121
+ ): Promise<FileSchema> {
122
122
  const { token } = request
123
123
  const url = this.sdk.getUrl(RouteBuilder.files(organization))
124
124
  if (opts.parent) {
@@ -142,7 +142,7 @@ export class FilesSdk extends SdkBase {
142
142
  if (!result.body) {
143
143
  throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
144
144
  }
145
- let data: IFile
145
+ let data: FileSchema
146
146
  try {
147
147
  data = JSON.parse(result.body)
148
148
  } catch {
@@ -199,7 +199,7 @@ export class FilesSdk extends SdkBase {
199
199
  organization: string,
200
200
  opts: IMetaCreateOptions = {},
201
201
  request: SdkOptions = {}
202
- ): Promise<IFolder> {
202
+ ): Promise<FolderSchema> {
203
203
  const file = Folder.fromName(name)
204
204
  const { token } = request
205
205
  const url = this.sdk.getUrl(RouteBuilder.files(organization))
@@ -224,7 +224,7 @@ export class FilesSdk extends SdkBase {
224
224
  if (!result.body) {
225
225
  throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
226
226
  }
227
- let data: IFolder
227
+ let data: FolderSchema
228
228
  try {
229
229
  data = JSON.parse(result.body)
230
230
  } catch {
@@ -243,7 +243,7 @@ export class FilesSdk extends SdkBase {
243
243
  * @param fid The file key
244
244
  * @param request Optional request options.
245
245
  */
246
- async read(oid: string, fid: string, request: SdkOptions = {}): Promise<IFile> {
246
+ async read(oid: string, fid: string, request: SdkOptions = {}): Promise<FileSchema> {
247
247
  const { token } = request
248
248
  const url = this.sdk.getUrl(RouteBuilder.file(oid, fid))
249
249
  const result = await this.sdk.http.get(url.toString(), { token })
@@ -256,7 +256,7 @@ export class FilesSdk extends SdkBase {
256
256
  if (!result.body) {
257
257
  throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
258
258
  }
259
- let data: IFile
259
+ let data: FileSchema
260
260
  try {
261
261
  data = JSON.parse(result.body)
262
262
  } catch {
@@ -314,7 +314,11 @@ export class FilesSdk extends SdkBase {
314
314
  * in that place. It also inserts `undefined` in place of a file that doesn't exist.
315
315
  * @param request Optional request options.
316
316
  */
317
- async readBulk(organization: string, keys: string[], request: SdkOptions = {}): Promise<IBulkOperationResult<IFile>> {
317
+ async readBulk(
318
+ organization: string,
319
+ keys: string[],
320
+ request: SdkOptions = {}
321
+ ): Promise<IBulkOperationResult<FileSchema>> {
318
322
  const { token } = request
319
323
  const url = this.sdk.getUrl(RouteBuilder.filesBatch(organization))
320
324
  const body = JSON.stringify({ ids: keys })
@@ -328,7 +332,7 @@ export class FilesSdk extends SdkBase {
328
332
  if (!result.body) {
329
333
  throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
330
334
  }
331
- let data: IBulkOperationResult<IFile>
335
+ let data: IBulkOperationResult<FileSchema>
332
336
  try {
333
337
  data = JSON.parse(result.body)
334
338
  } catch {
@@ -347,7 +351,7 @@ export class FilesSdk extends SdkBase {
347
351
  * @param request Optional request options.
348
352
  * @returns The updated file object after applying the patch
349
353
  */
350
- async patch(oid: string, fid: string, info: PatchInfo, request: SdkOptions = {}): Promise<IFile> {
354
+ async patch(oid: string, fid: string, info: PatchInfo, request: SdkOptions = {}): Promise<FileSchema> {
351
355
  const { token } = request
352
356
  const path = RouteBuilder.file(oid, fid)
353
357
  const url = this.sdk.getUrl(path)
@@ -362,7 +366,7 @@ export class FilesSdk extends SdkBase {
362
366
  if (!result.body) {
363
367
  throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
364
368
  }
365
- let data: IFile
369
+ let data: FileSchema
366
370
  try {
367
371
  data = JSON.parse(result.body)
368
372
  } catch {
@@ -445,7 +449,7 @@ export class FilesSdk extends SdkBase {
445
449
  * @param info The patch operation on the file's ACL
446
450
  * @param request Optional request options.
447
451
  */
448
- async patchUsers(oid: string, fid: string, info: AccessPatchInfo, request: SdkOptions = {}): Promise<IFile> {
452
+ async patchUsers(oid: string, fid: string, info: AccessPatchInfo, request: SdkOptions = {}): Promise<FileSchema> {
449
453
  const { token } = request
450
454
  const url = this.sdk.getUrl(RouteBuilder.filesAccess(oid, fid))
451
455
  const body = JSON.stringify(info)
@@ -459,7 +463,7 @@ export class FilesSdk extends SdkBase {
459
463
  if (!result.body) {
460
464
  throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
461
465
  }
462
- let data: IFile
466
+ let data: FileSchema
463
467
  try {
464
468
  data = JSON.parse(result.body)
465
469
  } catch {
@@ -487,7 +491,7 @@ export class FilesSdk extends SdkBase {
487
491
  role: PermissionRole,
488
492
  expires?: number,
489
493
  request?: SdkOptions
490
- ): Promise<IFile> {
494
+ ): Promise<FileSchema> {
491
495
  const op: IAccessAddOperation = {
492
496
  op: 'add',
493
497
  type: 'user',
@@ -511,7 +515,7 @@ export class FilesSdk extends SdkBase {
511
515
  * @param key The file key
512
516
  * @param otherUserKey The key of the user that gets access to the organization
513
517
  */
514
- async removeUser(organization: string, key: string, otherUserKey: string, request?: SdkOptions): Promise<IFile> {
518
+ async removeUser(organization: string, key: string, otherUserKey: string, request?: SdkOptions): Promise<FileSchema> {
515
519
  const op: IAccessRemoveOperation = {
516
520
  op: 'remove',
517
521
  type: 'user',
@@ -530,7 +534,7 @@ export class FilesSdk extends SdkBase {
530
534
  * @param key The file key
531
535
  * @param request Optional request options.
532
536
  */
533
- async listUsers(organization: string, key: string, request: SdkOptions = {}): Promise<ContextListResult<IUser>> {
537
+ async listUsers(organization: string, key: string, request: SdkOptions = {}): Promise<ContextListResult<UserSchema>> {
534
538
  const { token } = request
535
539
  const url = this.sdk.getUrl(RouteBuilder.fileUsers(organization, key))
536
540
  const result = await this.sdk.http.get(url.toString(), { token })
@@ -543,7 +547,7 @@ export class FilesSdk extends SdkBase {
543
547
  if (!result.body) {
544
548
  throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
545
549
  }
546
- let data: ContextListResult<IUser>
550
+ let data: ContextListResult<UserSchema>
547
551
  try {
548
552
  data = JSON.parse(result.body)
549
553
  } catch {
@@ -8,17 +8,17 @@ import {
8
8
  } from './SdkBase.js'
9
9
  import { RouteBuilder } from './RouteBuilder.js'
10
10
  import type { ContextListOptions, ContextListResult } from '../events/BaseEvents.js'
11
- import type { IOrganization, UserOrganizationGrantType } from '../models/store/Organization.js'
11
+ import type { OrganizationSchema, UserOrganizationGrantType } from '../models/store/Organization.js'
12
12
  import type { InvitationSchema } from '../models/store/Invitation.js'
13
13
  import type { PatchInfo } from '../patch/types.js'
14
- import type { IUser } from '../models/store/User.js'
14
+ import type { UserSchema } from '../models/store/User.js'
15
15
  import { Exception } from '../exceptions/exception.js'
16
16
 
17
17
  export class OrganizationsSdk extends SdkBase {
18
18
  /**
19
19
  * Lists all user organizations.
20
20
  */
21
- async list(request: SdkOptions = {}): Promise<ContextListResult<IOrganization>> {
21
+ async list(request: SdkOptions = {}): Promise<ContextListResult<OrganizationSchema>> {
22
22
  const { token } = request
23
23
  const url = this.sdk.getUrl(RouteBuilder.organizations())
24
24
  const result = await this.sdk.http.get(url.toString(), { token })
@@ -31,7 +31,7 @@ export class OrganizationsSdk extends SdkBase {
31
31
  if (!result.body) {
32
32
  throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
33
33
  }
34
- let data: ContextListResult<IOrganization>
34
+ let data: ContextListResult<OrganizationSchema>
35
35
  try {
36
36
  data = JSON.parse(result.body)
37
37
  } catch {
@@ -49,7 +49,7 @@ export class OrganizationsSdk extends SdkBase {
49
49
  * @param request The request options.
50
50
  * @returns A promise that resolves to the created organization.
51
51
  */
52
- async create(orgName: string, request: SdkOptions = {}): Promise<IOrganization> {
52
+ async create(orgName: string, request: SdkOptions = {}): Promise<OrganizationSchema> {
53
53
  const { token } = request
54
54
  const url = this.sdk.getUrl(RouteBuilder.organizations())
55
55
  const body = {
@@ -71,7 +71,7 @@ export class OrganizationsSdk extends SdkBase {
71
71
  if (!result.body) {
72
72
  throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
73
73
  }
74
- let data: IOrganization
74
+ let data: OrganizationSchema
75
75
  try {
76
76
  data = JSON.parse(result.body)
77
77
  } catch {
@@ -345,7 +345,7 @@ export class OrganizationsSdk extends SdkBase {
345
345
  oid: string,
346
346
  options?: ContextListOptions,
347
347
  request: SdkOptions = {}
348
- ): Promise<ContextListResult<IUser>> => {
348
+ ): Promise<ContextListResult<UserSchema>> => {
349
349
  const { token } = request
350
350
  const url = this.sdk.getUrl(RouteBuilder.organizationUsers(oid))
351
351
  this.sdk.appendListOptions(url, options)
@@ -359,7 +359,7 @@ export class OrganizationsSdk extends SdkBase {
359
359
  if (!result.body) {
360
360
  throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
361
361
  }
362
- let data: ContextListResult<IUser>
362
+ let data: ContextListResult<UserSchema>
363
363
  try {
364
364
  data = JSON.parse(result.body)
365
365
  } catch {
@@ -379,7 +379,7 @@ export class OrganizationsSdk extends SdkBase {
379
379
  * @param request Optional request options.
380
380
  * @returns The user object
381
381
  */
382
- read: async (oid: string, key: string, request: SdkOptions = {}): Promise<IUser> => {
382
+ read: async (oid: string, key: string, request: SdkOptions = {}): Promise<UserSchema> => {
383
383
  const { token } = request
384
384
  const url = this.sdk.getUrl(RouteBuilder.organizationUser(oid, key))
385
385
  const result = await this.sdk.http.get(url.toString(), { token })
@@ -392,7 +392,7 @@ export class OrganizationsSdk extends SdkBase {
392
392
  if (!result.body) {
393
393
  throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
394
394
  }
395
- let data: IUser
395
+ let data: UserSchema
396
396
  try {
397
397
  data = JSON.parse(result.body)
398
398
  } catch {
@@ -410,7 +410,11 @@ export class OrganizationsSdk extends SdkBase {
410
410
  * @param request Optional request options.
411
411
  * @returns The created user object.
412
412
  */
413
- readBatch: async (oid: string, keys: string[], request: SdkOptions = {}): Promise<ContextListResult<IUser>> => {
413
+ readBatch: async (
414
+ oid: string,
415
+ keys: string[],
416
+ request: SdkOptions = {}
417
+ ): Promise<ContextListResult<UserSchema>> => {
414
418
  const { token } = request
415
419
  const url = this.sdk.getUrl(RouteBuilder.organizationUserBatch(oid))
416
420
  const body = {
@@ -429,7 +433,7 @@ export class OrganizationsSdk extends SdkBase {
429
433
  if (!result.body) {
430
434
  throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
431
435
  }
432
- let data: ContextListResult<IUser>
436
+ let data: ContextListResult<UserSchema>
433
437
  try {
434
438
  data = JSON.parse(result.body)
435
439
  } catch {
@@ -447,7 +451,7 @@ export class OrganizationsSdk extends SdkBase {
447
451
  * @param oid The key of the organization parent organization.
448
452
  * @param key The user key.
449
453
  */
450
- activate: async (oid: string, key: string, request: SdkOptions = {}): Promise<IUser> => {
454
+ activate: async (oid: string, key: string, request: SdkOptions = {}): Promise<UserSchema> => {
451
455
  const { token } = request
452
456
  const url = this.sdk.getUrl(RouteBuilder.organizationUserActivate(oid, key))
453
457
  const result = await this.sdk.http.post(url.toString(), { token })
@@ -460,7 +464,7 @@ export class OrganizationsSdk extends SdkBase {
460
464
  if (!result.body) {
461
465
  throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
462
466
  }
463
- let data: IUser
467
+ let data: UserSchema
464
468
  try {
465
469
  data = JSON.parse(result.body)
466
470
  } catch {
@@ -475,7 +479,7 @@ export class OrganizationsSdk extends SdkBase {
475
479
  * @param oid The key of the organization parent organization.
476
480
  * @param key The user key.
477
481
  */
478
- deactivate: async (oid: string, key: string, request: SdkOptions = {}): Promise<IUser> => {
482
+ deactivate: async (oid: string, key: string, request: SdkOptions = {}): Promise<UserSchema> => {
479
483
  const { token } = request
480
484
  const url = this.sdk.getUrl(RouteBuilder.organizationUserDeactivate(oid, key))
481
485
  const result = await this.sdk.http.post(url.toString(), { token })
@@ -488,7 +492,7 @@ export class OrganizationsSdk extends SdkBase {
488
492
  if (!result.body) {
489
493
  throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
490
494
  }
491
- let data: IUser
495
+ let data: UserSchema
492
496
  try {
493
497
  data = JSON.parse(result.body)
494
498
  } catch {
@@ -6,11 +6,11 @@ import {
6
6
  type InterceptOptions,
7
7
  type SerializedRequest,
8
8
  } from '@jarrodek/amw'
9
- import type { IOrganization } from '../models/store/Organization.js'
9
+ import type { OrganizationSchema } from '../models/store/Organization.js'
10
10
  import type { GroupSchema } from '../models/store/Group.js'
11
- import type { IUser } from '../models/store/User.js'
11
+ import type { UserSchema } from '../models/store/User.js'
12
12
  import type { InvitationSchema } from '../models/store/Invitation.js'
13
- import { type IFile, type FileBreadcrumb } from '../models/store/File.js'
13
+ import { type FileSchema, type FileBreadcrumb } from '../models/store/File.js'
14
14
  import type { ContextChangeRecord, ContextListResult, IBulkOperationResult } from '../events/BaseEvents.js'
15
15
  import type { TrashEntry } from '../models/TrashEntry.js'
16
16
  import { RouteBuilder } from './RouteBuilder.js'
@@ -208,7 +208,7 @@ export class SdkMock {
208
208
  // body: JSON.stringify({
209
209
  // items: this.gen.organization.organizations(init?.size ?? 5),
210
210
  // cursor: this.createCursorOption(init),
211
- // } as ContextListResult<IOrganization>),
211
+ // } as ContextListResult<OrganizationSchema>),
212
212
  // }
213
213
  const respond = this.createDefaultResponse(
214
214
  200,
@@ -217,7 +217,7 @@ export class SdkMock {
217
217
  JSON.stringify({
218
218
  items: this.gen.organization.organizations(init?.size ?? 5),
219
219
  cursor: this.createCursorOption(init),
220
- } as ContextListResult<IOrganization>),
220
+ } as ContextListResult<OrganizationSchema>),
221
221
  init
222
222
  )
223
223
  await mock.add(
@@ -454,13 +454,13 @@ export class SdkMock {
454
454
  // body: JSON.stringify({
455
455
  // items: this.gen.users.users(init?.size ?? 5),
456
456
  // cursor: this.createCursorOption(init),
457
- // } as ContextListResult<IUser>),
457
+ // } as ContextListResult<UserSchema>),
458
458
  // }
459
459
  const respond = this.createDefaultResponse(
460
460
  200,
461
461
  { 'content-type': 'application/json' },
462
462
  () => {
463
- const obj: ContextListResult<IUser> = {
463
+ const obj: ContextListResult<UserSchema> = {
464
464
  items: this.gen.users.users(init?.size ?? 5),
465
465
  cursor: this.createCursorOption(init),
466
466
  }
@@ -512,7 +512,7 @@ export class SdkMock {
512
512
  body: JSON.stringify({
513
513
  items: this.gen.users.users(init?.size ?? 5),
514
514
  cursor: this.createCursorOption(init),
515
- } as ContextListResult<IUser>),
515
+ } as ContextListResult<UserSchema>),
516
516
  }
517
517
  await mock.add(
518
518
  {
@@ -1004,13 +1004,13 @@ export class SdkMock {
1004
1004
  // body: JSON.stringify({
1005
1005
  // items: this.gen.files.files(init?.size ?? 5),
1006
1006
  // cursor: this.createCursorOption(init),
1007
- // } as ContextListResult<IFile>),
1007
+ // } as ContextListResult<FileSchema>),
1008
1008
  // }
1009
1009
  const respond = this.createDefaultResponse(
1010
1010
  200,
1011
1011
  { 'content-type': 'application/json' },
1012
1012
  () => {
1013
- const obj: ContextListResult<IFile> = {
1013
+ const obj: ContextListResult<FileSchema> = {
1014
1014
  items: this.gen.files.files(init?.size ?? 5),
1015
1015
  cursor: this.createCursorOption(init),
1016
1016
  }
@@ -1190,13 +1190,13 @@ export class SdkMock {
1190
1190
  // headers: { 'content-type': 'application/json' },
1191
1191
  // body: JSON.stringify({
1192
1192
  // items: this.gen.files.files(init?.size ?? 5),
1193
- // } as IBulkOperationResult<IFile>),
1193
+ // } as IBulkOperationResult<FileSchema>),
1194
1194
  // }
1195
1195
  const respond = this.createDefaultResponse(
1196
1196
  200,
1197
1197
  { 'content-type': 'application/json' },
1198
1198
  () => {
1199
- const obj: IBulkOperationResult<IFile> = {
1199
+ const obj: IBulkOperationResult<FileSchema> = {
1200
1200
  items: this.gen.files.files(init?.size ?? 5),
1201
1201
  }
1202
1202
  return JSON.stringify(obj)
@@ -1366,13 +1366,13 @@ export class SdkMock {
1366
1366
  // body: JSON.stringify({
1367
1367
  // items: this.gen.users.users(init?.size ?? 5),
1368
1368
  // cursor: this.createCursorOption(init),
1369
- // } as ContextListResult<IUser>),
1369
+ // } as ContextListResult<UserSchema>),
1370
1370
  // }
1371
1371
  const respond = this.createDefaultResponse(
1372
1372
  200,
1373
1373
  { 'content-type': 'application/json' },
1374
1374
  () => {
1375
- const obj: ContextListResult<IUser> = {
1375
+ const obj: ContextListResult<UserSchema> = {
1376
1376
  items: this.gen.users.users(init?.size ?? 5),
1377
1377
  cursor: this.createCursorOption(init),
1378
1378
  }
@@ -1447,13 +1447,13 @@ export class SdkMock {
1447
1447
  // body: JSON.stringify({
1448
1448
  // items: this.gen.files.files(init?.size ?? 5),
1449
1449
  // cursor: this.createCursorOption(init),
1450
- // } as ContextListResult<IFile>),
1450
+ // } as ContextListResult<FileSchema>),
1451
1451
  // }
1452
1452
  const respond = this.createDefaultResponse(
1453
1453
  200,
1454
1454
  { 'content-type': 'application/json' },
1455
1455
  () => {
1456
- const obj: ContextListResult<IFile> = {
1456
+ const obj: ContextListResult<FileSchema> = {
1457
1457
  items: this.gen.files.files(init?.size ?? 5),
1458
1458
  cursor: this.createCursorOption(init),
1459
1459
  }
@@ -7,7 +7,7 @@ import {
7
7
  SdkOptions,
8
8
  } from './SdkBase.js'
9
9
  import { RouteBuilder } from './RouteBuilder.js'
10
- import { IFile } from '../models/store/File.js'
10
+ import { FileSchema } from '../models/store/File.js'
11
11
  import { ContextListOptions, ContextListResult } from '../events/BaseEvents.js'
12
12
  import { Exception } from '../exceptions/exception.js'
13
13
 
@@ -23,7 +23,7 @@ export class SharedSdk extends SdkBase {
23
23
  organization: string,
24
24
  options?: ContextListOptions,
25
25
  request: SdkOptions = {}
26
- ): Promise<ContextListResult<IFile>> {
26
+ ): Promise<ContextListResult<FileSchema>> {
27
27
  const { token } = request
28
28
  const url = this.sdk.getUrl(RouteBuilder.shared(organization))
29
29
  this.sdk.appendListOptions(url, options)
@@ -37,7 +37,7 @@ export class SharedSdk extends SdkBase {
37
37
  if (!result.body) {
38
38
  throw new Exception(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`, { code: 'E_RESPONSE_NO_VALUE', status: result.status })
39
39
  }
40
- let data: ContextListResult<IFile>
40
+ let data: ContextListResult<FileSchema>
41
41
  try {
42
42
  data = JSON.parse(result.body)
43
43
  } catch {
@@ -9,9 +9,9 @@ export type { IMetaCreateOptions, IMediaCreateOptions, IFileCreateOptions, ListF
9
9
  export type {
10
10
  IJwtInfo,
11
11
  IJwtUser,
12
- IRegistrationInfo,
13
- IOrganizationRegistrationInfo,
14
- IOrganizationAddUserInfo,
12
+ RegistrationInfoSchema,
13
+ OrganizationRegistrationInfoSchema,
14
+ OrganizationAddUserInfoSchema,
15
15
  } from './UsersSdk.js'
16
16
  export type { DataCatalogListOptions } from './DataCatalogSdk.js'
17
17
 
@@ -9,9 +9,9 @@ export type { IMetaCreateOptions, IMediaCreateOptions, IFileCreateOptions, ListF
9
9
  export type {
10
10
  IJwtInfo,
11
11
  IJwtUser,
12
- IRegistrationInfo,
13
- IOrganizationRegistrationInfo,
14
- IOrganizationAddUserInfo,
12
+ RegistrationInfoSchema,
13
+ OrganizationRegistrationInfoSchema,
14
+ OrganizationAddUserInfoSchema,
15
15
  } from './UsersSdk.js'
16
16
  export type { DataCatalogListOptions } from './DataCatalogSdk.js'
17
17