Skip to content

Commit

Permalink
fix: explicitely allow all parts to be exported (#483)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: this removes common js support
from the lib. As such, to use it, you will need to migrate
to dynamic imports in async functions.

BREAKING CHANGE: this allows all files in the
package to be imported. But it also requires you
to use the full path now: 
import {} from "@zitadel/node/dist/api/index.js".
  • Loading branch information
buehler authored Nov 8, 2024
1 parent 1570e5d commit be05291
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 1,009 deletions.
4 changes: 2 additions & 2 deletions examples/access-api-with-pat.commonjs.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const { createAccessTokenInterceptor, createAuthClient } = require('@zitadel/node/api');

const apiEndpoint = 'https://zitadel-libraries-l8boqa.zitadel.cloud';
const personalAccessToken = 'Dp6uT84aVTqYLSMpk-H1-B3SPuqFms-Tz77cgWKlyrY3JxsZcDmb7kZoRK2ixaVNfuqmXfE';

async function main() {
const { createAccessTokenInterceptor, createAuthClient } = await import('@zitadel/node/dist/api/index.js');

const client = createAuthClient(apiEndpoint, createAccessTokenInterceptor(personalAccessToken));
const response = await client.getMyUser({});

Expand Down
2 changes: 1 addition & 1 deletion examples/access-api-with-pat.esm.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createAccessTokenInterceptor, createAuthClient } from '@zitadel/node/api';
import { createAccessTokenInterceptor, createAuthClient } from '@zitadel/node/dist/api/index.js';

const apiEndpoint = 'https://zitadel-libraries-l8boqa.zitadel.cloud';
const personalAccessToken = 'Dp6uT84aVTqYLSMpk-H1-B3SPuqFms-Tz77cgWKlyrY3JxsZcDmb7kZoRK2ixaVNfuqmXfE';
Expand Down
50 changes: 24 additions & 26 deletions examples/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit be05291

Please sign in to comment.