@xyo-network/api 2.61.0 → 2.62.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/dist/cjs/Api/Api.js +4 -4
- package/dist/cjs/Api/Api.js.map +1 -1
- package/dist/cjs/Base.js +8 -8
- package/dist/cjs/Base.js.map +1 -1
- package/dist/cjs/Diviner/LocationDiviner/LocationDivinerApi.js +3 -3
- package/dist/cjs/Diviner/LocationDiviner/LocationDivinerApi.js.map +1 -1
- package/dist/cjs/Diviner/LocationDiviner/index.js +0 -1
- package/dist/cjs/Diviner/LocationDiviner/index.js.map +1 -1
- package/dist/cjs/Diviner/RemoteDivinerConfig.js +5 -0
- package/dist/cjs/Diviner/RemoteDivinerConfig.js.map +1 -0
- package/dist/cjs/Diviner/index.js +1 -1
- package/dist/cjs/Diviner/index.js.map +1 -1
- package/dist/cjs/Simple.js +3 -3
- package/dist/cjs/Simple.js.map +1 -1
- package/dist/docs.json +1918 -2043
- package/dist/esm/Api/Api.js +3 -3
- package/dist/esm/Api/Api.js.map +1 -1
- package/dist/esm/Base.js +6 -6
- package/dist/esm/Base.js.map +1 -1
- package/dist/esm/Diviner/LocationDiviner/LocationDivinerApi.js +2 -2
- package/dist/esm/Diviner/LocationDiviner/LocationDivinerApi.js.map +1 -1
- package/dist/esm/Diviner/LocationDiviner/index.js +0 -1
- package/dist/esm/Diviner/LocationDiviner/index.js.map +1 -1
- package/dist/esm/Diviner/RemoteDivinerConfig.js +2 -0
- package/dist/esm/Diviner/RemoteDivinerConfig.js.map +1 -0
- package/dist/esm/Diviner/index.js +1 -1
- package/dist/esm/Diviner/index.js.map +1 -1
- package/dist/esm/Simple.js +2 -2
- package/dist/esm/Simple.js.map +1 -1
- package/dist/types/Api/Api.d.ts +5 -5
- package/dist/types/Api/Api.d.ts.map +1 -1
- package/dist/types/Base.d.ts +19 -19
- package/dist/types/Base.d.ts.map +1 -1
- package/dist/types/Diviner/LocationDiviner/LocationDivinerApi.d.ts +3 -3
- package/dist/types/Diviner/LocationDiviner/LocationDivinerApi.d.ts.map +1 -1
- package/dist/types/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.ts +3 -3
- package/dist/types/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.ts.map +1 -1
- package/dist/types/Diviner/LocationDiviner/index.d.ts +0 -1
- package/dist/types/Diviner/LocationDiviner/index.d.ts.map +1 -1
- package/dist/types/Diviner/RemoteDivinerConfig.d.ts +11 -0
- package/dist/types/Diviner/RemoteDivinerConfig.d.ts.map +1 -0
- package/dist/types/Diviner/index.d.ts +1 -1
- package/dist/types/Diviner/index.d.ts.map +1 -1
- package/dist/types/Simple.d.ts +19 -19
- package/dist/types/Simple.d.ts.map +1 -1
- package/dist/types/WithArchive.d.ts +1 -1
- package/dist/types/WithArchive.d.ts.map +1 -1
- package/dist/types/models/ArchivePath.d.ts +1 -1
- package/dist/types/models/ArchivePath.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/Api/Api.ts +4 -4
- package/src/Base.ts +46 -50
- package/src/Diviner/LocationDiviner/LocationDivinerApi.ts +3 -3
- package/src/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.ts +3 -3
- package/src/Diviner/LocationDiviner/index.ts +0 -1
- package/src/Diviner/RemoteDivinerConfig.ts +13 -0
- package/src/Diviner/index.ts +1 -1
- package/src/Simple.ts +24 -29
- package/src/WithArchive.ts +1 -1
- package/src/models/ArchivePath.ts +1 -1
- package/dist/cjs/Diviner/LocationDiviner/ApiConfig.js +0 -3
- package/dist/cjs/Diviner/LocationDiviner/ApiConfig.js.map +0 -1
- package/dist/cjs/Diviner/XyoRemoteDivinerConfig.js +0 -5
- package/dist/cjs/Diviner/XyoRemoteDivinerConfig.js.map +0 -1
- package/dist/esm/Diviner/LocationDiviner/ApiConfig.js +0 -2
- package/dist/esm/Diviner/LocationDiviner/ApiConfig.js.map +0 -1
- package/dist/esm/Diviner/XyoRemoteDivinerConfig.js +0 -2
- package/dist/esm/Diviner/XyoRemoteDivinerConfig.js.map +0 -1
- package/dist/types/Diviner/LocationDiviner/ApiConfig.d.ts +0 -7
- package/dist/types/Diviner/LocationDiviner/ApiConfig.d.ts.map +0 -1
- package/dist/types/Diviner/XyoRemoteDivinerConfig.d.ts +0 -11
- package/dist/types/Diviner/XyoRemoteDivinerConfig.d.ts.map +0 -1
- package/src/Diviner/LocationDiviner/ApiConfig.ts +0 -6
- package/src/Diviner/XyoRemoteDivinerConfig.ts +0 -13
package/src/Base.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
ApiConfig,
|
|
3
|
+
ApiEnvelope,
|
|
4
|
+
ApiError,
|
|
5
|
+
ApiReportable,
|
|
6
|
+
ApiResponse,
|
|
7
|
+
ApiResponseBody,
|
|
8
|
+
ApiResponseTuple,
|
|
9
|
+
ApiResponseTupleOrBody,
|
|
10
|
+
ApiResponseType,
|
|
11
11
|
} from '@xyo-network/api-models'
|
|
12
12
|
import { AxiosJson } from '@xyo-network/axios'
|
|
13
13
|
|
|
14
|
-
export class
|
|
14
|
+
export class ApiBase<C extends ApiConfig = ApiConfig> implements ApiReportable {
|
|
15
15
|
readonly config: C
|
|
16
16
|
protected axios: AxiosJson
|
|
17
17
|
|
|
@@ -43,51 +43,51 @@ export class XyoApiBase<C extends XyoApiConfig = XyoApiConfig> implements XyoApi
|
|
|
43
43
|
return this.config.root ?? '/'
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
private static resolveResponse<T>(result?:
|
|
47
|
-
return [result?.data?.data, result?.data, result] as
|
|
46
|
+
private static resolveResponse<T>(result?: ApiResponse<ApiEnvelope<T>>) {
|
|
47
|
+
return [result?.data?.data, result?.data, result] as ApiResponseTuple<T>
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
private static shapeResponse<T = unknown>(response:
|
|
51
|
-
const resolvedResponse =
|
|
50
|
+
private static shapeResponse<T = unknown>(response: ApiResponse<ApiEnvelope<T>> | undefined, responseType?: ApiResponseType) {
|
|
51
|
+
const resolvedResponse = ApiBase.resolveResponse(response)
|
|
52
52
|
return responseType === 'tuple' ? resolvedResponse : resolvedResponse[0]
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
onError(error:
|
|
55
|
+
onError(error: ApiError, depth = 0) {
|
|
56
56
|
this.config.reportableParent?.onError?.(error, depth + 1)
|
|
57
57
|
this.config.onError?.(error, depth)
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
onFailure(response:
|
|
60
|
+
onFailure(response: ApiResponse, depth = 0) {
|
|
61
61
|
this.config.reportableParent?.onFailure?.(response, depth + 1)
|
|
62
62
|
this.config.onFailure?.(response, depth)
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
onSuccess(response:
|
|
65
|
+
onSuccess(response: ApiResponse, depth = 0) {
|
|
66
66
|
this.config.reportableParent?.onSuccess?.(response, depth + 1)
|
|
67
67
|
this.config.onSuccess?.(response, depth)
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
protected async deleteEndpoint<T = unknown>(endPoint?: string): Promise<
|
|
71
|
-
protected async deleteEndpoint<T = unknown>(endPoint?: string, responseType?: 'body'): Promise<
|
|
72
|
-
protected async deleteEndpoint<T = unknown>(endPoint?: string, responseType?: 'tuple'): Promise<
|
|
73
|
-
protected async deleteEndpoint<T = unknown>(endPoint = '', responseType?:
|
|
70
|
+
protected async deleteEndpoint<T = unknown>(endPoint?: string): Promise<ApiResponseBody<T>>
|
|
71
|
+
protected async deleteEndpoint<T = unknown>(endPoint?: string, responseType?: 'body'): Promise<ApiResponseBody<T>>
|
|
72
|
+
protected async deleteEndpoint<T = unknown>(endPoint?: string, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>
|
|
73
|
+
protected async deleteEndpoint<T = unknown>(endPoint = '', responseType?: ApiResponseType): Promise<ApiResponseTupleOrBody<T>> {
|
|
74
74
|
const response = await this.monitorResponse<T>(async () => {
|
|
75
|
-
return await this.axios.delete<
|
|
75
|
+
return await this.axios.delete<ApiEnvelope<T>, ApiResponse<ApiEnvelope<T>>>(`${this.resolveRoot()}${endPoint}${this.query}`)
|
|
76
76
|
})
|
|
77
|
-
return
|
|
77
|
+
return ApiBase.shapeResponse<T>(response, responseType)
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
protected async getEndpoint<T = unknown>(endPoint?: string): Promise<
|
|
81
|
-
protected async getEndpoint<T = unknown>(endPoint?: string, responseType?: 'body'): Promise<
|
|
82
|
-
protected async getEndpoint<T = unknown>(endPoint?: string, responseType?: 'tuple'): Promise<
|
|
83
|
-
protected async getEndpoint<T = unknown>(endPoint = '', responseType?:
|
|
80
|
+
protected async getEndpoint<T = unknown>(endPoint?: string): Promise<ApiResponseBody<T>>
|
|
81
|
+
protected async getEndpoint<T = unknown>(endPoint?: string, responseType?: 'body'): Promise<ApiResponseBody<T>>
|
|
82
|
+
protected async getEndpoint<T = unknown>(endPoint?: string, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>
|
|
83
|
+
protected async getEndpoint<T = unknown>(endPoint = '', responseType?: ApiResponseType): Promise<ApiResponseTupleOrBody<T>> {
|
|
84
84
|
const response = await this.monitorResponse<T>(async () => {
|
|
85
|
-
return await this.axios.get<
|
|
85
|
+
return await this.axios.get<ApiEnvelope<T>, ApiResponse<ApiEnvelope<T>>>(`${this.resolveRoot()}${endPoint}${this.query}`)
|
|
86
86
|
})
|
|
87
|
-
return
|
|
87
|
+
return ApiBase.shapeResponse<T>(response, responseType)
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
protected handleMonitorResponseError<T>(error:
|
|
90
|
+
protected handleMonitorResponseError<T>(error: ApiError, trapAxiosException: boolean) {
|
|
91
91
|
if (!error.isXyoError) {
|
|
92
92
|
throw error
|
|
93
93
|
}
|
|
@@ -97,11 +97,11 @@ export class XyoApiBase<C extends XyoApiConfig = XyoApiConfig> implements XyoApi
|
|
|
97
97
|
if (this.config.throwFailure) {
|
|
98
98
|
throw error
|
|
99
99
|
}
|
|
100
|
-
return error.response as
|
|
100
|
+
return error.response as ApiResponse<ApiEnvelope<T>>
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
protected async monitorResponse<T>(closure: () => Promise<
|
|
104
|
+
protected async monitorResponse<T>(closure: () => Promise<ApiResponse<ApiEnvelope<T>>>) {
|
|
105
105
|
//we use this to prevent accidental catching on exceptions in callbacks
|
|
106
106
|
let trapAxiosException = true
|
|
107
107
|
try {
|
|
@@ -112,36 +112,32 @@ export class XyoApiBase<C extends XyoApiConfig = XyoApiConfig> implements XyoApi
|
|
|
112
112
|
|
|
113
113
|
return response
|
|
114
114
|
} catch (ex) {
|
|
115
|
-
this.handleMonitorResponseError(ex as
|
|
115
|
+
this.handleMonitorResponseError(ex as ApiError, trapAxiosException)
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
protected async postEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D): Promise<
|
|
120
|
-
protected async postEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'body'): Promise<
|
|
121
|
-
protected async postEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'tuple'): Promise<
|
|
119
|
+
protected async postEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D): Promise<ApiResponseBody<T>>
|
|
120
|
+
protected async postEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'body'): Promise<ApiResponseBody<T>>
|
|
121
|
+
protected async postEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>
|
|
122
122
|
protected async postEndpoint<T = unknown, D = unknown>(
|
|
123
123
|
endPoint = '',
|
|
124
124
|
data?: D,
|
|
125
|
-
responseType?:
|
|
126
|
-
): Promise<
|
|
125
|
+
responseType?: ApiResponseType,
|
|
126
|
+
): Promise<ApiResponseTupleOrBody<T>> {
|
|
127
127
|
const response = await this.monitorResponse<T>(async () => {
|
|
128
|
-
return await this.axios.post<
|
|
128
|
+
return await this.axios.post<ApiEnvelope<T>, ApiResponse<ApiEnvelope<T>, D>, D>(`${this.resolveRoot()}${endPoint}${this.query}`, data)
|
|
129
129
|
})
|
|
130
|
-
return
|
|
130
|
+
return ApiBase.shapeResponse<T>(response, responseType)
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
protected async putEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D): Promise<
|
|
134
|
-
protected async putEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'body'): Promise<
|
|
135
|
-
protected async putEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'tuple'): Promise<
|
|
136
|
-
protected async putEndpoint<T = unknown, D = unknown>(
|
|
137
|
-
endPoint = '',
|
|
138
|
-
data?: D,
|
|
139
|
-
responseType?: XyoApiResponseType,
|
|
140
|
-
): Promise<XyoApiResponseTupleOrBody<T>> {
|
|
133
|
+
protected async putEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D): Promise<ApiResponseBody<T>>
|
|
134
|
+
protected async putEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'body'): Promise<ApiResponseBody<T>>
|
|
135
|
+
protected async putEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>
|
|
136
|
+
protected async putEndpoint<T = unknown, D = unknown>(endPoint = '', data?: D, responseType?: ApiResponseType): Promise<ApiResponseTupleOrBody<T>> {
|
|
141
137
|
const response = await this.monitorResponse<T>(async () => {
|
|
142
|
-
return await this.axios.put<
|
|
138
|
+
return await this.axios.put<ApiEnvelope<T>, ApiResponse<ApiEnvelope<T>, D>, D>(`${this.resolveRoot()}${endPoint}${this.query}`, data)
|
|
143
139
|
})
|
|
144
|
-
return
|
|
140
|
+
return ApiBase.shapeResponse<T>(response, responseType)
|
|
145
141
|
}
|
|
146
142
|
|
|
147
143
|
private resolveRoot() {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { ApiConfig } from '@xyo-network/api-models'
|
|
1
2
|
import { axios, RawAxiosRequestConfig } from '@xyo-network/axios'
|
|
2
3
|
|
|
3
|
-
import { ApiConfig } from './ApiConfig'
|
|
4
4
|
import { getLocationDivinerApiResponseTransformer } from './LocationDivinerApiResponseTransformer'
|
|
5
5
|
import { GetLocationQueryResponse } from './models'
|
|
6
6
|
import { LocationQueryCreationResponse, SupportedLocationQueryCreationRequest } from './Queries'
|
|
7
7
|
|
|
8
|
-
class
|
|
8
|
+
class LocationDivinerApi {
|
|
9
9
|
config: ApiConfig
|
|
10
10
|
constructor(config: ApiConfig) {
|
|
11
11
|
this.config = config
|
|
@@ -26,4 +26,4 @@ class XyoLocationDivinerApi {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
export {
|
|
29
|
+
export { LocationDivinerApi }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ApiConfig } from '@xyo-network/api-models'
|
|
2
2
|
|
|
3
3
|
import { LocationHeatmapQuery, LocationHeatmapQuerySchema } from './LocationHeatmapQuery'
|
|
4
4
|
import { LocationQuadkeyHeatmapQuery, LocationQuadkeyHeatmapQuerySchema } from './LocationQuadkeyHeatmapQuery'
|
|
@@ -11,10 +11,10 @@ export interface LocationQueryCreationRequest<
|
|
|
11
11
|
> {
|
|
12
12
|
query: TQuery
|
|
13
13
|
resultArchive: string
|
|
14
|
-
resultArchivist:
|
|
14
|
+
resultArchivist: ApiConfig
|
|
15
15
|
schema: TSchema
|
|
16
16
|
sourceArchive: string
|
|
17
|
-
sourceArchivist:
|
|
17
|
+
sourceArchivist: ApiConfig
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export type LocationTimeRangeQueryCreationRequest = LocationQueryCreationRequest<LocationTimeRangeQuerySchema, LocationTimeRangeQuery>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DivinerConfig } from '@xyo-network/diviner-model'
|
|
2
|
+
|
|
3
|
+
import { ArchivistApi } from '../Api'
|
|
4
|
+
|
|
5
|
+
export type RemoteDivinerConfigSchema = 'network.xyo.diviner.remote.config'
|
|
6
|
+
export const RemoteDivinerConfigSchema: RemoteDivinerConfigSchema = 'network.xyo.diviner.remote.config'
|
|
7
|
+
|
|
8
|
+
export type RemoteDivinerConfig = DivinerConfig & {
|
|
9
|
+
/** @deprecated use in params instead */
|
|
10
|
+
api?: ArchivistApi
|
|
11
|
+
archive?: string
|
|
12
|
+
schema: RemoteDivinerConfigSchema
|
|
13
|
+
}
|
package/src/Diviner/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './LocationDiviner'
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './RemoteDivinerConfig'
|
package/src/Simple.ts
CHANGED
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ApiConfig, ApiResponseBody, ApiResponseTuple, ApiResponseTupleOrBody, ApiResponseType } from '@xyo-network/api-models'
|
|
2
2
|
import { Payload, PayloadFindFilter } from '@xyo-network/payload-model'
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { ApiBase } from './Base'
|
|
5
5
|
import { objToQuery } from './objToQuery'
|
|
6
6
|
|
|
7
|
-
export type
|
|
7
|
+
export type ApiSimpleQuery = PayloadFindFilter
|
|
8
8
|
|
|
9
|
-
export class
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
> extends XyoApiBase<C> {
|
|
15
|
-
async delete(): Promise<XyoApiResponseBody<T>>
|
|
16
|
-
async delete(responseType?: 'body'): Promise<XyoApiResponseBody<T>>
|
|
17
|
-
async delete(responseType?: 'tuple'): Promise<XyoApiResponseTuple<T>>
|
|
18
|
-
async delete(responseType?: XyoApiResponseType): Promise<XyoApiResponseTupleOrBody<T>> {
|
|
9
|
+
export class ApiSimple<T = Payload, D = T, Q extends ApiSimpleQuery = ApiSimpleQuery, C extends ApiConfig = ApiConfig> extends ApiBase<C> {
|
|
10
|
+
async delete(): Promise<ApiResponseBody<T>>
|
|
11
|
+
async delete(responseType?: 'body'): Promise<ApiResponseBody<T>>
|
|
12
|
+
async delete(responseType?: 'tuple'): Promise<ApiResponseTuple<T>>
|
|
13
|
+
async delete(responseType?: ApiResponseType): Promise<ApiResponseTupleOrBody<T>> {
|
|
19
14
|
switch (responseType) {
|
|
20
15
|
case 'tuple':
|
|
21
16
|
return await this.deleteEndpoint(undefined, 'tuple')
|
|
@@ -24,10 +19,10 @@ export class XyoApiSimple<
|
|
|
24
19
|
}
|
|
25
20
|
}
|
|
26
21
|
|
|
27
|
-
async find(query?: Q): Promise<
|
|
28
|
-
async find(query?: Q, responseType?: 'body'): Promise<
|
|
29
|
-
async find(query?: Q, responseType?: 'tuple'): Promise<
|
|
30
|
-
async find(query = {}, responseType?:
|
|
22
|
+
async find(query?: Q): Promise<ApiResponseBody<T>>
|
|
23
|
+
async find(query?: Q, responseType?: 'body'): Promise<ApiResponseBody<T>>
|
|
24
|
+
async find(query?: Q, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>
|
|
25
|
+
async find(query = {}, responseType?: ApiResponseType): Promise<ApiResponseTupleOrBody<T>> {
|
|
31
26
|
switch (responseType) {
|
|
32
27
|
case 'tuple':
|
|
33
28
|
return await this.getEndpoint(objToQuery(query), 'tuple')
|
|
@@ -36,10 +31,10 @@ export class XyoApiSimple<
|
|
|
36
31
|
}
|
|
37
32
|
}
|
|
38
33
|
|
|
39
|
-
async get(): Promise<
|
|
40
|
-
async get(responseType?: 'body'): Promise<
|
|
41
|
-
async get(responseType?: 'tuple'): Promise<
|
|
42
|
-
async get(responseType?:
|
|
34
|
+
async get(): Promise<ApiResponseBody<T>>
|
|
35
|
+
async get(responseType?: 'body'): Promise<ApiResponseBody<T>>
|
|
36
|
+
async get(responseType?: 'tuple'): Promise<ApiResponseTuple<T>>
|
|
37
|
+
async get(responseType?: ApiResponseType): Promise<ApiResponseTupleOrBody<T>> {
|
|
43
38
|
switch (responseType) {
|
|
44
39
|
case 'tuple':
|
|
45
40
|
return await this.getEndpoint(undefined, 'tuple')
|
|
@@ -48,10 +43,10 @@ export class XyoApiSimple<
|
|
|
48
43
|
}
|
|
49
44
|
}
|
|
50
45
|
|
|
51
|
-
async post(data?: D): Promise<
|
|
52
|
-
async post(data?: D, responseType?: 'body'): Promise<
|
|
53
|
-
async post(data?: D, responseType?: 'tuple'): Promise<
|
|
54
|
-
async post(data?: D, responseType?:
|
|
46
|
+
async post(data?: D): Promise<ApiResponseBody<T>>
|
|
47
|
+
async post(data?: D, responseType?: 'body'): Promise<ApiResponseBody<T>>
|
|
48
|
+
async post(data?: D, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>
|
|
49
|
+
async post(data?: D, responseType?: ApiResponseType): Promise<ApiResponseTupleOrBody<T>> {
|
|
55
50
|
switch (responseType) {
|
|
56
51
|
case 'tuple':
|
|
57
52
|
return await this.postEndpoint(undefined, data, 'tuple')
|
|
@@ -60,10 +55,10 @@ export class XyoApiSimple<
|
|
|
60
55
|
}
|
|
61
56
|
}
|
|
62
57
|
|
|
63
|
-
async put(data?: D): Promise<
|
|
64
|
-
async put(data?: D, responseType?: 'body'): Promise<
|
|
65
|
-
async put(data?: D, responseType?: 'tuple'): Promise<
|
|
66
|
-
async put(data?: D, responseType?:
|
|
58
|
+
async put(data?: D): Promise<ApiResponseBody<T>>
|
|
59
|
+
async put(data?: D, responseType?: 'body'): Promise<ApiResponseBody<T>>
|
|
60
|
+
async put(data?: D, responseType?: 'tuple'): Promise<ApiResponseTuple<T>>
|
|
61
|
+
async put(data?: D, responseType?: ApiResponseType): Promise<ApiResponseTupleOrBody<T>> {
|
|
67
62
|
switch (responseType) {
|
|
68
63
|
case 'tuple':
|
|
69
64
|
return await this.putEndpoint(undefined, data, 'tuple')
|
package/src/WithArchive.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ApiConfig.js","sourceRoot":"","sources":["../../../../src/Diviner/LocationDiviner/ApiConfig.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"XyoRemoteDivinerConfig.js","sourceRoot":"","sources":["../../../src/Diviner/XyoRemoteDivinerConfig.ts"],"names":[],"mappings":";;;AAKa,QAAA,4BAA4B,GAAiC,mCAAmC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ApiConfig.js","sourceRoot":"","sources":["../../../../src/Diviner/LocationDiviner/ApiConfig.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"XyoRemoteDivinerConfig.js","sourceRoot":"","sources":["../../../src/Diviner/XyoRemoteDivinerConfig.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,4BAA4B,GAAiC,mCAAmC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ApiConfig.d.ts","sourceRoot":"","sources":["../../../../src/Diviner/LocationDiviner/ApiConfig.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { DivinerConfig } from '@xyo-network/diviner-model';
|
|
2
|
-
import { XyoArchivistApi } from '../Api';
|
|
3
|
-
export type XyoRemoteDivinerConfigSchema = 'network.xyo.diviner.remote.config';
|
|
4
|
-
export declare const XyoRemoteDivinerConfigSchema: XyoRemoteDivinerConfigSchema;
|
|
5
|
-
export type XyoRemoteDivinerConfig = DivinerConfig & {
|
|
6
|
-
/** @deprecated use in params instead */
|
|
7
|
-
api?: XyoArchivistApi;
|
|
8
|
-
archive?: string;
|
|
9
|
-
schema: XyoRemoteDivinerConfigSchema;
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=XyoRemoteDivinerConfig.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"XyoRemoteDivinerConfig.d.ts","sourceRoot":"","sources":["../../../src/Diviner/XyoRemoteDivinerConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAExC,MAAM,MAAM,4BAA4B,GAAG,mCAAmC,CAAA;AAC9E,eAAO,MAAM,4BAA4B,EAAE,4BAAkE,CAAA;AAE7G,MAAM,MAAM,sBAAsB,GAAG,aAAa,GAAG;IACnD,wCAAwC;IACxC,GAAG,CAAC,EAAE,eAAe,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,4BAA4B,CAAA;CACrC,CAAA"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { DivinerConfig } from '@xyo-network/diviner-model'
|
|
2
|
-
|
|
3
|
-
import { XyoArchivistApi } from '../Api'
|
|
4
|
-
|
|
5
|
-
export type XyoRemoteDivinerConfigSchema = 'network.xyo.diviner.remote.config'
|
|
6
|
-
export const XyoRemoteDivinerConfigSchema: XyoRemoteDivinerConfigSchema = 'network.xyo.diviner.remote.config'
|
|
7
|
-
|
|
8
|
-
export type XyoRemoteDivinerConfig = DivinerConfig & {
|
|
9
|
-
/** @deprecated use in params instead */
|
|
10
|
-
api?: XyoArchivistApi
|
|
11
|
-
archive?: string
|
|
12
|
-
schema: XyoRemoteDivinerConfigSchema
|
|
13
|
-
}
|