@lark-apaas/db-schema-sync 0.1.5-alpha.2 → 0.1.5-alpha.3

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/bin.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  __toESM,
7
7
  generateSchema,
8
8
  resolveEnvOptions
9
- } from "./chunk-3545KFME.js";
9
+ } from "./chunk-QMZNL465.js";
10
10
 
11
11
  // node_modules/dotenv/package.json
12
12
  var require_package = __commonJS({
@@ -228,11 +228,11 @@ var require_dist = __commonJS({
228
228
  };
229
229
  }
230
230
  };
231
- var StaticJWTSource = class {
231
+ var StaticTokenSource = class {
232
232
  constructor(token) {
233
233
  this.token = token;
234
234
  if (!token) {
235
- throw new Error("StaticJWTSource: token \u4E0D\u80FD\u4E3A\u7A7A");
235
+ throw new Error("StaticTokenSource: token \u4E0D\u80FD\u4E3A\u7A7A");
236
236
  }
237
237
  }
238
238
  getToken(_claims) {
@@ -242,7 +242,7 @@ var require_dist = __commonJS({
242
242
  var DEFAULT_DOMAIN_ENV = "FORCE_AUTHN_INNERAPI_DOMAIN";
243
243
  var DEFAULT_ACCESS_KEY_ENV = "FORCE_AUTHN_ACCESS_KEY";
244
244
  var DEFAULT_SECRET_KEY_ENV = "FORCE_AUTHN_ACCESS_SECRET";
245
- var DEFAULT_JWT_ENV = "FORCE_AUTHN_JWT";
245
+ var DEFAULT_TOKEN_ENV = "FORCE_AUTHN_TOKEN";
246
246
  var DEFAULT_ADMIN_DOMAIN_ENV = "MIAODA_DEV_INNER_DOMAIN_WITH_PREFIX";
247
247
  var DEFAULT_CLIENT_TOKEN_ENV = "MIAODA_AUTHN_CODE";
248
248
  var MIAODA_CLIENT_TOKEN_HEADER = "X-Miaoda-Client-Token";
@@ -281,16 +281,16 @@ var require_dist = __commonJS({
281
281
  expireTimeMs,
282
282
  refreshBeforeMs: options.refreshBeforeMs
283
283
  });
284
- const jwtEnv = options.jwtEnv || DEFAULT_JWT_ENV;
285
- const platformJwt = options.jwt ?? (process.env[jwtEnv] || "");
286
- const staticJwtSource = platformJwt ? new StaticJWTSource(platformJwt) : null;
287
- if (!staticJwtSource && !secretKey) {
284
+ const tokenEnv = options.tokenEnv || DEFAULT_TOKEN_ENV;
285
+ const platformToken = options.token ?? (process.env[tokenEnv] || "");
286
+ const staticTokenSource = platformToken ? new StaticTokenSource(platformToken) : null;
287
+ if (!staticTokenSource && !secretKey) {
288
288
  throw new Error(
289
- `\u5E73\u53F0\u9274\u6743\u9700\u8981 jwt \u6216 secret key,\u8BF7\u8BBE\u7F6E\u73AF\u5883\u53D8\u91CF ${jwtEnv}(\u63A8\u8350) \u6216 ${secretKeyEnv}`
289
+ `\u5E73\u53F0\u9274\u6743\u9700\u8981 token \u6216 secret key,\u8BF7\u8BBE\u7F6E\u73AF\u5883\u53D8\u91CF ${tokenEnv}(\u63A8\u8350) \u6216 ${secretKeyEnv}`
290
290
  );
291
291
  }
292
- const primaryTokenSource = staticJwtSource ?? tokenManager;
293
- const fallbackTokenSource = staticJwtSource && secretKey ? tokenManager : null;
292
+ const primaryTokenSource = staticTokenSource ?? tokenManager;
293
+ const fallbackTokenSource = staticTokenSource && secretKey ? tokenManager : null;
294
294
  const clientTokenEnv = options.clientTokenEnv || DEFAULT_CLIENT_TOKEN_ENV;
295
295
  interceptors.request.use((config) => {
296
296
  ensureNoAccessKeyOverride("request.platformAuth.customClaims", config.platformAuth?.customClaims);
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  generateSchemaFromData,
6
6
  normalizeApiResponse,
7
7
  resolveEnvOptions
8
- } from "./chunk-3545KFME.js";
8
+ } from "./chunk-QMZNL465.js";
9
9
  export {
10
10
  generateSchema,
11
11
  generateSchemaCode,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/db-schema-sync",
3
- "version": "0.1.5-alpha.2",
3
+ "version": "0.1.5-alpha.3",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -29,7 +29,7 @@
29
29
  "node": ">=18.0.0"
30
30
  },
31
31
  "dependencies": {
32
- "@lark-apaas/http-client": "0.1.7-alpha.2",
32
+ "@lark-apaas/http-client": "0.1.7-alpha.4",
33
33
  "dotenv": "^17.3.1",
34
34
  "tiny-pinyin": "^1.3.2"
35
35
  },