@xyo-network/api 2.61.1 → 2.61.2

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 (74) hide show
  1. package/dist/cjs/Api/Api.js +4 -4
  2. package/dist/cjs/Api/Api.js.map +1 -1
  3. package/dist/cjs/Base.js +8 -8
  4. package/dist/cjs/Base.js.map +1 -1
  5. package/dist/cjs/Diviner/LocationDiviner/LocationDivinerApi.js +3 -3
  6. package/dist/cjs/Diviner/LocationDiviner/LocationDivinerApi.js.map +1 -1
  7. package/dist/cjs/Diviner/LocationDiviner/index.js +0 -1
  8. package/dist/cjs/Diviner/LocationDiviner/index.js.map +1 -1
  9. package/dist/cjs/Diviner/RemoteDivinerConfig.js +5 -0
  10. package/dist/cjs/Diviner/RemoteDivinerConfig.js.map +1 -0
  11. package/dist/cjs/Diviner/index.js +1 -1
  12. package/dist/cjs/Diviner/index.js.map +1 -1
  13. package/dist/cjs/Simple.js +3 -3
  14. package/dist/cjs/Simple.js.map +1 -1
  15. package/dist/docs.json +1918 -2043
  16. package/dist/esm/Api/Api.js +3 -3
  17. package/dist/esm/Api/Api.js.map +1 -1
  18. package/dist/esm/Base.js +6 -6
  19. package/dist/esm/Base.js.map +1 -1
  20. package/dist/esm/Diviner/LocationDiviner/LocationDivinerApi.js +2 -2
  21. package/dist/esm/Diviner/LocationDiviner/LocationDivinerApi.js.map +1 -1
  22. package/dist/esm/Diviner/LocationDiviner/index.js +0 -1
  23. package/dist/esm/Diviner/LocationDiviner/index.js.map +1 -1
  24. package/dist/esm/Diviner/RemoteDivinerConfig.js +2 -0
  25. package/dist/esm/Diviner/RemoteDivinerConfig.js.map +1 -0
  26. package/dist/esm/Diviner/index.js +1 -1
  27. package/dist/esm/Diviner/index.js.map +1 -1
  28. package/dist/esm/Simple.js +2 -2
  29. package/dist/esm/Simple.js.map +1 -1
  30. package/dist/types/Api/Api.d.ts +5 -5
  31. package/dist/types/Api/Api.d.ts.map +1 -1
  32. package/dist/types/Base.d.ts +19 -19
  33. package/dist/types/Base.d.ts.map +1 -1
  34. package/dist/types/Diviner/LocationDiviner/LocationDivinerApi.d.ts +3 -3
  35. package/dist/types/Diviner/LocationDiviner/LocationDivinerApi.d.ts.map +1 -1
  36. package/dist/types/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.ts +3 -3
  37. package/dist/types/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.d.ts.map +1 -1
  38. package/dist/types/Diviner/LocationDiviner/index.d.ts +0 -1
  39. package/dist/types/Diviner/LocationDiviner/index.d.ts.map +1 -1
  40. package/dist/types/Diviner/RemoteDivinerConfig.d.ts +11 -0
  41. package/dist/types/Diviner/RemoteDivinerConfig.d.ts.map +1 -0
  42. package/dist/types/Diviner/index.d.ts +1 -1
  43. package/dist/types/Diviner/index.d.ts.map +1 -1
  44. package/dist/types/Simple.d.ts +19 -19
  45. package/dist/types/Simple.d.ts.map +1 -1
  46. package/dist/types/WithArchive.d.ts +1 -1
  47. package/dist/types/WithArchive.d.ts.map +1 -1
  48. package/dist/types/models/ArchivePath.d.ts +1 -1
  49. package/dist/types/models/ArchivePath.d.ts.map +1 -1
  50. package/package.json +8 -8
  51. package/src/Api/Api.ts +4 -4
  52. package/src/Base.ts +46 -50
  53. package/src/Diviner/LocationDiviner/LocationDivinerApi.ts +3 -3
  54. package/src/Diviner/LocationDiviner/Queries/LocationQueryCreationRequest.ts +3 -3
  55. package/src/Diviner/LocationDiviner/index.ts +0 -1
  56. package/src/Diviner/RemoteDivinerConfig.ts +13 -0
  57. package/src/Diviner/index.ts +1 -1
  58. package/src/Simple.ts +24 -29
  59. package/src/WithArchive.ts +1 -1
  60. package/src/models/ArchivePath.ts +1 -1
  61. package/dist/cjs/Diviner/LocationDiviner/ApiConfig.js +0 -3
  62. package/dist/cjs/Diviner/LocationDiviner/ApiConfig.js.map +0 -1
  63. package/dist/cjs/Diviner/XyoRemoteDivinerConfig.js +0 -5
  64. package/dist/cjs/Diviner/XyoRemoteDivinerConfig.js.map +0 -1
  65. package/dist/esm/Diviner/LocationDiviner/ApiConfig.js +0 -2
  66. package/dist/esm/Diviner/LocationDiviner/ApiConfig.js.map +0 -1
  67. package/dist/esm/Diviner/XyoRemoteDivinerConfig.js +0 -2
  68. package/dist/esm/Diviner/XyoRemoteDivinerConfig.js.map +0 -1
  69. package/dist/types/Diviner/LocationDiviner/ApiConfig.d.ts +0 -7
  70. package/dist/types/Diviner/LocationDiviner/ApiConfig.d.ts.map +0 -1
  71. package/dist/types/Diviner/XyoRemoteDivinerConfig.d.ts +0 -11
  72. package/dist/types/Diviner/XyoRemoteDivinerConfig.d.ts.map +0 -1
  73. package/src/Diviner/LocationDiviner/ApiConfig.ts +0 -6
  74. package/src/Diviner/XyoRemoteDivinerConfig.ts +0 -13
