@api-client/core 0.12.17 → 0.13.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.
- package/build/src/events/BaseEvents.d.ts +46 -26
- package/build/src/events/BaseEvents.d.ts.map +1 -1
- package/build/src/events/BaseEvents.js.map +1 -1
- package/build/src/sdk/FilesSdk.d.ts +1 -1
- package/build/src/sdk/FilesSdk.d.ts.map +1 -1
- package/build/src/sdk/FilesSdk.js +2 -5
- package/build/src/sdk/FilesSdk.js.map +1 -1
- package/build/src/sdk/Sdk.d.ts.map +1 -1
- package/build/src/sdk/Sdk.js +6 -16
- package/build/src/sdk/Sdk.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/data/models/example-generator-api.json +15 -15
- package/package.json +1 -1
- package/src/events/BaseEvents.ts +62 -26
- package/src/sdk/FilesSdk.ts +1 -5
- package/src/sdk/Sdk.ts +6 -16
|
@@ -41722,10 +41722,10 @@
|
|
|
41722
41722
|
"@id": "#209"
|
|
41723
41723
|
},
|
|
41724
41724
|
{
|
|
41725
|
-
"@id": "#
|
|
41725
|
+
"@id": "#194"
|
|
41726
41726
|
},
|
|
41727
41727
|
{
|
|
41728
|
-
"@id": "#
|
|
41728
|
+
"@id": "#191"
|
|
41729
41729
|
},
|
|
41730
41730
|
{
|
|
41731
41731
|
"@id": "#197"
|
|
@@ -42470,16 +42470,16 @@
|
|
|
42470
42470
|
"@id": "#219"
|
|
42471
42471
|
},
|
|
42472
42472
|
{
|
|
42473
|
-
"@id": "#
|
|
42473
|
+
"@id": "#219"
|
|
42474
42474
|
},
|
|
42475
42475
|
{
|
|
42476
42476
|
"@id": "#213"
|
|
42477
42477
|
},
|
|
42478
42478
|
{
|
|
42479
|
-
"@id": "#
|
|
42479
|
+
"@id": "#210"
|
|
42480
42480
|
},
|
|
42481
42481
|
{
|
|
42482
|
-
"@id": "#
|
|
42482
|
+
"@id": "#216"
|
|
42483
42483
|
}
|
|
42484
42484
|
],
|
|
42485
42485
|
"doc:root": false,
|
|
@@ -43096,7 +43096,7 @@
|
|
|
43096
43096
|
"doc:ExternalDomainElement",
|
|
43097
43097
|
"doc:DomainElement"
|
|
43098
43098
|
],
|
|
43099
|
-
"doc:raw": "
|
|
43099
|
+
"doc:raw": "addressType: 'REGISTERED-OFFICE-ADDRESS'\nstreetName: 'UITBREIDINGSTRAAT'\nhouseNumber: '84'\nhouseNumberAddition: '/1'\npostalCode: '2600'\ncity: 'BERCHEM (ANTWERPEN)'\ncountry: 'Belgium'\ncountryCode: 'BE'\nfullFormatedAddress: \"UITBREIDINGSTRAAT 84 /1, 2600 BERCHEM (ANTWERPEN), BELIUM\"\n",
|
|
43100
43100
|
"core:mediaType": "application/yaml",
|
|
43101
43101
|
"sourcemaps:sources": [
|
|
43102
43102
|
{
|
|
@@ -43117,7 +43117,7 @@
|
|
|
43117
43117
|
"doc:ExternalDomainElement",
|
|
43118
43118
|
"doc:DomainElement"
|
|
43119
43119
|
],
|
|
43120
|
-
"doc:raw": "
|
|
43120
|
+
"doc:raw": "countryCode: \"BE\"\ngraydonEnterpriseId: 1057155523\nregistrationId: \"0422319093\"\nvatNumber: \"BE0422319093\"\ngraydonCompanyId: \"0422319093\"\nisBranchOffice: false\n",
|
|
43121
43121
|
"core:mediaType": "application/yaml",
|
|
43122
43122
|
"sourcemaps:sources": [
|
|
43123
43123
|
{
|
|
@@ -43892,7 +43892,7 @@
|
|
|
43892
43892
|
"doc:ExternalDomainElement",
|
|
43893
43893
|
"doc:DomainElement"
|
|
43894
43894
|
],
|
|
43895
|
-
"doc:raw": "type: 'GENERAL'\
|
|
43895
|
+
"doc:raw": "-\n type: 'GENERAL'\n value: 'info@company.be'\n-\n type: 'IT_DEPT'\n value: 'it-service@company.be'\n",
|
|
43896
43896
|
"core:mediaType": "application/yaml",
|
|
43897
43897
|
"sourcemaps:sources": [
|
|
43898
43898
|
{
|
|
@@ -43934,7 +43934,7 @@
|
|
|
43934
43934
|
"doc:ExternalDomainElement",
|
|
43935
43935
|
"doc:DomainElement"
|
|
43936
43936
|
],
|
|
43937
|
-
"doc:raw": "
|
|
43937
|
+
"doc:raw": "type: \"GENERAL\"\nvalue: \"www.company.be\"\n",
|
|
43938
43938
|
"core:mediaType": "application/yaml",
|
|
43939
43939
|
"sourcemaps:sources": [
|
|
43940
43940
|
{
|
|
@@ -43955,7 +43955,7 @@
|
|
|
43955
43955
|
"doc:ExternalDomainElement",
|
|
43956
43956
|
"doc:DomainElement"
|
|
43957
43957
|
],
|
|
43958
|
-
"doc:raw": "type:
|
|
43958
|
+
"doc:raw": "type: 'GENERAL'\ncountryDialCode : '+32'\nareaCode : '22'\nsubscriberNumber: '12.87.00'\nformatted: '+32-(0)22 000000'\n",
|
|
43959
43959
|
"core:mediaType": "application/yaml",
|
|
43960
43960
|
"sourcemaps:sources": [
|
|
43961
43961
|
{
|
|
@@ -44416,12 +44416,12 @@
|
|
|
44416
44416
|
{
|
|
44417
44417
|
"@id": "#193/source-map/lexical/element_0",
|
|
44418
44418
|
"sourcemaps:element": "amf://id#193",
|
|
44419
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44419
|
+
"sourcemaps:value": "[(1,0)-(10,0)]"
|
|
44420
44420
|
},
|
|
44421
44421
|
{
|
|
44422
44422
|
"@id": "#196/source-map/lexical/element_0",
|
|
44423
44423
|
"sourcemaps:element": "amf://id#196",
|
|
44424
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44424
|
+
"sourcemaps:value": "[(1,0)-(7,0)]"
|
|
44425
44425
|
},
|
|
44426
44426
|
{
|
|
44427
44427
|
"@id": "#199/source-map/lexical/element_0",
|
|
@@ -44776,7 +44776,7 @@
|
|
|
44776
44776
|
{
|
|
44777
44777
|
"@id": "#212/source-map/lexical/element_0",
|
|
44778
44778
|
"sourcemaps:element": "amf://id#212",
|
|
44779
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44779
|
+
"sourcemaps:value": "[(1,0)-(7,0)]"
|
|
44780
44780
|
},
|
|
44781
44781
|
{
|
|
44782
44782
|
"@id": "#215/source-map/lexical/element_0",
|
|
@@ -44786,12 +44786,12 @@
|
|
|
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)-(3,0)]"
|
|
44790
44790
|
},
|
|
44791
44791
|
{
|
|
44792
44792
|
"@id": "#221/source-map/lexical/element_0",
|
|
44793
44793
|
"sourcemaps:element": "amf://id#221",
|
|
44794
|
-
"sourcemaps:value": "[(1,0)-(
|
|
44794
|
+
"sourcemaps:value": "[(1,0)-(6,0)]"
|
|
44795
44795
|
},
|
|
44796
44796
|
{
|
|
44797
44797
|
"@id": "#338/source-map/synthesized-field/element_1",
|
package/package.json
CHANGED
package/src/events/BaseEvents.ts
CHANGED
|
@@ -350,6 +350,58 @@ export interface ContextListResult<T> {
|
|
|
350
350
|
items: T[]
|
|
351
351
|
}
|
|
352
352
|
|
|
353
|
+
/**
|
|
354
|
+
* Defines the type of comparison or operation to be performed on a field.
|
|
355
|
+
* - eq: Equal
|
|
356
|
+
* - neq: Not Equal
|
|
357
|
+
* - gt: Greater Than
|
|
358
|
+
* - lt: Less Than
|
|
359
|
+
* - gte: Greater Than or Equal
|
|
360
|
+
* - lte: Less Than or Equal
|
|
361
|
+
* - con: String contains substring / Array contains element
|
|
362
|
+
* - start: String starts with
|
|
363
|
+
* - end: String ends with
|
|
364
|
+
* - in: Value is one of the elements in the provided array
|
|
365
|
+
* - nin: Value is not one of the elements in the provided array
|
|
366
|
+
*/
|
|
367
|
+
export type FilterOperator =
|
|
368
|
+
| 'eq' // Equal
|
|
369
|
+
| 'neq' // Not Equal
|
|
370
|
+
| 'gt' // Greater Than
|
|
371
|
+
| 'lt' // Less Than
|
|
372
|
+
| 'gte' // Greater Than or Equal
|
|
373
|
+
| 'lte' // Less Than or Equal
|
|
374
|
+
| 'con' // String contains substring / Array contains element
|
|
375
|
+
| 'start' // String starts with
|
|
376
|
+
| 'end' // String ends with
|
|
377
|
+
| 'in' // Value is one of the elements in the provided array
|
|
378
|
+
| 'nin' // Value is not one of the elements in the provided array
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Represents a single filter condition applied to a field.
|
|
382
|
+
*/
|
|
383
|
+
export interface AtomicFilter {
|
|
384
|
+
field: string
|
|
385
|
+
operator: FilterOperator
|
|
386
|
+
value?: unknown // The value to compare against the field.
|
|
387
|
+
// For 'in'/'nin', value should be an array.
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Represents a group of filters combined with a logical operator.
|
|
392
|
+
* This allows for nesting and complex query construction.
|
|
393
|
+
*/
|
|
394
|
+
export interface FilterGroup {
|
|
395
|
+
op: 'AND' | 'OR'
|
|
396
|
+
filters: (AtomicFilter | FilterGroup)[]
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Represents a filter that can be either a single atomic condition
|
|
401
|
+
* or a group of conditions. This is the type to be used in ContextListOptions.
|
|
402
|
+
*/
|
|
403
|
+
export type QueryFilter = AtomicFilter | FilterGroup
|
|
404
|
+
|
|
353
405
|
/**
|
|
354
406
|
* Base query options for the data store.
|
|
355
407
|
*/
|
|
@@ -359,25 +411,9 @@ export interface ContextListOptions {
|
|
|
359
411
|
*/
|
|
360
412
|
limit?: number
|
|
361
413
|
/**
|
|
362
|
-
* Page cursor to use with the query. This is returned by the
|
|
414
|
+
* Page cursor to use with the query. This is returned by the API.
|
|
363
415
|
*/
|
|
364
416
|
cursor?: string
|
|
365
|
-
/**
|
|
366
|
-
* Optional general purpose parent for the query.
|
|
367
|
-
*/
|
|
368
|
-
parent?: string
|
|
369
|
-
/**
|
|
370
|
-
* Supported by some endpoints. When set it performs a query on the data store.
|
|
371
|
-
*/
|
|
372
|
-
query?: string
|
|
373
|
-
/**
|
|
374
|
-
* Only with the `query` property. Tells the system in which fields to search for the query term.
|
|
375
|
-
*/
|
|
376
|
-
queryField?: string[]
|
|
377
|
-
/**
|
|
378
|
-
* Whether to use the `descending` order.
|
|
379
|
-
*/
|
|
380
|
-
descending?: boolean
|
|
381
417
|
/**
|
|
382
418
|
* The name of the field to order then results.
|
|
383
419
|
*/
|
|
@@ -387,11 +423,6 @@ export interface ContextListOptions {
|
|
|
387
423
|
* It can be `asc` or `desc`.
|
|
388
424
|
*/
|
|
389
425
|
order?: 'asc' | 'desc'
|
|
390
|
-
/**
|
|
391
|
-
* General purpose type property to filer the results.
|
|
392
|
-
* This is used, for example, by the history store to list history for a specific type of requests,
|
|
393
|
-
*/
|
|
394
|
-
type?: string
|
|
395
426
|
/**
|
|
396
427
|
* Used when synchronizing data in the local store with the data stored in the net-store.
|
|
397
428
|
* The timestamp when the last synchronization was performed. The resulting array will contain only items that
|
|
@@ -399,14 +430,19 @@ export interface ContextListOptions {
|
|
|
399
430
|
*/
|
|
400
431
|
since?: number
|
|
401
432
|
/**
|
|
402
|
-
*
|
|
433
|
+
* Optional parent identifier for hierarchical queries.
|
|
434
|
+
* Some specific list operations might use this directly.
|
|
403
435
|
*/
|
|
404
|
-
|
|
436
|
+
parent?: string
|
|
405
437
|
/**
|
|
406
|
-
*
|
|
407
|
-
*
|
|
438
|
+
* Optional organization identifier.
|
|
439
|
+
* Some specific list operations might use this directly if not part of the main path.
|
|
408
440
|
*/
|
|
409
441
|
oid?: string
|
|
442
|
+
/**
|
|
443
|
+
* A structured filter object for advanced querying.
|
|
444
|
+
*/
|
|
445
|
+
filter?: QueryFilter
|
|
410
446
|
}
|
|
411
447
|
|
|
412
448
|
export class ContextListEvent<T> extends ContextEvent<ContextListOptions, ContextListResult<T>> {
|
package/src/sdk/FilesSdk.ts
CHANGED
|
@@ -60,16 +60,12 @@ export class FilesSdk extends SdkBase {
|
|
|
60
60
|
*/
|
|
61
61
|
async list(
|
|
62
62
|
organization: string,
|
|
63
|
-
kinds?: ListFileKind[],
|
|
64
63
|
options: ContextListOptions = {},
|
|
65
64
|
request: SdkOptions = {}
|
|
66
65
|
): Promise<ContextListResult<IFile>> {
|
|
67
66
|
const { token } = request
|
|
68
67
|
const opts = { ...options }
|
|
69
68
|
const url = this.sdk.getUrl(RouteBuilder.files(organization))
|
|
70
|
-
if (kinds && kinds.length) {
|
|
71
|
-
opts.kinds = kinds
|
|
72
|
-
}
|
|
73
69
|
this.sdk.appendListOptions(url, opts)
|
|
74
70
|
const result = await this.sdk.http.get(url.toString(), { token })
|
|
75
71
|
this.inspectCommonStatusCodes(result)
|
|
@@ -326,7 +322,7 @@ export class FilesSdk extends SdkBase {
|
|
|
326
322
|
async readBulk(organization: string, keys: string[], request: SdkOptions = {}): Promise<IBulkOperationResult<IFile>> {
|
|
327
323
|
const { token } = request
|
|
328
324
|
const url = this.sdk.getUrl(RouteBuilder.filesBatch(organization))
|
|
329
|
-
const body = JSON.stringify(keys)
|
|
325
|
+
const body = JSON.stringify({ ids: keys })
|
|
330
326
|
const result = await this.sdk.http.post(url.toString(), { token, body })
|
|
331
327
|
this.inspectCommonStatusCodes(result)
|
|
332
328
|
const E_PREFIX = 'Unable to read files in bulk. '
|
package/src/sdk/Sdk.ts
CHANGED
|
@@ -144,26 +144,12 @@ export abstract class Sdk {
|
|
|
144
144
|
if (options.cursor) {
|
|
145
145
|
searchParams.set('cursor', options.cursor)
|
|
146
146
|
}
|
|
147
|
-
if (Array.isArray(options.kinds)) {
|
|
148
|
-
options.kinds.forEach((k) => url.searchParams.append('kinds', String(k)))
|
|
149
|
-
}
|
|
150
147
|
if (typeof options.limit === 'number') {
|
|
151
148
|
searchParams.set('limit', String(options.limit))
|
|
152
149
|
}
|
|
153
|
-
if (options.query) {
|
|
154
|
-
searchParams.set('query', options.query)
|
|
155
|
-
}
|
|
156
|
-
if (Array.isArray(options.queryField)) {
|
|
157
|
-
options.queryField.forEach((field) => {
|
|
158
|
-
searchParams.append('queryField', field)
|
|
159
|
-
})
|
|
160
|
-
}
|
|
161
150
|
if (options.parent) {
|
|
162
151
|
searchParams.set('parent', options.parent)
|
|
163
152
|
}
|
|
164
|
-
if (options.type) {
|
|
165
|
-
searchParams.set('type', options.type)
|
|
166
|
-
}
|
|
167
153
|
if (options.since) {
|
|
168
154
|
searchParams.set('since', String(options.since))
|
|
169
155
|
}
|
|
@@ -176,8 +162,12 @@ export abstract class Sdk {
|
|
|
176
162
|
if (options.oid) {
|
|
177
163
|
searchParams.set('oid', String(options.oid))
|
|
178
164
|
}
|
|
179
|
-
if (
|
|
180
|
-
|
|
165
|
+
if (options.filter) {
|
|
166
|
+
const bytes = new TextEncoder().encode(JSON.stringify(options.filter))
|
|
167
|
+
// To be used when Uint8Array.prototype.toBase64() is available.
|
|
168
|
+
// const encoded = bytes.toBase64({ alphabet: 'base64url' })
|
|
169
|
+
const binString = Array.from(bytes, (byte) => String.fromCodePoint(byte)).join('')
|
|
170
|
+
searchParams.set('filter', btoa(binString))
|
|
181
171
|
}
|
|
182
172
|
}
|
|
183
173
|
}
|