@api-client/core 0.12.3 → 0.12.5

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 (57) hide show
  1. package/build/src/browser.d.ts +2 -0
  2. package/build/src/browser.d.ts.map +1 -1
  3. package/build/src/browser.js +2 -0
  4. package/build/src/browser.js.map +1 -1
  5. package/build/src/events/BaseEvents.d.ts +11 -1
  6. package/build/src/events/BaseEvents.d.ts.map +1 -1
  7. package/build/src/events/BaseEvents.js.map +1 -1
  8. package/build/src/index.d.ts +2 -0
  9. package/build/src/index.d.ts.map +1 -1
  10. package/build/src/index.js +2 -0
  11. package/build/src/index.js.map +1 -1
  12. package/build/src/modeling/DomainVersioning.d.ts +2 -2
  13. package/build/src/modeling/DomainVersioning.d.ts.map +1 -1
  14. package/build/src/modeling/DomainVersioning.js +16 -1
  15. package/build/src/modeling/DomainVersioning.js.map +1 -1
  16. package/build/src/models/DataCatalog.d.ts +142 -0
  17. package/build/src/models/DataCatalog.d.ts.map +1 -0
  18. package/build/src/models/DataCatalog.js +120 -0
  19. package/build/src/models/DataCatalog.js.map +1 -0
  20. package/build/src/models/DataCatalogVersion.d.ts +123 -0
  21. package/build/src/models/DataCatalogVersion.d.ts.map +1 -0
  22. package/build/src/models/DataCatalogVersion.js +118 -0
  23. package/build/src/models/DataCatalogVersion.js.map +1 -0
  24. package/build/src/models/kinds.d.ts +2 -0
  25. package/build/src/models/kinds.d.ts.map +1 -1
  26. package/build/src/models/kinds.js +2 -0
  27. package/build/src/models/kinds.js.map +1 -1
  28. package/build/src/runtime/store/DataCatalogSdk.d.ts +46 -0
  29. package/build/src/runtime/store/DataCatalogSdk.d.ts.map +1 -0
  30. package/build/src/runtime/store/DataCatalogSdk.js +425 -0
  31. package/build/src/runtime/store/DataCatalogSdk.js.map +1 -0
  32. package/build/src/runtime/store/RouteBuilder.d.ts +10 -0
  33. package/build/src/runtime/store/RouteBuilder.d.ts.map +1 -1
  34. package/build/src/runtime/store/RouteBuilder.js +30 -0
  35. package/build/src/runtime/store/RouteBuilder.js.map +1 -1
  36. package/build/src/runtime/store/Sdk.d.ts +2 -0
  37. package/build/src/runtime/store/Sdk.d.ts.map +1 -1
  38. package/build/src/runtime/store/Sdk.js +10 -2
  39. package/build/src/runtime/store/Sdk.js.map +1 -1
  40. package/build/src/runtime/store/StoreSdkNode.d.ts +1 -0
  41. package/build/src/runtime/store/StoreSdkNode.d.ts.map +1 -1
  42. package/build/src/runtime/store/StoreSdkNode.js.map +1 -1
  43. package/build/src/runtime/store/StoreSdkWeb.d.ts +1 -0
  44. package/build/src/runtime/store/StoreSdkWeb.d.ts.map +1 -1
  45. package/build/src/runtime/store/StoreSdkWeb.js.map +1 -1
  46. package/data/models/example-generator-api.json +22 -22
  47. package/package.json +33 -2
  48. package/src/events/BaseEvents.ts +11 -1
  49. package/src/modeling/DomainVersioning.ts +18 -3
  50. package/src/models/DataCatalog.ts +260 -0
  51. package/src/models/DataCatalogVersion.ts +235 -0
  52. package/src/models/kinds.ts +2 -0
  53. package/src/runtime/store/DataCatalogSdk.ts +473 -0
  54. package/src/runtime/store/RouteBuilder.ts +40 -0
  55. package/src/runtime/store/Sdk.ts +11 -2
  56. package/src/runtime/store/StoreSdkNode.ts +1 -0
  57. package/src/runtime/store/StoreSdkWeb.ts +1 -0