package/src/Base.ts CHANGED
@@ -1,17 +1,17 @@
1
1
  import {
2
- XyoApiConfig,
3
- XyoApiEnvelope,
4
- XyoApiError,
5
- XyoApiReportable,
6
- XyoApiResponse,
7
- XyoApiResponseBody,
8
- XyoApiResponseTuple,
9
- XyoApiResponseTupleOrBody,
10
- XyoApiResponseType,
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 XyoApiBase<C extends XyoApiConfig = XyoApiConfig> implements XyoApiReportable {
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?: XyoApiResponse<XyoApiEnvelope<T>>) {
47
- return [result?.data?.data, result?.data, result] as XyoApiResponseTuple<T>
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: XyoApiResponse<XyoApiEnvelope<T>> | undefined, responseType?: XyoApiResponseType) {
51
- const resolvedResponse = XyoApiBase.resolveResponse(response)
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: XyoApiError, depth = 0) {
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: XyoApiResponse, depth = 0) {
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: XyoApiResponse, depth = 0) {
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<XyoApiResponseBody<T>>
71
- protected async deleteEndpoint<T = unknown>(endPoint?: string, responseType?: 'body'): Promise<XyoApiResponseBody<T>>
72
- protected async deleteEndpoint<T = unknown>(endPoint?: string, responseType?: 'tuple'): Promise<XyoApiResponseTuple<T>>
73
- protected async deleteEndpoint<T = unknown>(endPoint = '', responseType?: XyoApiResponseType): Promise<XyoApiResponseTupleOrBody<T>> {
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<XyoApiEnvelope<T>, XyoApiResponse<XyoApiEnvelope<T>>>(`${this.resolveRoot()}${endPoint}${this.query}`)
75
+ return await this.axios.delete<ApiEnvelope<T>, ApiResponse<ApiEnvelope<T>>>(`${this.resolveRoot()}${endPoint}${this.query}`)
76
76
  })
77
- return XyoApiBase.shapeResponse<T>(response, responseType)
77
+ return ApiBase.shapeResponse<T>(response, responseType)
78
78
  }
79
79
 
