@equinor/fusion-framework-module-services
Advanced tools
Comparing version 2.3.1 to 2.5.0
@@ -6,2 +6,14 @@ # Change Log | ||
## 2.5.0 (2023-04-14) | ||
### Features | ||
- **module-services:** add api interface for resolving related context ([54a8d9f](https://github.com/equinor/fusion-framework/commit/54a8d9f1a34052abb0f2e9104c9395b0fc4c77c4)) | ||
## 2.4.0 (2023-04-14) | ||
### Features | ||
- **module-services:** add api interface for resolving related context ([54a8d9f](https://github.com/equinor/fusion-framework/commit/54a8d9f1a34052abb0f2e9104c9395b0fc4c77c4)) | ||
## 2.3.1 (2023-04-13) | ||
@@ -8,0 +20,0 @@ |
import { ApiVersion } from '@equinor/fusion-framework-module-services/context'; | ||
import { getContext } from './get'; | ||
import { queryContext } from './query'; | ||
import { relatedContexts, } from './related'; | ||
export class ContextApiClient { | ||
@@ -20,4 +21,8 @@ get Version() { | ||
} | ||
related(version, ...args) { | ||
const fn = relatedContexts(this._client, version, this._method); | ||
return fn(...args); | ||
} | ||
} | ||
export default ContextApiClient; | ||
//# sourceMappingURL=client.js.map |
@@ -5,2 +5,3 @@ import { IHttpClient } from '@equinor/fusion-framework-module-http'; | ||
import { QueryContextFn, QueryContextResponse, QueryContextResult } from './query'; | ||
import { RelatedContextFn, RelatedContextResponse, RelatedContextResult } from './related'; | ||
export declare class ContextApiClient<TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TClient extends IHttpClient = IHttpClient> { | ||
@@ -13,3 +14,4 @@ protected _client: TClient; | ||
query<TVersion extends string = keyof typeof ApiVersion, TResult = QueryContextResponse<TVersion>>(version: TVersion, ...args: Parameters<QueryContextFn<TVersion, TMethod, TClient, TResult>>): QueryContextResult<TVersion, TMethod, TResult>; | ||
related<TVersion extends string = keyof typeof ApiVersion, TResult = RelatedContextResponse<TVersion>>(version: TVersion, ...args: Parameters<RelatedContextFn<TVersion, TMethod, TClient, TResult>>): RelatedContextResult<TVersion, TMethod, TResult>; | ||
} | ||
export default ContextApiClient; |
{ | ||
"name": "@equinor/fusion-framework-module-services", | ||
"version": "2.3.1", | ||
"version": "2.5.0", | ||
"description": "", | ||
@@ -25,2 +25,5 @@ "sideEffects": false, | ||
], | ||
"context/related": [ | ||
"dist/types/context/related/index" | ||
], | ||
"bookmarks": [ | ||
@@ -67,3 +70,3 @@ "dist/types/bookmarks/index" | ||
}, | ||
"gitHead": "1dd3688d5ac207281d512fcb88fdb9409ad62748" | ||
"gitHead": "dd4ed92c8f1d020f3b537172b4fe7788aeae99e7" | ||
} |
@@ -6,4 +6,12 @@ import { IHttpClient } from '@equinor/fusion-framework-module-http'; | ||
import { getContext, GetContextFn, GetContextResponse, GetContextResult } from './get'; | ||
import { queryContext, QueryContextFn, QueryContextResponse, QueryContextResult } from './query'; | ||
import { | ||
RelatedContextFn, | ||
RelatedContextResponse, | ||
RelatedContextResult, | ||
relatedContexts, | ||
} from './related'; | ||
export class ContextApiClient< | ||
@@ -48,4 +56,19 @@ TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, | ||
} | ||
/** | ||
* Query context service | ||
* @see {@link query/client} | ||
*/ | ||
public related< | ||
TVersion extends string = keyof typeof ApiVersion, | ||
TResult = RelatedContextResponse<TVersion> | ||
>( | ||
version: TVersion, | ||
...args: Parameters<RelatedContextFn<TVersion, TMethod, TClient, TResult>> | ||
): RelatedContextResult<TVersion, TMethod, TResult> { | ||
const fn = relatedContexts<TVersion, TMethod, TClient>(this._client, version, this._method); | ||
return fn<TResult>(...args); | ||
} | ||
} | ||
export default ContextApiClient; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
432143
457
4750