@ctx-core/auth0-management 9.7.167 → 9.8.2
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/auth0__user/index.test.ts +49 -0
- package/{src/auth0__v2_client__GET__fetch → auth0__v2_client__GET__fetch}/index.js +2 -2
- package/{src/auth0__v2_client_grants__GET__fetch → auth0__v2_client_grants__GET__fetch}/index.js +2 -2
- package/{src/auth0__v2_user__GET__fetch → auth0__v2_user__GET__fetch}/index.js +2 -2
- package/auth0__v2_user__GET__fetch/index.test.ts +105 -0
- package/{src/auth0__v2_user__PATCH__fetch → auth0__v2_user__PATCH__fetch}/index.d.ts +1 -1
- package/{src/auth0__v2_user__PATCH__fetch → auth0__v2_user__PATCH__fetch}/index.js +2 -4
- package/{src/auth0__v2_users_by_email__GET__fetch → auth0__v2_users_by_email__GET__fetch}/index.d.ts +1 -2
- package/{src/auth0__v2_users_by_email__GET__fetch → auth0__v2_users_by_email__GET__fetch}/index.js +1 -1
- package/{src/auth0__v2_users_by_email__GET__fetch → auth0__v2_users_by_email__GET__fetch}/index.test.ts +31 -31
- package/{src/auth0_management__new → auth0_management__new}/index.js +1 -1
- package/{src/auth0_management__token__new → auth0_management__token__new}/index.test.ts +20 -20
- package/bin/add-grant-password-auth0.mjs +1 -1
- package/bin/auth0.mjs +1 -1
- package/bin/getAll-client-grants-auth0.mjs +1 -1
- package/package.json +27 -12
- package/.ideaexclude +0 -2
- package/CHANGELOG.md +0 -9929
- package/COMMIT_EDITMSG +0 -2
- package/src/auth0__user/index.test.ts +0 -49
- package/src/auth0__v2_user__GET__fetch/index.test.ts +0 -108
- package/src/index.d.ts +0 -12
- package/tsconfig.json +0 -16
- /package/{src/AUTH0_MANAGEMENT_ID → AUTH0_MANAGEMENT_ID}/index.d.ts +0 -0
- /package/{src/AUTH0_MANAGEMENT_ID → AUTH0_MANAGEMENT_ID}/index.js +0 -0
- /package/{src/AUTH0_MANAGEMENT_SECRET → AUTH0_MANAGEMENT_SECRET}/index.d.ts +0 -0
- /package/{src/AUTH0_MANAGEMENT_SECRET → AUTH0_MANAGEMENT_SECRET}/index.js +0 -0
- /package/{src/auth0__user → auth0__user}/index.d.ts +0 -0
- /package/{src/auth0__user → auth0__user}/index.js +0 -0
- /package/{src/auth0__v2_client__GET__fetch → auth0__v2_client__GET__fetch}/index.d.ts +0 -0
- /package/{src/auth0__v2_client_grants__GET__fetch → auth0__v2_client_grants__GET__fetch}/index.d.ts +0 -0
- /package/{src/auth0__v2_user__GET__fetch → auth0__v2_user__GET__fetch}/index.d.ts +0 -0
- /package/{src/auth0_management__client_credentials__body__new → auth0_management__client_credentials__body__new}/index.d.ts +0 -0
- /package/{src/auth0_management__client_credentials__body__new → auth0_management__client_credentials__body__new}/index.js +0 -0
- /package/{src/auth0_management__init → auth0_management__init}/index.d.ts +0 -0
- /package/{src/auth0_management__init → auth0_management__init}/index.js +0 -0
- /package/{src/auth0_management__new → auth0_management__new}/index.d.ts +0 -0
- /package/{src/auth0_management__token__new → auth0_management__token__new}/index.d.ts +0 -0
- /package/{src/auth0_management__token__new → auth0_management__token__new}/index.js +0 -0
- /package/{src/index.js → index.d.ts} +0 -0
package/COMMIT_EDITMSG
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { ctx__new } from '@ctx-core/object'
|
|
2
|
-
import { UserProfile } from 'auth0'
|
|
3
|
-
import { test } from 'uvu'
|
|
4
|
-
import { equal } from 'uvu/assert'
|
|
5
|
-
import { auth0__user$_, auth0__user_, auth0__user__set } from '../index.js'
|
|
6
|
-
test('auth0__user', ()=>{
|
|
7
|
-
const ctx = ctx__new()
|
|
8
|
-
const auth0__user = auth0__user__new()
|
|
9
|
-
equal(auth0__user$_(ctx).$, undefined)
|
|
10
|
-
equal(auth0__user_(ctx), undefined)
|
|
11
|
-
auth0__user__set(ctx, auth0__user)
|
|
12
|
-
equal(auth0__user$_(ctx).$, auth0__user)
|
|
13
|
-
equal(auth0__user_(ctx), auth0__user)
|
|
14
|
-
})
|
|
15
|
-
test.run()
|
|
16
|
-
function auth0__user__new() {
|
|
17
|
-
return {
|
|
18
|
-
"user_id": "auth0|507f1f77bcf86cd799439020",
|
|
19
|
-
"email": "john.doe@gmail.com",
|
|
20
|
-
"email_verified": false,
|
|
21
|
-
"username": "johndoe",
|
|
22
|
-
"phone_number": "+199999999999999",
|
|
23
|
-
"phone_verified": false,
|
|
24
|
-
"created_at": "",
|
|
25
|
-
"updated_at": "",
|
|
26
|
-
"identities": [
|
|
27
|
-
{
|
|
28
|
-
"connection": "Initial-Connection",
|
|
29
|
-
"user_id": "507f1f77bcf86cd799439020",
|
|
30
|
-
"provider": "auth0",
|
|
31
|
-
"isSocial": false
|
|
32
|
-
}
|
|
33
|
-
],
|
|
34
|
-
"app_metadata": {},
|
|
35
|
-
"user_metadata": {},
|
|
36
|
-
"picture": "",
|
|
37
|
-
"name": "",
|
|
38
|
-
"nickname": "",
|
|
39
|
-
"multifactor": [
|
|
40
|
-
""
|
|
41
|
-
],
|
|
42
|
-
"last_ip": "",
|
|
43
|
-
"last_login": "",
|
|
44
|
-
"logins_count": 0,
|
|
45
|
-
"blocked": false,
|
|
46
|
-
"given_name": "",
|
|
47
|
-
"family_name": ""
|
|
48
|
-
} as UserProfile
|
|
49
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import {AUTH0_DOMAIN__set} from '@ctx-core/auth0'
|
|
2
|
-
import {ctx__new} from '@ctx-core/object'
|
|
3
|
-
import {type UserProfile} from 'auth0'
|
|
4
|
-
import {restore, stub} from 'sinon'
|
|
5
|
-
import {test} from 'uvu'
|
|
6
|
-
import {equal} from 'uvu/assert'
|
|
7
|
-
import {auth0_management__init} from '../auth0_management__init/index.js'
|
|
8
|
-
import {auth0__v2_user__GET__fetch, auth0__v2_user__GET__fetch2} from './index.js'
|
|
9
|
-
|
|
10
|
-
test.after.each(() => restore())
|
|
11
|
-
test('auth0__v2_user__GET__fetch', async () => {
|
|
12
|
-
const ctx = ctx__new()
|
|
13
|
-
AUTH0_DOMAIN__set(ctx, 'myapp.auth0.com')
|
|
14
|
-
auth0_management__init(ctx, {
|
|
15
|
-
AUTH0_MANAGEMENT_ID: 'AUTH0_MANAGEMENT_ID',
|
|
16
|
-
AUTH0_MANAGEMENT_SECRET: 'AUTH0_MANAGEMENT_SECRET'
|
|
17
|
-
})
|
|
18
|
-
const auth0__user = auth0__user__new()
|
|
19
|
-
api_v2_user__stub(auth0__user)
|
|
20
|
-
const response = await auth0__v2_user__GET__fetch(ctx, {
|
|
21
|
-
user_id: '123'
|
|
22
|
-
})
|
|
23
|
-
equal(response.status, 200)
|
|
24
|
-
equal(await response.json(), auth0__user)
|
|
25
|
-
})
|
|
26
|
-
test('auth0__v2_user__GET__fetch2', async () => {
|
|
27
|
-
const ctx = ctx__new()
|
|
28
|
-
AUTH0_DOMAIN__set(ctx, 'myapp.auth0.com')
|
|
29
|
-
auth0_management__init(ctx, {
|
|
30
|
-
AUTH0_MANAGEMENT_ID: 'AUTH0_MANAGEMENT_ID',
|
|
31
|
-
AUTH0_MANAGEMENT_SECRET: 'AUTH0_MANAGEMENT_SECRET'
|
|
32
|
-
})
|
|
33
|
-
const test__auth0__user = auth0__user__new()
|
|
34
|
-
api_v2_user__stub(test__auth0__user)
|
|
35
|
-
const [auth0__user, response] =
|
|
36
|
-
await auth0__v2_user__GET__fetch2(ctx, {
|
|
37
|
-
user_id: '123'
|
|
38
|
-
})
|
|
39
|
-
equal(response.status, 200)
|
|
40
|
-
equal(auth0__user, test__auth0__user)
|
|
41
|
-
})
|
|
42
|
-
test.run()
|
|
43
|
-
|
|
44
|
-
function auth0__user__new() {
|
|
45
|
-
return {
|
|
46
|
-
'user_id': 'auth0|507f1f77bcf86cd799439020',
|
|
47
|
-
'email': 'john.doe@gmail.com',
|
|
48
|
-
'email_verified': false,
|
|
49
|
-
'username': 'johndoe',
|
|
50
|
-
'phone_number': '+199999999999999',
|
|
51
|
-
'phone_verified': false,
|
|
52
|
-
'created_at': '',
|
|
53
|
-
'updated_at': '',
|
|
54
|
-
'identities': [
|
|
55
|
-
{
|
|
56
|
-
'connection': 'Initial-Connection',
|
|
57
|
-
'user_id': '507f1f77bcf86cd799439020',
|
|
58
|
-
'provider': 'auth0',
|
|
59
|
-
'isSocial': false
|
|
60
|
-
}
|
|
61
|
-
],
|
|
62
|
-
'app_metadata': {},
|
|
63
|
-
'user_metadata': {},
|
|
64
|
-
'picture': '',
|
|
65
|
-
'name': '',
|
|
66
|
-
'nickname': '',
|
|
67
|
-
'multifactor': [
|
|
68
|
-
''
|
|
69
|
-
],
|
|
70
|
-
'last_ip': '',
|
|
71
|
-
'last_login': '',
|
|
72
|
-
'logins_count': 0,
|
|
73
|
-
'blocked': false,
|
|
74
|
-
'given_name': '',
|
|
75
|
-
'family_name': ''
|
|
76
|
-
} as UserProfile
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function api_v2_user__stub(auth0__user: UserProfile) {
|
|
80
|
-
const fetch = stub(globalThis, 'fetch')
|
|
81
|
-
fetch
|
|
82
|
-
.withArgs('https://myapp.auth0.com/oauth/token', {
|
|
83
|
-
method: 'POST',
|
|
84
|
-
headers: {'Content-Type': 'application/json'},
|
|
85
|
-
body: JSON.stringify({
|
|
86
|
-
grant_type: 'client_credentials',
|
|
87
|
-
client_id: 'AUTH0_MANAGEMENT_ID',
|
|
88
|
-
client_secret: 'AUTH0_MANAGEMENT_SECRET',
|
|
89
|
-
audience: 'https://myapp.auth0.com/api/v2/',
|
|
90
|
-
})
|
|
91
|
-
})
|
|
92
|
-
.resolves(new Response(JSON.stringify({
|
|
93
|
-
access_token: 'access_token',
|
|
94
|
-
token_type: 'Bearer',
|
|
95
|
-
}), {
|
|
96
|
-
status: 200,
|
|
97
|
-
headers: {
|
|
98
|
-
'Content-Type': 'application/json'
|
|
99
|
-
}
|
|
100
|
-
}))
|
|
101
|
-
fetch.withArgs('https://myapp.auth0.com/api/v2/users/123')
|
|
102
|
-
.resolves(new Response(JSON.stringify(auth0__user), {
|
|
103
|
-
status: 200,
|
|
104
|
-
headers: {
|
|
105
|
-
'Content-Type': 'application/json'
|
|
106
|
-
}
|
|
107
|
-
}))
|
|
108
|
-
}
|
package/src/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from './auth0__user'
|
|
2
|
-
export * from './auth0_management__new'
|
|
3
|
-
export * from './auth0_management__client_credentials__body__new'
|
|
4
|
-
export * from './auth0_management__init'
|
|
5
|
-
export * from './auth0_management__token__new'
|
|
6
|
-
export * from './auth0__v2_client_grants__GET__fetch'
|
|
7
|
-
export * from './auth0__v2_user__GET__fetch'
|
|
8
|
-
export * from './auth0__v2_users_by_email__GET__fetch'
|
|
9
|
-
export * from './auth0__v2_client__GET__fetch'
|
|
10
|
-
export * from './auth0__v2_user__PATCH__fetch'
|
|
11
|
-
export * from './AUTH0_MANAGEMENT_ID'
|
|
12
|
-
export * from './AUTH0_MANAGEMENT_SECRET'
|
package/tsconfig.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compileOnSave": true,
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"allowJs": true,
|
|
5
|
-
"allowSyntheticDefaultImports": true,
|
|
6
|
-
"lib": ["dom", "ESNext"],
|
|
7
|
-
"module": "esnext",
|
|
8
|
-
"moduleResolution": "node",
|
|
9
|
-
"resolveJsonModule": true,
|
|
10
|
-
"rootDir": "src",
|
|
11
|
-
"declaration": true,
|
|
12
|
-
"declarationDir": "src"
|
|
13
|
-
},
|
|
14
|
-
"include": ["src"],
|
|
15
|
-
"exclude": []
|
|
16
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{src/auth0__v2_client_grants__GET__fetch → auth0__v2_client_grants__GET__fetch}/index.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|