80
- protected async getEndpoint<T = unknown>(endPoint?: string): Promise<XyoApiResponseBody<T>>
81
- protected async getEndpoint<T = unknown>(endPoint?: string, responseType?: 'body'): Promise<XyoApiResponseBody<T>>
82
- protected async getEndpoint<T = unknown>(endPoint?: string, responseType?: 'tuple'): Promise<XyoApiResponseTuple<T>>
83
- protected async getEndpoint<T = unknown>(endPoint = '', responseType?: XyoApiResponseType): Promise<XyoApiResponseTupleOrBody<T>> {
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<XyoApiEnvelope<T>, XyoApiResponse<XyoApiEnvelope<T>>>(`${this.resolveRoot()}${endPoint}${this.query}`)
85
+ return await this.axios.get<ApiEnvelope<T>, ApiResponse<ApiEnvelope<T>>>(`${this.resolveRoot()}${endPoint}${this.query}`)
86
86
  })
87
- return XyoApiBase.shapeResponse<T>(response, responseType)
87
+ return ApiBase.shapeResponse<T>(response, responseType)
88
88
  }
89
89
 
90
- protected handleMonitorResponseError<T>(error: XyoApiError, trapAxiosException: boolean) {
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 XyoApiResponse<XyoApiEnvelope<T>>
100
+ return error.response as ApiResponse<ApiEnvelope<T>>
101
101
  }
102
102
  }
103
103
 
104
- protected async monitorResponse<T>(closure: () => Promise<XyoApiResponse<XyoApiEnvelope<T>>>) {
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 XyoApiError, trapAxiosException)
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<XyoApiResponseBody<T>>
120
- protected async postEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'body'): Promise<XyoApiResponseBody<T>>
121
- protected async postEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'tuple'): Promise<XyoApiResponseTuple<T>>
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?: XyoApiResponseType,
126
- ): Promise<XyoApiResponseTupleOrBody<T>> {
125
+ responseType?: ApiResponseType,
126
+ ): Promise<ApiResponseTupleOrBody<T>> {
127
127
  const response = await this.monitorResponse<T>(async () => {
128
- return await this.axios.post<XyoApiEnvelope<T>, XyoApiResponse<XyoApiEnvelope<T>, D>, D>(`${this.resolveRoot()}${endPoint}${this.query}`, data)
128
+ return await this.axios.post<ApiEnvelope<T>, ApiResponse<ApiEnvelope<T>, D>, D>(`${this.resolveRoot()}${endPoint}${this.query}`, data)
129
129
  })
130
- return XyoApiBase.shapeResponse<T>(response, responseType)
130
+ return ApiBase.shapeResponse<T>(response, responseType)
131
131
  }
132
132
 
133
- protected async putEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D): Promise<XyoApiResponseBody<T>>
134
- protected async putEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'body'): Promise<XyoApiResponseBody<T>>
135
- protected async putEndpoint<T = unknown, D = unknown>(endPoint?: string, data?: D, responseType?: 'tuple'): Promise<XyoApiResponseTuple<T>>
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<XyoApiEnvelope<T>, XyoApiResponse<XyoApiEnvelope<T>, D>, D>(`${this.resolveRoot()}${endPoint}${this.query}`, data)
138
+ return await this.axios.put<ApiEnvelope<T>, ApiResponse<ApiEnvelope<T>, D>, D>(`${this.resolveRoot()}${endPoint}${this.query}`, data)
143
139
  })
144
- return XyoApiBase.shapeResponse<T>(response, responseType)
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 XyoLocationDivinerApi {
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 { XyoLocationDivinerApi }
29
+ export { LocationDivinerApi }
@@ -1,4 +1,4 @@
1
- import { XyoApiConfig } from '@xyo-network/api-models'
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: XyoApiConfig
14
+ resultArchivist: ApiConfig
15
15
  schema: TSchema
16
16
  sourceArchive: string
17
- sourceArchivist: XyoApiConfig
17
+ sourceArchivist: ApiConfig
18
18
  }
19
19
 
20
20
  export type LocationTimeRangeQueryCreationRequest = LocationQueryCreationRequest<LocationTimeRangeQuerySchema, LocationTimeRangeQuery>
@@ -1,4 +1,3 @@
1
- export * from './ApiConfig'
2
1
  export * from './LocationDivinerApi'
3
2
  export * from './models'
4
3
  export * from './Queries'
@@ -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
+ }
@@ -1,2 +1,2 @@
1
1
  export * from './LocationDiviner'
