@dative-gpi/foundation-core-services 0.0.149 → 0.0.150
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/composables/services/index.ts +1 -1
- package/composables/services/useServiceAccountAuthTokens.ts +19 -0
- package/config/urls/index.ts +1 -1
- package/config/urls/serviceAccountAuthTokens.ts +5 -0
- package/package.json +3 -3
- package/composables/services/useAuthTokens.ts +0 -13
- package/config/urls/authTokens.ts +0 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "./useActions";
|
|
2
2
|
export * from "./useAlerts";
|
|
3
3
|
export * from "./useArticles";
|
|
4
|
-
export * from "./
|
|
4
|
+
export * from "./useServiceAccountAuthTokens";
|
|
5
5
|
export * from "./useChartCategories";
|
|
6
6
|
export * from "./useChartOrganisationTypes";
|
|
7
7
|
export * from "./useChartOrganisations";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ServiceAccountAuthTokenDetails, ServiceAccountAuthTokenDetailsDTO, ServiceAccountAuthTokenFilters, ServiceAccountAuthTokenInfos, ServiceAccountAuthTokenInfosDTO, CreateServiceAccountAuthTokenDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
+
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
3
|
+
|
|
4
|
+
import { SERVICE_ACCOUNT_AUTH_TOKENS_URL, SERVICE_ACCOUNT_AUTH_TOKEN_URL } from "../../config/urls";
|
|
5
|
+
|
|
6
|
+
const ServiceAccountAuthTokenServiceFactory = new ServiceFactory<ServiceAccountAuthTokenDetailsDTO, ServiceAccountAuthTokenDetails>("serviceAccountAuthToken", ServiceAccountAuthTokenDetails).create(factory => factory.build(
|
|
7
|
+
ServiceFactory.addCustom("getMany", (axios, serviceAccountId: string, filters: ServiceAccountAuthTokenFilters) => axios.get(SERVICE_ACCOUNT_AUTH_TOKENS_URL(serviceAccountId), filters), (dtos: ServiceAccountAuthTokenDetailsDTO[]) => dtos.map((dto: ServiceAccountAuthTokenDetailsDTO) => new ServiceAccountAuthTokenDetails(dto))),
|
|
8
|
+
factory.addNotify(notifyService => ({
|
|
9
|
+
...ServiceFactory.addCustom("create", (axios, serviceAccountId: string, data: CreateServiceAccountAuthTokenDTO) => axios.post(SERVICE_ACCOUNT_AUTH_TOKENS_URL(serviceAccountId), data), (dto: ServiceAccountAuthTokenDetailsDTO) => {
|
|
10
|
+
const result = new ServiceAccountAuthTokenDetails(dto);
|
|
11
|
+
notifyService.notify("add", result);
|
|
12
|
+
}),
|
|
13
|
+
...ServiceFactory.addCustom("remove", (axios, serviceAccountId: string, authTokenId: string) => axios.delete(SERVICE_ACCOUNT_AUTH_TOKEN_URL(serviceAccountId, authTokenId)), () => {})
|
|
14
|
+
}))
|
|
15
|
+
));
|
|
16
|
+
|
|
17
|
+
export const useServiceAccountAuthTokens = ComposableFactory.custom(ServiceAccountAuthTokenServiceFactory.getMany);
|
|
18
|
+
export const useCreateServiceAccountAuthToken = ComposableFactory.custom(ServiceAccountAuthTokenServiceFactory.create);
|
|
19
|
+
export const useRemoveServiceAccountAuthToken = ComposableFactory.custom(ServiceAccountAuthTokenServiceFactory.remove);
|
package/config/urls/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "./actions";
|
|
2
2
|
export * from "./alerts";
|
|
3
3
|
export * from "./articles";
|
|
4
|
-
export * from "./
|
|
4
|
+
export * from "./serviceAccountAuthTokens";
|
|
5
5
|
export * from "./charts";
|
|
6
6
|
export * from "./chartCategories";
|
|
7
7
|
export * from "./chartOrganisations";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SERVICE_ACCOUNT_URL } from "./serviceAccounts";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export const SERVICE_ACCOUNT_AUTH_TOKENS_URL = (serviceAccountId: string) => `${SERVICE_ACCOUNT_URL(serviceAccountId)}/pats`;
|
|
5
|
+
export const SERVICE_ACCOUNT_AUTH_TOKEN_URL = (serviceAccountId: string, authTokenId: string) => `${SERVICE_ACCOUNT_AUTH_TOKENS_URL(serviceAccountId)}/${encodeURIComponent(authTokenId)}`;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-core-services",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.150",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@dative-gpi/bones-ui": "^0.0.74",
|
|
14
|
-
"@dative-gpi/foundation-core-domain": "0.0.
|
|
14
|
+
"@dative-gpi/foundation-core-domain": "0.0.150",
|
|
15
15
|
"@microsoft/signalr": "^8.0.0",
|
|
16
16
|
"vue": "^3.4.23",
|
|
17
17
|
"vue-router": "^4.2.5"
|
|
18
18
|
},
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "72eab513b6316bf5c8f573c7faff46ace455090d"
|
|
20
20
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { AuthTokenDetails, AuthTokenDetailsDTO, AuthTokenFilters, AuthTokenInfos, AuthTokenInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
2
|
-
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
|
|
3
|
-
|
|
4
|
-
import { AUTH_TOKENS_URL, AUTH_TOKEN_URL } from "../../config/urls";
|
|
5
|
-
|
|
6
|
-
const AuthTokenServiceFactory = new ServiceFactory<AuthTokenDetailsDTO, AuthTokenDetails>("authToken", AuthTokenDetails).create(factory => factory.build(
|
|
7
|
-
factory.addGetMany<AuthTokenInfosDTO, AuthTokenInfos, AuthTokenFilters>(AUTH_TOKENS_URL, AuthTokenInfos),
|
|
8
|
-
factory.addRemove(AUTH_TOKEN_URL),
|
|
9
|
-
factory.addNotify()
|
|
10
|
-
));
|
|
11
|
-
|
|
12
|
-
export const useAuthTokens = ComposableFactory.getMany(AuthTokenServiceFactory);
|
|
13
|
-
export const useRemoveAuthToken = ComposableFactory.remove(AuthTokenServiceFactory);
|