@axinom/mosaic-id-link-be 0.13.4-rc.3 → 0.13.4-rc.31
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/dev/dev-create-service-account.d.ts.map +1 -1
- package/dist/dev/dev-create-service-account.js +23 -35
- package/dist/dev/dev-create-service-account.js.map +1 -1
- package/dist/generated/graphql.types.d.ts +2151 -2147
- package/dist/generated/graphql.types.d.ts.map +1 -1
- package/dist/generated/graphql.types.js +230 -226
- package/dist/generated/graphql.types.js.map +1 -1
- package/dist/long-lived-token/index.d.ts.map +1 -1
- package/dist/long-lived-token/index.js +26 -38
- package/dist/long-lived-token/index.js.map +1 -1
- package/dist/service-account-token/index.d.ts.map +1 -1
- package/dist/service-account-token/index.js +82 -110
- package/dist/service-account-token/index.js.map +1 -1
- package/dist/well-known-endpoints/index.d.ts.map +1 -1
- package/dist/well-known-endpoints/index.js +3 -38
- package/dist/well-known-endpoints/index.js.map +1 -1
- package/package.json +6 -6
- package/src/dev/dev-create-service-account.ts +33 -49
- package/src/generated/graphql.types.ts +2349 -2345
- package/src/long-lived-token/index.ts +38 -54
- package/src/service-account-token/index.ts +120 -147
- package/src/well-known-endpoints/index.ts +3 -35
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
assertError,
|
|
3
|
-
Logger,
|
|
4
|
-
skipMaskTag,
|
|
5
|
-
} from '@axinom/mosaic-service-common';
|
|
6
1
|
import { getGqlClient } from '../common/gql-client';
|
|
7
2
|
import {
|
|
8
3
|
DevCreateServiceAccountDocument,
|
|
@@ -36,54 +31,43 @@ export const devCreateServiceAccount = async (
|
|
|
36
31
|
permissions?: string[];
|
|
37
32
|
}[],
|
|
38
33
|
): Promise<DevServiceAccount> => {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
'Bearer token-not-needed-for-DEV-endpoints',
|
|
44
|
-
);
|
|
34
|
+
const client = getGqlClient(
|
|
35
|
+
(await getWellKnownEndpoints(authEndpoint)).authGraphQlEndpoint,
|
|
36
|
+
'Bearer token-not-needed-for-DEV-endpoints',
|
|
37
|
+
);
|
|
45
38
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
},
|
|
39
|
+
const result = await client.mutate<
|
|
40
|
+
DevCreateServiceAccountMutation,
|
|
41
|
+
DevCreateServiceAccountMutationVariables
|
|
42
|
+
>({
|
|
43
|
+
mutation: DevCreateServiceAccountDocument,
|
|
44
|
+
variables: {
|
|
45
|
+
input: {
|
|
46
|
+
serviceAccountName,
|
|
47
|
+
tenantId,
|
|
48
|
+
environmentId: environmentId,
|
|
49
|
+
permissionStructure: permissions,
|
|
58
50
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
if (!result.errors) {
|
|
64
|
-
if (result.data?._DEV_createServiceAccount) {
|
|
65
|
-
return result.data._DEV_createServiceAccount;
|
|
66
|
-
}
|
|
67
|
-
throw new Error(
|
|
68
|
-
`Unexpected null or undefined value received for '_DEV_createServiceAccount' result.`,
|
|
69
|
-
);
|
|
70
|
-
} else {
|
|
71
|
-
const aggregatedErrorMessage = result.errors?.reduce(
|
|
72
|
-
(aggregatedError, gqlError) => {
|
|
73
|
-
return (aggregatedError += gqlError.message);
|
|
74
|
-
},
|
|
75
|
-
'',
|
|
76
|
-
);
|
|
51
|
+
},
|
|
52
|
+
errorPolicy: 'all',
|
|
53
|
+
fetchPolicy: 'no-cache',
|
|
54
|
+
});
|
|
77
55
|
|
|
78
|
-
|
|
56
|
+
if (!result.errors) {
|
|
57
|
+
if (result.data?._DEV_createServiceAccount) {
|
|
58
|
+
return result.data._DEV_createServiceAccount;
|
|
79
59
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
60
|
+
throw new Error(
|
|
61
|
+
`Unexpected null or undefined value received for '_DEV_createServiceAccount' result.`,
|
|
62
|
+
);
|
|
63
|
+
} else {
|
|
64
|
+
const aggregatedErrorMessage = result.errors.reduce(
|
|
65
|
+
(aggregatedError, gqlError) => {
|
|
66
|
+
return (aggregatedError += gqlError.message);
|
|
67
|
+
},
|
|
68
|
+
'',
|
|
69
|
+
);
|
|
86
70
|
|
|
87
|
-
throw
|
|
71
|
+
throw new Error(aggregatedErrorMessage);
|
|
88
72
|
}
|
|
89
73
|
};
|