2
- export * from './XyoRemoteDivinerConfig'
2
+ export * from './RemoteDivinerConfig'
package/src/Simple.ts CHANGED
@@ -1,21 +1,16 @@
1
- import { XyoApiConfig, XyoApiResponseBody, XyoApiResponseTuple, XyoApiResponseTupleOrBody, XyoApiResponseType } from '@xyo-network/api-models'
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 { XyoApiBase } from './Base'
4
+ import { ApiBase } from './Base'
5
5
  import { objToQuery } from './objToQuery'
6
6
 
7
- export type XyoApiSimpleQuery = PayloadFindFilter
7
+ export type ApiSimpleQuery = PayloadFindFilter
8
8
 
9
- export class XyoApiSimple<
10
- T = Payload,
11
- D = T,
12
- Q extends XyoApiSimpleQuery = XyoApiSimpleQuery,
13
- C extends XyoApiConfig = XyoApiConfig,
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<XyoApiResponseBody<T>>
28
- async find(query?: Q, responseType?: 'body'): Promise<XyoApiResponseBody<T>>
29
- async find(query?: Q, responseType?: 'tuple'): Promise<XyoApiResponseTuple<T>>
30
- async find(query = {}, responseType?: XyoApiResponseType): Promise<XyoApiResponseTupleOrBody<T>> {
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<XyoApiResponseBody<T>>
40
- async get(responseType?: 'body'): Promise<XyoApiResponseBody<T>>
41
- async get(responseType?: 'tuple'): Promise<XyoApiResponseTuple<T>>
42
- async get(responseType?: XyoApiResponseType): Promise<XyoApiResponseTupleOrBody<T>> {
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<XyoApiResponseBody<T>>
52
- async post(data?: D, responseType?: 'body'): Promise<XyoApiResponseBody<T>>
53
- async post(data?: D, responseType?: 'tuple'): Promise<XyoApiResponseTuple<T>>
54
- async post(data?: D, responseType?: XyoApiResponseType): Promise<XyoApiResponseTupleOrBody<T>> {
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<XyoApiResponseBody<T>>
64
- async put(data?: D, responseType?: 'body'): Promise<XyoApiResponseBody<T>>
65
- async put(data?: D, responseType?: 'tuple'): Promise<XyoApiResponseTuple<T>>
66
- async put(data?: D, responseType?: XyoApiResponseType): Promise<XyoApiResponseTupleOrBody<T>> {
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')
@@ -1,3 +1,3 @@
1
- export declare type WithArchive<XyoArchivistApiConfig> = XyoArchivistApiConfig & {
1
+ export declare type WithArchive<ArchivistApiConfig> = ArchivistApiConfig & {
2
2
  _archive?: string
3
3
  }
@@ -1,3 +1,3 @@
1
- export interface XyoArchivePath {
1
+ export interface ArchivePath {
2
2
  archive: string
3
3
  }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ApiConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ApiConfig.js","sourceRoot":"","sources":["../../../../src/Diviner/LocationDiviner/ApiConfig.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.XyoRemoteDivinerConfigSchema = void 0;
4
- exports.XyoRemoteDivinerConfigSchema = 'network.xyo.diviner.remote.config';
5
- //# sourceMappingURL=XyoRemoteDivinerConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"XyoRemoteDivinerConfig.js","sourceRoot":"","sources":["../../../src/Diviner/XyoRemoteDivinerConfig.ts"],"names":[],"mappings":";;;AAKa,QAAA,4BAA4B,GAAiC,mCAAmC,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=ApiConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ApiConfig.js","sourceRoot":"","sources":["../../../../src/Diviner/LocationDiviner/ApiConfig.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export const XyoRemoteDivinerConfigSchema = 'network.xyo.diviner.remote.config';
2
- //# sourceMappingURL=XyoRemoteDivinerConfig.js.map
@@ -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,7 +0,0 @@
1
- export interface ApiConfig {
2
- apiDomain: string;
3
- apiKey?: string;
4
- jwtToken?: string;
5
- userid?: string;
6
- }
7
- //# sourceMappingURL=ApiConfig.d.ts.map
@@ -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,6 +0,0 @@
1
- export interface ApiConfig {
2
- apiDomain: string
3
- apiKey?: string
4
- jwtToken?: string
5
- userid?: string
6
- }
@@ -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
- }