@ctx-core/auth0-management 9.1.101 → 9.1.102

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @ctx-core/auth0-management
2
2
 
3
+ ## 9.1.102
4
+
5
+ ### Patch Changes
6
+
7
+ - import*meta_env*() instead of process.env
8
+ - Updated dependencies
9
+ - Updated dependencies
10
+ - Updated dependencies
11
+ - Updated dependencies
12
+ - @ctx-core/auth0@37.0.0
13
+ - @ctx-core/env@17.2.18
14
+
3
15
  ## 9.1.101
4
16
 
5
17
  ### Patch Changes
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ import { import_meta_env_ } from '@ctx-core/env'
2
3
  import { ctx_ } from '@ctx-core/object'
3
4
  import { auth0__v2_client_grants__fetch_get, auth0__v2__url_ } from '../src/index.js'
4
5
  await main()
@@ -6,7 +7,7 @@ async function main() {
6
7
  const ctx = ctx_()
7
8
  const [json] = await auth0__v2_client_grants__fetch_get(ctx, {
8
9
  json: {
9
- client_id: process.env.AUTH0_CLIENT_ID,
10
+ client_id: import_meta_env_().AUTH0_CLIENT_ID,
10
11
  audience: auth0__v2__url_(ctx)
11
12
  }
12
13
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ctx-core/auth0-management",
3
- "version": "9.1.101",
3
+ "version": "9.1.102",
4
4
  "description": "ctx-core auth0 management api",
5
5
  "keywords": [
6
6
  "ctx-core",
@@ -28,7 +28,8 @@
28
28
  "getAll-client-grants-auth0": "./bin/getAll-client-grants-auth0.mjs"
29
29
  },
30
30
  "dependencies": {
31
- "@ctx-core/auth0": "^36.7.22",
31
+ "@ctx-core/auth0": "^37.0.0",
32
+ "@ctx-core/env": "^17.2.18",
32
33
  "@ctx-core/fetch-undici": "^2.3.114",
33
34
  "@ctx-core/object": "^26.0.0",
34
35
  "@ctx-core/uri": "^12.1.10",
@@ -1,4 +1,5 @@
1
1
  import { header__access_token__verify, AUTH0_DOMAIN__ } from '@ctx-core/auth0'
2
+ import { import_meta_env_ } from '@ctx-core/env'
2
3
  import { fetch } from '@ctx-core/fetch-undici'
3
4
  import { auth0_management__token_ } from '../auth0_management__token_/index.js'
4
5
  /** @typedef {import('auth0').Client}Client */
@@ -8,7 +9,7 @@ import { auth0_management__token_ } from '../auth0_management__token_/index.js'
8
9
  * @return {Promise<[Client, Response]>}
9
10
  */
10
11
  export async function auth0__v2_client__fetch_get(ctx, params) {
11
- const { client_id = process.env.AUTH0_CLIENT_ID, body, json, } = params
12
+ const { client_id = import_meta_env_().AUTH0_CLIENT_ID, body, json, } = params
12
13
  const auth0_management__token = await auth0_management__token_(ctx)
13
14
  const authorization = header__access_token__verify(auth0_management__token)
14
15
  const url = `https://${AUTH0_DOMAIN__(ctx).$}/api/v2/clients/${client_id}`
@@ -1,12 +1,13 @@
1
+ import { import_meta_env_ } from '@ctx-core/env'
1
2
  import { ManagementClient } from 'auth0'
2
3
  /**
3
4
  * @param {import('./auth0_management_.d.ts').auth0_management__params_T} params
4
5
  * @returns {import('auth0').ManagementClient}
5
6
  */
6
7
  export function auth0_management_(params = {}) {
7
- const domain = params.domain || process.env.AUTH0_DOMAIN || ''
8
- const clientId = params.clientId || process.env.AUTH0_MANAGEMENT_ID || ''
9
- const clientSecret = params.clientSecret || process.env.AUTH0_MANAGEMENT_SECRET || ''
8
+ const domain = params.domain || import_meta_env_().AUTH0_DOMAIN || ''
9
+ const clientId = params.clientId || import_meta_env_().AUTH0_MANAGEMENT_ID || ''
10
+ const clientSecret = params.clientSecret || import_meta_env_().AUTH0_MANAGEMENT_SECRET || ''
10
11
  const scope = ''
11
12
  return new ManagementClient({
12
13
  domain,
@@ -1,4 +1,5 @@
1
1
  import { auth0__v2__url_ } from '@ctx-core/auth0'
2
+ import { import_meta_env_ } from '@ctx-core/env'
2
3
  /**
3
4
  * @param {import('@ctx-core/object').Ctx}ctx
4
5
  * @return {import('@ctx-core/auth0').auth0__oauth_token__fetch__body_T}
@@ -6,8 +7,8 @@ import { auth0__v2__url_ } from '@ctx-core/auth0'
6
7
  export function auth0_management__client_credentials__body_(ctx) {
7
8
  return {
8
9
  grant_type: 'client_credentials',
9
- client_id: process.env.AUTH0_MANAGEMENT_ID,
10
- client_secret: process.env.AUTH0_MANAGEMENT_SECRET,
10
+ client_id: import_meta_env_().AUTH0_MANAGEMENT_ID,
11
+ client_secret: import_meta_env_().AUTH0_MANAGEMENT_SECRET,
11
12
  audience: auth0__v2__url_(ctx)
12
13
  }
13
14
  }