@equinor/fusion-framework-module-services
Advanced tools
Comparing version 0.5.6 to 0.5.7
@@ -6,2 +6,6 @@ # Change Log | ||
## 0.5.7 (2022-11-18) | ||
**Note:** Version bump only for package @equinor/fusion-framework-module-services | ||
## 0.5.6 (2022-11-14) | ||
@@ -8,0 +12,0 @@ |
@@ -5,2 +5,5 @@ import { ApiVersion } from '@equinor/fusion-framework-module-services/context'; | ||
export class ContextApiClient { | ||
get Version() { | ||
return ApiVersion; | ||
} | ||
constructor(_client, _method) { | ||
@@ -10,5 +13,2 @@ this._client = _client; | ||
} | ||
get Version() { | ||
return ApiVersion; | ||
} | ||
get(version, ...args) { | ||
@@ -15,0 +15,0 @@ const fn = getContext(this._client, version, this._method); |
@@ -1,3 +0,3 @@ | ||
export declare type DeleteBookmarksArgsV1 = { | ||
export type DeleteBookmarksArgsV1 = { | ||
id: string; | ||
}; |
@@ -5,7 +5,7 @@ import { IHttpClient } from '@equinor/fusion-framework-module-http'; | ||
import { DeleteBookmarksArgsV1 } from './types-v1'; | ||
export declare type DeleteBookmarkResult<TVersion extends ApiVersions> = DeleteBookmarksVersions[TVersion]['result']; | ||
export declare type DeleteBookmarkArgs<TVersion extends ApiVersions> = DeleteBookmarksVersions[TVersion]['args']; | ||
export declare type DeleteBookmarksResult<TVersion extends ApiVersions, TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TResult = DeleteBookmarkResult<TVersion>> = ClientMethod<TResult>[TMethod]; | ||
export declare type DeleteBookmarksFn<TVersion extends ApiVersions, TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TClient extends IHttpClient = IHttpClient, TResult = DeleteBookmarkResult<TVersion>> = (args: DeleteBookmarkArgs<TVersion>, init?: ClientRequestInit<TClient, TResult>) => DeleteBookmarksResult<TVersion, TMethod, TResult>; | ||
export declare type DeleteBookmarksVersions = { | ||
export type DeleteBookmarkResult<TVersion extends ApiVersions> = DeleteBookmarksVersions[TVersion]['result']; | ||
export type DeleteBookmarkArgs<TVersion extends ApiVersions> = DeleteBookmarksVersions[TVersion]['args']; | ||
export type DeleteBookmarksResult<TVersion extends ApiVersions, TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TResult = DeleteBookmarkResult<TVersion>> = ClientMethod<TResult>[TMethod]; | ||
export type DeleteBookmarksFn<TVersion extends ApiVersions, TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TClient extends IHttpClient = IHttpClient, TResult = DeleteBookmarkResult<TVersion>> = (args: DeleteBookmarkArgs<TVersion>, init?: ClientRequestInit<TClient, TResult>) => DeleteBookmarksResult<TVersion, TMethod, TResult>; | ||
export type DeleteBookmarksVersions = { | ||
['v1']: { | ||
@@ -16,2 +16,2 @@ args: DeleteBookmarksArgsV1; | ||
}; | ||
export declare type ApiVersions = keyof DeleteBookmarksVersions; | ||
export type ApiVersions = keyof DeleteBookmarksVersions; |
@@ -5,10 +5,10 @@ import { IHttpClient } from '@equinor/fusion-framework-module-http'; | ||
import { ApiBookmarkEntityV1 } from '../api-models'; | ||
export declare type GetBookmarkResult<TVersion extends ApiVersions, TPayload> = GetBookmarksVersions<TPayload>[TVersion]['result']; | ||
export declare type GetBookmarkArgs<TVersion extends ApiVersions> = GetBookmarksVersions[TVersion]['args']; | ||
export declare type GetBookmarksResult<TVersion extends ApiVersions, TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TPayload = unknown, TResult = GetBookmarkResult<TVersion, TPayload>> = ClientMethod<TResult>[TMethod]; | ||
export declare type GetBookmarksFn<TVersion extends ApiVersions, TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TClient extends IHttpClient = IHttpClient, TPayload = unknown, TResult = GetBookmarkResult<TVersion, TPayload>> = (args: GetBookmarkArgs<TVersion>, init?: ClientRequestInit<TClient, TResult>) => GetBookmarksResult<TVersion, TMethod, TPayload, TResult>; | ||
declare type GetBookmarksArgsV1 = { | ||
export type GetBookmarkResult<TVersion extends ApiVersions, TPayload> = GetBookmarksVersions<TPayload>[TVersion]['result']; | ||
export type GetBookmarkArgs<TVersion extends ApiVersions> = GetBookmarksVersions[TVersion]['args']; | ||
export type GetBookmarksResult<TVersion extends ApiVersions, TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TPayload = unknown, TResult = GetBookmarkResult<TVersion, TPayload>> = ClientMethod<TResult>[TMethod]; | ||
export type GetBookmarksFn<TVersion extends ApiVersions, TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TClient extends IHttpClient = IHttpClient, TPayload = unknown, TResult = GetBookmarkResult<TVersion, TPayload>> = (args: GetBookmarkArgs<TVersion>, init?: ClientRequestInit<TClient, TResult>) => GetBookmarksResult<TVersion, TMethod, TPayload, TResult>; | ||
type GetBookmarksArgsV1 = { | ||
id: string; | ||
}; | ||
export declare type GetBookmarksVersions<TPayload = unknown> = { | ||
export type GetBookmarksVersions<TPayload = unknown> = { | ||
['v1']: { | ||
@@ -19,3 +19,3 @@ args: GetBookmarksArgsV1; | ||
}; | ||
export declare type ApiVersions = keyof GetBookmarksVersions<unknown>; | ||
export type ApiVersions = keyof GetBookmarksVersions<unknown>; | ||
export {}; |
@@ -5,7 +5,7 @@ import { IHttpClient } from '@equinor/fusion-framework-module-http'; | ||
import { ApiBookmarkEntityV1 } from '../api-models'; | ||
export declare type PostBookmarkResult<TVersion extends ApiVersions, TPayload> = PostBookmarksVersions<TPayload>[TVersion]['result']; | ||
export declare type PostBookmarkArgs<TVersion extends ApiVersions, TPayload = unknown> = PostBookmarksVersions<TPayload>[TVersion]['args']; | ||
export declare type PostBookmarksResult<TVersion extends ApiVersions, TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TPayload = unknown, TResult = PostBookmarkResult<TVersion, TPayload>> = ClientMethod<TResult>[TMethod]; | ||
export declare type PostBookmarkFn<TVersion extends ApiVersions, TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TClient extends IHttpClient = IHttpClient, TPayload = unknown, TResult = PostBookmarkResult<TVersion, TPayload>> = (args: PostBookmarkArgs<TVersion>, init?: ClientRequestInit<TClient, TResult>) => PostBookmarksResult<TVersion, TMethod, TPayload, TResult>; | ||
declare type PostBookmarksArgsV1<T = unknown> = { | ||
export type PostBookmarkResult<TVersion extends ApiVersions, TPayload> = PostBookmarksVersions<TPayload>[TVersion]['result']; | ||
export type PostBookmarkArgs<TVersion extends ApiVersions, TPayload = unknown> = PostBookmarksVersions<TPayload>[TVersion]['args']; | ||
export type PostBookmarksResult<TVersion extends ApiVersions, TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TPayload = unknown, TResult = PostBookmarkResult<TVersion, TPayload>> = ClientMethod<TResult>[TMethod]; | ||
export type PostBookmarkFn<TVersion extends ApiVersions, TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TClient extends IHttpClient = IHttpClient, TPayload = unknown, TResult = PostBookmarkResult<TVersion, TPayload>> = (args: PostBookmarkArgs<TVersion>, init?: ClientRequestInit<TClient, TResult>) => PostBookmarksResult<TVersion, TMethod, TPayload, TResult>; | ||
type PostBookmarksArgsV1<T = unknown> = { | ||
name: string; | ||
@@ -23,3 +23,3 @@ description?: string; | ||
}; | ||
export declare type PostBookmarksVersions<TPayload = unknown> = { | ||
export type PostBookmarksVersions<TPayload = unknown> = { | ||
['v1']: { | ||
@@ -30,3 +30,3 @@ args: PostBookmarksArgsV1<TPayload>; | ||
}; | ||
export declare type ApiVersions = keyof PostBookmarksVersions<unknown>; | ||
export type ApiVersions = keyof PostBookmarksVersions<unknown>; | ||
export {}; |
import { ApiVersion } from './static'; | ||
declare type ApiContextEntity_v1 = { | ||
type ApiContextEntity_v1 = { | ||
id: string; | ||
@@ -14,9 +14,9 @@ externalId: string | null; | ||
}; | ||
declare type ApiContextEntity_v2 = unknown; | ||
declare type ApiContextEntityTypes = { | ||
type ApiContextEntity_v2 = unknown; | ||
type ApiContextEntityTypes = { | ||
[ApiVersion.v1]: ApiContextEntity_v1; | ||
[ApiVersion.v2]: ApiContextEntity_v2; | ||
}; | ||
export declare type ApiContextEntity<T extends string = ApiVersion> = T extends ApiVersion ? ApiContextEntityTypes[T] : unknown; | ||
declare type ApiContextType_v1 = { | ||
export type ApiContextEntity<T extends string = ApiVersion> = T extends ApiVersion ? ApiContextEntityTypes[T] : unknown; | ||
type ApiContextType_v1 = { | ||
id: string; | ||
@@ -26,8 +26,8 @@ isChildType: boolean; | ||
}; | ||
declare type ApiContextType_v2 = unknown; | ||
declare type ApiContextTypeTypes = { | ||
type ApiContextType_v2 = unknown; | ||
type ApiContextTypeTypes = { | ||
[ApiVersion.v1]: ApiContextType_v1; | ||
[ApiVersion.v2]: ApiContextType_v2; | ||
}; | ||
export declare type ApiContextType<T extends ApiVersion> = ApiContextTypeTypes[T]; | ||
export type ApiContextType<T extends ApiVersion> = ApiContextTypeTypes[T]; | ||
export {}; |
import { IHttpClient, ClientRequestInit } from '@equinor/fusion-framework-module-http/client'; | ||
import { ApiVersion, ApiContextEntity, ClientMethod } from '@equinor/fusion-framework-module-services/context'; | ||
export { ApiClientArguments, ClientMethod, } from '@equinor/fusion-framework-module-services/context'; | ||
declare type GetContextArgs_v1 = { | ||
type GetContextArgs_v1 = { | ||
id: string; | ||
}; | ||
declare type GetContextArgs_v2 = GetContextArgs_v1; | ||
declare type GetContextArgsTypes = { | ||
type GetContextArgs_v2 = GetContextArgs_v1; | ||
type GetContextArgsTypes = { | ||
[ApiVersion.v1]: GetContextArgs_v1; | ||
[ApiVersion.v2]: GetContextArgs_v2; | ||
}; | ||
export declare type GetContextArgs<T extends string> = T extends keyof typeof ApiVersion ? GetContextArgsTypes[typeof ApiVersion[T]] : unknown; | ||
declare type GetContextResponseTypes = { | ||
export type GetContextArgs<T extends string> = T extends keyof typeof ApiVersion ? GetContextArgsTypes[typeof ApiVersion[T]] : unknown; | ||
type GetContextResponseTypes = { | ||
[ApiVersion.v1]: ApiContextEntity<ApiVersion.v1>; | ||
[ApiVersion.v2]: ApiContextEntity<ApiVersion.v2>; | ||
}; | ||
export declare type GetContextResponse<T> = T extends keyof typeof ApiVersion ? GetContextResponseTypes[typeof ApiVersion[T]] : unknown; | ||
export declare type GetContextFn<TVersion extends string = keyof typeof ApiVersion, TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TClient extends IHttpClient = IHttpClient, TResult = GetContextResponse<TVersion>> = (args: GetContextArgs<TVersion>, init?: ClientRequestInit<TClient, TResult>) => GetContextResult<TVersion, TMethod, TResult>; | ||
export declare type GetContextResult<TVersion extends string = keyof typeof ApiVersion, TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TResult = GetContextResponse<TVersion>> = ClientMethod<TResult>[TMethod]; | ||
export type GetContextResponse<T> = T extends keyof typeof ApiVersion ? GetContextResponseTypes[typeof ApiVersion[T]] : unknown; | ||
export type GetContextFn<TVersion extends string = keyof typeof ApiVersion, TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TClient extends IHttpClient = IHttpClient, TResult = GetContextResponse<TVersion>> = (args: GetContextArgs<TVersion>, init?: ClientRequestInit<TClient, TResult>) => GetContextResult<TVersion, TMethod, TResult>; | ||
export type GetContextResult<TVersion extends string = keyof typeof ApiVersion, TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TResult = GetContextResponse<TVersion>> = ClientMethod<TResult>[TMethod]; |
import { IHttpClient, ClientRequestInit } from '@equinor/fusion-framework-module-http/client'; | ||
import { ApiVersion, ApiContextEntity, ClientMethod } from '@equinor/fusion-framework-module-services/context'; | ||
export { ApiClientArguments, ClientMethod, } from '@equinor/fusion-framework-module-services/context'; | ||
export declare type QueryContextOdataFilter = { | ||
export type QueryContextOdataFilter = { | ||
type?: string[]; | ||
externalId?: string; | ||
}; | ||
export declare type QueryContextOdataParameters = { | ||
export type QueryContextOdataParameters = { | ||
search?: string; | ||
filter?: QueryContextOdataFilter; | ||
}; | ||
declare type QueryContextArgs_v1 = { | ||
type QueryContextArgs_v1 = { | ||
query: string | QueryContextOdataParameters; | ||
includeDeleted?: boolean; | ||
}; | ||
declare type QueryContextArgs_v2 = QueryContextArgs_v1; | ||
declare type SearchContextArgTypes = { | ||
type QueryContextArgs_v2 = QueryContextArgs_v1; | ||
type SearchContextArgTypes = { | ||
[ApiVersion.v1]: QueryContextArgs_v1; | ||
[ApiVersion.v2]: QueryContextArgs_v2; | ||
}; | ||
export declare type QueryContextArgs<T> = T extends keyof typeof ApiVersion ? SearchContextArgTypes[typeof ApiVersion[T]] : { | ||
export type QueryContextArgs<T> = T extends keyof typeof ApiVersion ? SearchContextArgTypes[typeof ApiVersion[T]] : { | ||
query: { | ||
@@ -26,8 +26,8 @@ search: string; | ||
}; | ||
declare type QueryContextResponseTypes = { | ||
type QueryContextResponseTypes = { | ||
[ApiVersion.v1]: Array<ApiContextEntity<ApiVersion.v1>>; | ||
[ApiVersion.v2]: Array<ApiContextEntity<ApiVersion.v2>>; | ||
}; | ||
export declare type QueryContextResponse<T> = T extends keyof typeof ApiVersion ? QueryContextResponseTypes[typeof ApiVersion[T]] : unknown; | ||
export declare type QueryContextFn<TVersion extends string = keyof typeof ApiVersion, TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TClient extends IHttpClient = IHttpClient, TResult = QueryContextResponse<TVersion>> = (args: QueryContextArgs<TVersion>, init?: ClientRequestInit<TClient, TResult>) => QueryContextResult<TVersion, TMethod, TResult>; | ||
export declare type QueryContextResult<TVersion extends string = keyof typeof ApiVersion, TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TResult = QueryContextResponse<TVersion>> = ClientMethod<TResult>[TMethod]; | ||
export type QueryContextResponse<T> = T extends keyof typeof ApiVersion ? QueryContextResponseTypes[typeof ApiVersion[T]] : unknown; | ||
export type QueryContextFn<TVersion extends string = keyof typeof ApiVersion, TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TClient extends IHttpClient = IHttpClient, TResult = QueryContextResponse<TVersion>> = (args: QueryContextArgs<TVersion>, init?: ClientRequestInit<TClient, TResult>) => QueryContextResult<TVersion, TMethod, TResult>; | ||
export type QueryContextResult<TVersion extends string = keyof typeof ApiVersion, TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TResult = QueryContextResponse<TVersion>> = ClientMethod<TResult>[TMethod]; |
@@ -6,5 +6,5 @@ import type { IModuleConfigurator, IModulesConfigurator, Module } from '@equinor/fusion-framework-module'; | ||
import { IApiProvider } from './provider'; | ||
export declare type ServicesModuleKey = 'services'; | ||
export type ServicesModuleKey = 'services'; | ||
export declare const moduleKey: ServicesModuleKey; | ||
export declare type ServicesModule = Module<ServicesModuleKey, IApiProvider, IApiConfigurator, [ | ||
export type ServicesModule = Module<ServicesModuleKey, IApiProvider, IApiConfigurator, [ | ||
HttpModule, | ||
@@ -11,0 +11,0 @@ ServiceDiscoveryModule |
@@ -10,3 +10,3 @@ import { IHttpClient } from '@equinor/fusion-framework-module-http'; | ||
} | ||
declare type ApiProviderCtorArgs<TClient extends IHttpClient = IHttpClient> = { | ||
type ApiProviderCtorArgs<TClient extends IHttpClient = IHttpClient> = { | ||
createClient: ApiClientFactory<TClient>; | ||
@@ -13,0 +13,0 @@ }; |
import { ClientRequestInit, IHttpClient, FetchResponse, StreamResponse } from '@equinor/fusion-framework-module-http/client'; | ||
export declare type ApiClientFactory<TClient extends IHttpClient = IHttpClient> = (name: string) => Promise<TClient>; | ||
export declare type ApiClientArguments<TClient extends IHttpClient, TResult = unknown> = [ | ||
export type ApiClientFactory<TClient extends IHttpClient = IHttpClient> = (name: string) => Promise<TClient>; | ||
export type ApiClientArguments<TClient extends IHttpClient, TResult = unknown> = [ | ||
path: string, | ||
init?: ClientRequestInit<TClient, TResult> | ||
]; | ||
export declare type ClientMethod<T = unknown> = { | ||
export type ClientMethod<T = unknown> = { | ||
fetch: Promise<FetchResponse<T>>; | ||
@@ -13,2 +13,2 @@ json: Promise<T>; | ||
}; | ||
export declare type ClientMethodType = keyof ClientMethod; | ||
export type ClientMethodType = keyof ClientMethod; |
{ | ||
"name": "@equinor/fusion-framework-module-services", | ||
"version": "0.5.6", | ||
"version": "0.5.7", | ||
"description": "", | ||
@@ -51,4 +51,4 @@ "sideEffects": false, | ||
"@equinor/fusion-framework-module": "^1.2.9", | ||
"@equinor/fusion-framework-module-http": "^2.1.4", | ||
"@equinor/fusion-framework-module-service-discovery": "^3.1.1" | ||
"@equinor/fusion-framework-module-http": "^2.1.5", | ||
"@equinor/fusion-framework-module-service-discovery": "^3.1.2" | ||
}, | ||
@@ -59,3 +59,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "98a8a5c6f02ac739adda41bb26f43e3255d450bb" | ||
"gitHead": "08348a63143c1fc0d62fd75e81271ffc2cab9be4" | ||
} |
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
211144