@@ -0,0 +1,260 @@
1
+ import { DataCatalogKind } from './kinds.js'
2
+
3
+ export type DataCatalogScope = 'public' | 'private' | 'organization'
4
+
5
+ export interface DataCatalogSchema {
6
+ /**
7
+ * The key of the data catalog entry.
8
+ * When the value is missing it will be generated by the API.
9
+ *
10
+ * The key can only be set when creating a new data catalog entry.
11
+ * @readonly
12
+ */
13
+ key: string
14
+ /**
15
+ * The kind of the schema
16
+ * This is set by the API and is used to identify the schema.
17
+ * @readonly
18
+ */
19
+ readonly kind: typeof DataCatalogKind
20
+ /**
21
+ * The key of the organization.
22
+ * @required
23
+ */
24
+ organization: string
25
+ /**
26
+ * The key of the related data catalog file entry.
27
+ * @required
28
+ */
29
+ file: string
30
+ /**
31
+ * The scope of the data catalog entry.
32
+ * @required
33
+ */
34
+ scope: DataCatalogScope
35
+ /**
36
+ * The name of the data catalog entry.
37
+ * It is required when creating a new data catalog entry.
38
+ * @required
39
+ */
40
+ name: string
41
+ /**
42
+ * A short description of the data catalog entry.
43
+ * @required
44
+ */
45
+ description: string
46
+ /**
47
+ * The id of the user who created the data catalog entry.
48
+ * It is ignored when creating or updating a data catalog entry.
49
+ * @readonly
50
+ */
51
+ publishedBy: string
52
+ /**
53
+ * The time when the last version was published.
54
+ * It is ignored when creating or updating a data catalog entry.
55
+ * @readonly
56
+ */
57
+ publishedAt: number
58
+ /**
59
+ * The time when the data catalog entry was created.
60
+ * It is ignored when creating or updating a data catalog entry.
61
+ * @readonly
62
+ */
63
+ createdAt: number
64
+ /**
65
+ * The time when the data catalog entry was last updated.
66
+ * It is ignored when creating or updating a data catalog entry.
67
+ * @readonly
68
+ */
69
+ updatedAt: number
70
+ /**
71
+ * The timestamp when this entry was unpublished.
72
+ * Only set when the entry was unpublished.
73
+ * @readonly
74
+ */
75
+ unpublishedAt?: number
76
+ /**
77
+ * A flag indicating if the entry is deprecated.
78
+ * @readonly
79
+ */
80
+ deprecated?: boolean
81
+ /**
82
+ * The timestamp when the entry was deprecated.
83
+ * Only set when the entry was deprecated.
84
+ * @readonly
85
+ */
86
+ deprecatedAt?: number
87
+ /**
88
+ * The id of the user who deprecated the entry.
89
+ * Only set when the entry was deprecated.
90
+ * @readonly
91
+ */
92
+ deprecatedBy?: string
93
+ /**
94
+ * The reason why the entry was deprecated.
95
+ * Only set when the entry was deprecated.
96
+ */
97
+ deprecationReason?: string
98
+ /**
99
+ * The list of tags associated with the data catalog entry.
100
+ * @readonly Use the API endpoints to manage tags.
101
+ */
102
+ tags: string[]
103
+ }
104
+
105
+ /**
106
+ * Used with API communication when listing data catalog entries.
107
+ */
108
+ export interface DataCatalogSchemaWithVersion extends DataCatalogSchema {
109
+ /**
110
+ * The list of published versions of the data catalog entry.
111
+ * Note, this is limited to the last 20 versions.
112
+ */
113
+ versions: string[]
114
+ }
115
+
116
+ export interface DataCatalogVersionInfo {
117
+ key: string
118
+ version: string
119
+ published: number
120
+ }
121
+
122
+ export interface DataCatalogStatus extends DataCatalogSchema {
123
+ versions: DataCatalogVersionInfo[]
124
+ }
125
+
126
+ export class DataCatalog implements DataCatalogSchema {
127
+ key: string
128
+
129
+ get kind(): typeof DataCatalogKind {
130
+ return DataCatalogKind
131
+ }
132
+
133
+ organization: string
134
+ file: string
135
+ scope: DataCatalogScope
136
+ name: string
137
+ description: string
138
+ publishedBy: string
139
+ publishedAt: number
140
+ createdAt: number
141
+ updatedAt: number
142
+ unpublishedAt?: number | undefined
143
+ deprecated?: boolean | undefined
144
+ deprecatedAt?: number | undefined
145
+ deprecatedBy?: string | undefined
146
+ deprecationReason?: string | undefined
147
+ tags: string[]
148
+
149
+ static createSchema(input: Partial<DataCatalogSchema>): DataCatalogSchema {
150
+ const {
151
+ key = '',
152
+ organization = '',
153
+ file = '',
154
+ scope = 'private',
155
+ name = '',
156
+ description = '',
157
+ publishedBy = '',
158
+ publishedAt = 0,
159
+ createdAt = 0,
160
+ updatedAt = 0,
161
+ tags = [],
162
+ } = input
163
+ if (['public', 'private', 'organization'].indexOf(scope) === -1) {
164
+ throw new Error(`Invalid scope: ${scope}`)
165
+ }
166
+ const result: DataCatalogSchema = {
167
+ key,
168
+ kind: DataCatalogKind,
169
+ organization,
170
+ file,
171
+ scope,
172
+ name,
173
+ description,
174
+ publishedBy,
175
+ publishedAt,
176
+ createdAt,
177
+ updatedAt,
178
+ tags,
179
+ }
180
+ if (typeof input.deprecated === 'boolean') {
181
+ result.deprecated = input.deprecated
182
+ }
183
+ if (typeof input.deprecatedAt === 'number') {
184
+ result.deprecatedAt = input.deprecatedAt
185
+ }
186
+ if (typeof input.deprecatedBy === 'string') {
187
+ result.deprecatedBy = input.deprecatedBy
188
+ }
189
+ if (typeof input.deprecationReason === 'string') {
190
+ result.deprecationReason = input.deprecationReason
191
+ }
192
+ if (typeof input.unpublishedAt === 'number') {
193
+ result.unpublishedAt = input.unpublishedAt
194
+ }
195
+ return result
196
+ }
197
+
198
+ constructor(input: Partial<DataCatalogSchema> = {}) {
199
+ const init = DataCatalog.createSchema(input)
200
+ this.key = init.key
201
+ this.organization = init.organization
202
+ this.file = init.file
203
+ this.scope = init.scope
204
+ this.name = init.name
205
+ this.description = init.description
206
+ this.publishedBy = init.publishedBy
207
+ this.publishedAt = init.publishedAt
208
+ this.createdAt = init.createdAt
209
+ this.updatedAt = init.updatedAt
210
+ this.tags = init.tags
211
+ if (typeof init.deprecated === 'boolean') {
212
+ this.deprecated = init.deprecated
213
+ }
214
+ if (typeof init.deprecatedAt === 'number') {
215
+ this.deprecatedAt = init.deprecatedAt
216
+ }
217
+ if (typeof init.deprecatedBy === 'string') {
218
+ this.deprecatedBy = init.deprecatedBy
219
+ }
220
+ if (typeof init.deprecationReason === 'string') {
221
+ this.deprecationReason = init.deprecationReason
222
+ }
223
+ if (typeof init.unpublishedAt === 'number') {
224
+ this.unpublishedAt = init.unpublishedAt
225
+ }
226
+ }
227
+
228
+ toJSON(): DataCatalogSchema {
229
+ const result: DataCatalogSchema = {
230
+ key: this.key,
231
+ kind: DataCatalogKind,
232
+ organization: this.organization,
233
+ file: this.file,
234
+ scope: this.scope,
235
+ name: this.name,
236
+ description: this.description,
237
+ publishedBy: this.publishedBy,
238
+ publishedAt: this.publishedAt,
239
+ createdAt: this.createdAt,
240
+ updatedAt: this.updatedAt,
241
+ tags: [...this.tags],
242
+ }
243
+ if (typeof this.deprecated === 'boolean') {
244
+ result.deprecated = this.deprecated
245
+ }
246
+ if (typeof this.deprecatedAt === 'number') {
247
+ result.deprecatedAt = this.deprecatedAt
248
+ }
249
+ if (typeof this.deprecatedBy === 'string') {
250
+ result.deprecatedBy = this.deprecatedBy
251
+ }
252
+ if (typeof this.deprecationReason === 'string') {
253
+ result.deprecationReason = this.deprecationReason
254
+ }
255
+ if (typeof this.unpublishedAt === 'number') {
256
+ result.unpublishedAt = this.unpublishedAt
257
+ }
258
+ return result
259
+ }
260
+ }
@@ -0,0 +1,235 @@
1
+ import { DataCatalogScope } from './DataCatalog.js'
2
+ import { DataCatalogVersionKind } from './kinds.js'
3
+
4
+ export type DataCatalogLifecycle = 'stable' | 'beta' | 'dev'
5
+
6
+ export interface DataCatalogVersionSchema {
7
+ /**
8
+ * The key of the version.
9
+ *
10
+ * The key can only be set when creating a new data catalog entry.
11
+ * @readonly
12
+ */
13
+ key: string
14
+ /**
15
+ * The kind of the schema
16
+ */
17
+ readonly kind: typeof DataCatalogVersionKind
18
+ /**
19
+ * The key of the parent data catalog entry.
20
+ * It is only populated by the API when creating the version.
21
+ * @readonly
22
+ */
23
+ catalogKey: string
24
+ /**
25
+ * The publication scope of the data catalog entry.
26
+ *
27
+ * When the scope is set to a different value than the one of the parent data catalog entry,
28
+ * then this value is used to determine the visibility of the data catalog entry. However,
29
+ * the reader cannot access the version with a "public" scope if the parent data catalog entry is private.
30
+ *
31
+ * @required
32
+ */
33
+ scope: DataCatalogScope
34
+ /**
35
+ * The lifecycle of the data catalog entry.
36
+ *
37
+ * - `stable`: The data catalog entry is stable and can be used in production.
38
+ * - `beta`: The data catalog entry is in beta and may change in the future.
39
+ * - `dev`: The data catalog entry is in development and likely will change in the future.
40
+ *
41
+ * The lifecycle is a readonly property and is set by the API when creating or updating the data catalog entry.
42
+ * A version is immutable and to change the lifecycle, a new version must be created.
43
+ *
44
+ * @required
45
+ */
46
+ lifecycle: DataCatalogLifecycle
47
+ /**
48
+ * The version string according to the [semantic versioning](https://semver.org/) specification.
49
+ * Note, this value is limited to 32 characters by the API.
50
+ * @required
51
+ */
52
+ version: string
53
+ /**
54
+ * The id of the user who created the version.
55
+ * It is ignored when creating or updating a data catalog entry.
56
+ * @readonly
57
+ */
58
+ publishedBy: string
59
+ /**
60
+ * The timestamp when this version was unpublished.
61
+ * Only set when the version was unpublished.
62
+ * @readonly
63
+ */
64
+ unpublishedAt?: number
65
+ /**
66
+ * A flag indicating if the version is deprecated.
67
+ * @readonly
68
+ */
69
+ deprecated?: boolean
70
+ /**
71
+ * The timestamp when the version was deprecated.
72
+ * Only set when the version was deprecated.
73
+ * @readonly
74
+ */
75
+ deprecatedAt?: number
76
+ /**
77
+ * The id of the user who deprecated the version.
78
+ * Only set when the version was deprecated.
79
+ * @readonly
80
+ */
81
+ deprecatedBy?: string
82
+ /**
83
+ * The reason why the version was deprecated.
84
+ * Only set when the version was deprecated.
85
+ */
86
+ deprecationReason?: string
87
+ /**
88
+ * The timestamp when the data catalog entry was created.
89
+ * It is ignored when creating or updating a data catalog entry.
90
+ * @readonly
91
+ */
92
+ createdAt: number
93
+ /**
94
+ * The timestamp when the data catalog entry was last updated.
95
+ * It is ignored when creating or updating a data catalog entry.
96
+ * @readonly
97
+ */
98
+ updatedAt: number
99
+ /**
100
+ * The changelog of the data catalog entry.
101
+ * Note, this value is required by the API when creating the version.
102
+ */
103
+ changelog?: string
104
+ }
105
+
106
+ export class DataCatalogVersion implements DataCatalogVersionSchema {
107
+ key: string
108
+
109
+ get kind(): typeof DataCatalogVersionKind {
110
+ return DataCatalogVersionKind
111
+ }
112
+
113
+ catalogKey: string
114
+ scope: DataCatalogScope
115
+ lifecycle: DataCatalogLifecycle
116
+ version: string
117
+ publishedBy: string
118
+ unpublishedAt?: number | undefined
119
+ deprecated?: boolean | undefined
120
+ deprecatedAt?: number | undefined
121
+ deprecatedBy?: string | undefined
122
+ deprecationReason?: string | undefined
123
+ createdAt: number
124
+ updatedAt: number
125
+ changelog?: string | undefined
126
+
127
+ static createSchema(input: Partial<DataCatalogVersionSchema>): DataCatalogVersionSchema {
128
+ const {
129
+ key = '',
130
+ scope = 'private',
131
+ publishedBy = '',
132
+ createdAt = 0,
133
+ updatedAt = 0,
134
+ catalogKey = '',
135
+ lifecycle = 'stable',
136
+ version = '',
137
+ } = input
138
+ if (['public', 'private', 'organization'].indexOf(scope) === -1) {
139
+ throw new Error(`Invalid scope: ${scope}`)
140
+ }
141
+ const result: DataCatalogVersionSchema = {
142
+ key,
143
+ kind: DataCatalogVersionKind,
144
+ scope,
145
+ publishedBy,
146
+ createdAt,
147
+ updatedAt,
148
+ catalogKey,
149
+ lifecycle,
150
+ version,
151
+ }
152
+ if (typeof input.deprecated === 'boolean') {
153
+ result.deprecated = input.deprecated
154
+ }
155
+ if (typeof input.deprecatedAt === 'number') {
156
+ result.deprecatedAt = input.deprecatedAt
157
+ }
158
+ if (typeof input.deprecatedBy === 'string') {
159
+ result.deprecatedBy = input.deprecatedBy
160
+ }
161
+ if (typeof input.changelog === 'string') {
162
+ result.changelog = input.changelog
163
+ }
164
+ if (typeof input.deprecationReason === 'string') {
165
+ result.deprecationReason = input.deprecationReason
166
+ }
167
+ if (typeof input.unpublishedAt === 'number') {
168
+ result.unpublishedAt = input.unpublishedAt
169
+ }
170
+ return result
171
+ }
172
+
173
+ constructor(input: Partial<DataCatalogVersionSchema> = {}) {
174
+ const init = DataCatalogVersion.createSchema(input)
175
+ this.key = init.key
176
+ this.catalogKey = init.catalogKey
177
+ this.lifecycle = init.lifecycle
178
+ this.scope = init.scope
179
+ this.version = init.version
180
+ this.publishedBy = init.publishedBy
181
+ this.createdAt = init.createdAt
182
+ this.updatedAt = init.updatedAt
183
+ if (typeof init.changelog === 'string') {
184
+ this.changelog = init.changelog
185
+ }
186
+ if (typeof init.deprecated === 'boolean') {
187
+ this.deprecated = init.deprecated
188
+ }
189
+ if (typeof init.deprecatedAt === 'number') {
190
+ this.deprecatedAt = init.deprecatedAt
191
+ }
192
+ if (typeof init.deprecatedBy === 'string') {
193
+ this.deprecatedBy = init.deprecatedBy
194
+ }
195
+ if (typeof init.deprecationReason === 'string') {
196
+ this.deprecationReason = init.deprecationReason
197
+ }
198
+ if (typeof init.unpublishedAt === 'number') {
199
+ this.unpublishedAt = init.unpublishedAt
200
+ }
201
+ }
202
+
203
+ toJSON(): DataCatalogVersionSchema {
204
+ const result: DataCatalogVersionSchema = {
205
+ key: this.key,
206
+ kind: DataCatalogVersionKind,
207
+ scope: this.scope,
208
+ publishedBy: this.publishedBy,
209
+ createdAt: this.createdAt,
210
+ updatedAt: this.updatedAt,
211
+ catalogKey: this.catalogKey,
212
+ lifecycle: this.lifecycle,
213
+ version: this.version,
214
+ }
215
+ if (typeof this.deprecated === 'boolean') {
216
+ result.deprecated = this.deprecated
217
+ }
218
+ if (typeof this.deprecatedAt === 'number') {
219
+ result.deprecatedAt = this.deprecatedAt
220
+ }
221
+ if (typeof this.deprecatedBy === 'string') {
222
+ result.deprecatedBy = this.deprecatedBy
223
+ }
224
+ if (typeof this.deprecationReason === 'string') {
225
+ result.deprecationReason = this.deprecationReason
226
+ }
227
+ if (typeof this.unpublishedAt === 'number') {
228
+ result.unpublishedAt = this.unpublishedAt
229
+ }
230
+ if (typeof this.changelog === 'string' && this.changelog) {
231
+ result.changelog = this.changelog
232
+ }
233
+ return result
234
+ }
235
+ }
@@ -16,6 +16,8 @@ export const DomainModelKind = 'Domain#Model'
16
16
  export const DomainEntityKind = 'Domain#Entity'
17
17
  export const DomainAssociationKind = 'Domain#Association'
18
18
  export const DomainPropertyKind = 'Domain#Property'
19
+ export const DataCatalogKind = 'Core#DataCatalog'
20
+ export const DataCatalogVersionKind = 'Core#DataCatalogVersion'
19
21
 
20
22
  /**
21
23
  * @deprecated Not used anymore.