@ctx-core/auth0-management 9.0.0 → 9.0.4
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/CHANGELOG.md +26 -0
- package/package.json +4 -4
- package/src/auth0_audience_.js +0 -1
- package/src/auth0_management_.d.ts +4 -4
- package/src/get_auth0_v2_client_grants.d.ts +2 -2
- package/src/get_auth0_v2_client_grants.js +2 -2
- package/src/get_auth0_v2_user.d.ts +2 -2
- package/src/get_auth0_v2_user.js +2 -2
- package/src/get_auth0_v2_users_by_email.d.ts +3 -3
- package/src/get_auth0_v2_users_by_email.js +2 -2
- package/src/patch_auth0_v2_client.d.ts +3 -3
- package/src/patch_auth0_v2_client.js +2 -2
- package/src/patch_auth0_v2_user.d.ts +1 -1
- package/src/patch_auth0_v2_user.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @ctx-core/auth0-management
|
|
2
2
|
|
|
3
|
+
## 9.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- update dependencies
|
|
8
|
+
|
|
9
|
+
## 9.0.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- auth0: ^2.38.1 -> ^2.39.0
|
|
14
|
+
|
|
15
|
+
## 9.0.2
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- update dependencies
|
|
20
|
+
|
|
21
|
+
## 9.0.1
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- update dependencies
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
- @ctx-core/fetch-undici@1.1.3
|
|
28
|
+
|
|
3
29
|
## 9.0.0
|
|
4
30
|
|
|
5
31
|
### Major Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctx-core/auth0-management",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.4",
|
|
4
4
|
"description": "ctx-core auth0 management api",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ctx-core",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"getAll-client-grants-auth0": "./bin/getAll-client-grants-auth0.mjs"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@ctx-core/auth0": "^30.0.
|
|
34
|
-
"@ctx-core/fetch-undici": "^1.1.
|
|
33
|
+
"@ctx-core/auth0": "^30.0.3",
|
|
34
|
+
"@ctx-core/fetch-undici": "^1.1.3",
|
|
35
35
|
"@ctx-core/object": "^22.0.13",
|
|
36
36
|
"@ctx-core/uri": "^12.0.38",
|
|
37
|
-
"auth0": "^2.
|
|
37
|
+
"auth0": "^2.39.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/auth0": "^2.34.11",
|
package/src/auth0_audience_.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ManagementClient } from 'auth0'
|
|
2
2
|
export declare function auth0_management_(
|
|
3
3
|
params?:auth0_management_params_I
|
|
4
|
-
):ManagementClient<import('auth0').AppMetadata, import('auth0').UserMetadata
|
|
4
|
+
):ManagementClient<import('auth0').AppMetadata, import('auth0').UserMetadata>
|
|
5
5
|
export interface auth0_management_params_I {
|
|
6
|
-
domain?:string
|
|
7
|
-
clientId?:string
|
|
8
|
-
clientSecret?:string
|
|
6
|
+
domain?:string
|
|
7
|
+
clientId?:string
|
|
8
|
+
clientSecret?:string
|
|
9
9
|
}
|
|
@@ -5,6 +5,6 @@ export declare function get_auth0_v2_client_grants(
|
|
|
5
5
|
ctx:Ctx, params:get_auth0_v2_client_grants_params_T
|
|
6
6
|
):Promise<[CreateClientGrant, Response]>
|
|
7
7
|
export interface get_auth0_v2_client_grants_params_T {
|
|
8
|
-
query?:string
|
|
9
|
-
json?:any
|
|
8
|
+
query?:string
|
|
9
|
+
json?:any
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { verify_access_token_header_authorization, AUTH0_DOMAIN$_ } from '@ctx-core/auth0'
|
|
2
2
|
import { fetch } from '@ctx-core/fetch-undici'
|
|
3
3
|
import { query_str_ } from '@ctx-core/uri'
|
|
4
4
|
import { auth0_management_token_ } from './auth0_management_token_.js'
|
|
@@ -11,7 +11,7 @@ import { auth0_management_token_ } from './auth0_management_token_.js'
|
|
|
11
11
|
export async function get_auth0_v2_client_grants(ctx, params) {
|
|
12
12
|
const { query, json } = params
|
|
13
13
|
const auth0_token = await auth0_management_token_(ctx)
|
|
14
|
-
const authorization =
|
|
14
|
+
const authorization = verify_access_token_header_authorization(auth0_token)
|
|
15
15
|
const url = `https://${AUTH0_DOMAIN$_(ctx).$}/api/v2/client-grants?${query || query_str_(json)}`
|
|
16
16
|
const res = await fetch(url, {
|
|
17
17
|
method: 'GET',
|
package/src/get_auth0_v2_user.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { verify_access_token_header_authorization } from '@ctx-core/auth0'
|
|
2
2
|
import { fetch } from '@ctx-core/fetch-undici'
|
|
3
3
|
import { auth0_management_token_ } from './auth0_management_token_.js'
|
|
4
4
|
/** @typedef {import('auth0').User}User */
|
|
@@ -10,7 +10,7 @@ import { auth0_management_token_ } from './auth0_management_token_.js'
|
|
|
10
10
|
export async function get_auth0_v2_user(ctx, params) {
|
|
11
11
|
const { AUTH0_DOMAIN, user_id } = params
|
|
12
12
|
const auth0_token = await auth0_management_token_(ctx)
|
|
13
|
-
const authorization =
|
|
13
|
+
const authorization = verify_access_token_header_authorization(auth0_token)
|
|
14
14
|
const url = `https://${AUTH0_DOMAIN}/api/v2/users/${user_id}`
|
|
15
15
|
const res = await fetch(url, {
|
|
16
16
|
method: 'GET',
|
|
@@ -5,6 +5,6 @@ export declare function get_auth0_v2_users_by_email(
|
|
|
5
5
|
ctx:Ctx, params:get_auth0_v2_users_by_email_params_T
|
|
6
6
|
):Promise<[Auth0UserProfile[], Response]>
|
|
7
7
|
export declare type get_auth0_v2_users_by_email_params_T = {
|
|
8
|
-
email:string
|
|
9
|
-
AUTH0_DOMAIN?:string
|
|
10
|
-
}
|
|
8
|
+
email:string
|
|
9
|
+
AUTH0_DOMAIN?:string
|
|
10
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { verify_access_token_header_authorization, AUTH0_DOMAIN$_ } from '@ctx-core/auth0'
|
|
2
2
|
import { fetch } from '@ctx-core/fetch-undici'
|
|
3
3
|
import { auth0_management_token_ } from './auth0_management_token_.js'
|
|
4
4
|
/** @type {import('auth0-js').Auth0UserProfile}Auth0UserProfile */
|
|
@@ -11,7 +11,7 @@ export async function get_auth0_v2_users_by_email(ctx, params) {
|
|
|
11
11
|
const { email } = params
|
|
12
12
|
const AUTH0_DOMAIN = params.AUTH0_DOMAIN || AUTH0_DOMAIN$_(ctx).$
|
|
13
13
|
const auth0_token = await auth0_management_token_(ctx)
|
|
14
|
-
const authorization =
|
|
14
|
+
const authorization = verify_access_token_header_authorization(auth0_token)
|
|
15
15
|
const url = `https://${AUTH0_DOMAIN}/api/v2/users-by-email?email=${encodeURIComponent(email)}`
|
|
16
16
|
const res = await fetch(url, {
|
|
17
17
|
method: 'GET',
|
|
@@ -5,7 +5,7 @@ export declare function patch_auth0_v2_client(
|
|
|
5
5
|
ctx:Ctx, params:patch_auth0_v2_client_params_T
|
|
6
6
|
):Promise<[Client, Response]>
|
|
7
7
|
export interface patch_auth0_v2_client_params_T {
|
|
8
|
-
client_id?:string
|
|
9
|
-
body?:string
|
|
10
|
-
json?:unknown
|
|
8
|
+
client_id?:string
|
|
9
|
+
body?:string
|
|
10
|
+
json?:unknown
|
|
11
11
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { verify_access_token_header_authorization, AUTH0_DOMAIN$_ } from '@ctx-core/auth0'
|
|
2
2
|
import { fetch } from '@ctx-core/fetch-undici'
|
|
3
3
|
import { auth0_management_token_ } from './auth0_management_token_.js'
|
|
4
4
|
/** @typedef {import('auth0').Client}Client */
|
|
@@ -10,7 +10,7 @@ import { auth0_management_token_ } from './auth0_management_token_.js'
|
|
|
10
10
|
export async function patch_auth0_v2_client(ctx, params) {
|
|
11
11
|
const { client_id = process.env.AUTH0_CLIENT_ID, body, json, } = params
|
|
12
12
|
const auth0_token = await auth0_management_token_(ctx)
|
|
13
|
-
const authorization =
|
|
13
|
+
const authorization = verify_access_token_header_authorization(auth0_token)
|
|
14
14
|
const url = `https://${AUTH0_DOMAIN$_(ctx).$}/api/v2/clients/${client_id}`
|
|
15
15
|
const res = await fetch(url, {
|
|
16
16
|
method: 'PATCH',
|
|
@@ -6,5 +6,5 @@ export declare function patch_auth0_v2_user(
|
|
|
6
6
|
ctx:Ctx, user_id:string, data:patch_auth0_v2_user_data_T
|
|
7
7
|
):Promise<[UpdateUserData|Auth0Error, Response]>
|
|
8
8
|
export interface patch_auth0_v2_user_data_T extends Partial<UserData> {
|
|
9
|
-
password?:string
|
|
9
|
+
password?:string
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { verify_access_token_header_authorization, AUTH0_DOMAIN$_ } from '@ctx-core/auth0'
|
|
2
2
|
import { fetch } from '@ctx-core/fetch-undici'
|
|
3
3
|
import { auth0_management_token_ } from './auth0_management_token_.js'
|
|
4
4
|
/** @typedef {import('auth0').UpdateUserData}UpdateUserData */
|
|
@@ -18,7 +18,7 @@ export async function patch_auth0_v2_user(
|
|
|
18
18
|
ctx, user_id, data
|
|
19
19
|
) {
|
|
20
20
|
const auth0_management_token = await auth0_management_token_(ctx)
|
|
21
|
-
const authorization =
|
|
21
|
+
const authorization = verify_access_token_header_authorization(auth0_management_token)
|
|
22
22
|
const url = `https://${AUTH0_DOMAIN$_(ctx).$}/api/v2/users/${user_id}`
|
|
23
23
|
const res = await fetch(url, {
|
|
24
24
|
method: 'PATCH',
|