@jctrans-materials/shared 1.0.37-beta.2 → 1.0.37-beta.21

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/index.d.ts CHANGED
@@ -271,6 +271,14 @@ export declare function getExpiresTimeIn(): number;
271
271
  */
272
272
  export declare function getFirstDomain(): string | undefined;
273
273
 
274
+ /**
275
+ * 全局获取 GIO 相关 session
276
+ * @returns
277
+ */
278
+ export declare function getGioSessionItems(): {
279
+ registerEntry: string | null;
280
+ };
281
+
274
282
  /**
275
283
  * 兼容全环境的语言判断方法
276
284
  * 逻辑优先级:Nuxt Composables > 浏览器 Cookie > Nuxt SSR 上下文
@@ -366,6 +374,8 @@ export declare function getSeaport(params?: {
366
374
  countryId?: number;
367
375
  }): Promise<BaseResponse<UnifiedItem>>;
368
376
 
377
+ export declare function getSessionHeaderValue(key: string): string;
378
+
369
379
  /**
370
380
  * 获取当前配置
371
381
  */
@@ -532,12 +542,14 @@ export declare interface GioPageProps {
532
542
  export declare type GioTimerId = string;
533
543
 
534
544
  declare class GioTracker {
545
+ private hasInitCalled;
546
+ private dispatcher;
547
+ private dispatcherLoading;
548
+ private pendingActions;
535
549
  private get shouldValidateAttributes();
536
- /**
537
- * 获取 window.gdp 方法
538
- * 非浏览器环境(如 Nuxt SSR)返回空函数,确保服务端渲染不会报错
539
- */
540
- private get gdp();
550
+ private flushPendingActions;
551
+ private ensureDispatcher;
552
+ private dispatch;
541
553
  /**
542
554
  * 检查 SDK 是否已初始化
543
555
  * 在 SSR 环境下返回 false
@@ -612,10 +624,20 @@ declare class GioTracker {
612
624
  /**
613
625
  * 设置登录用户 ID
614
626
  * 需要在初始化时设置 idMapping: true
627
+ * 调用方式:
628
+ * - setUserId(userId, callback?)
629
+ * - setUserId(userId, userKey, callback?)
615
630
  * @param userId 用户 ID,长度 0 < length ≤ 1000
631
+ */
632
+ /**
633
+ * 设置登录用户 ID(无 userKey 场景)
634
+ */
635
+ setUserId(userId: string | number, callback?: GioCallback): void;
636
+ /**
637
+ * 设置登录用户 ID(ID-MAPPING 场景)
616
638
  * @param userKey 用户 ID 类型标识(用于 ID-MAPPING)
617
639
  */
618
- setUserId(userId: string | number, userKey?: string | number, callback?: GioCallback): void;
640
+ setUserId(userId: string | number, userKey: string | number, callback?: GioCallback): void;
619
641
  /**
620
642
  * 清除登录用户 ID(登出时调用)
621
643
  */
@@ -1219,6 +1241,12 @@ declare interface RequestOptions {
1219
1241
  */
1220
1242
  export declare function resetAuthSessionItems(): void;
1221
1243
 
1244
+ /**
1245
+ * 重置 GIO 相关 session
1246
+ * @returns
1247
+ */
1248
+ export declare function resetGioSessionItems(): void;
1249
+
1222
1250
  /**
1223
1251
  * 重置密码
1224
1252
  * @param data
@@ -1340,6 +1368,14 @@ export declare function setAuthSessionItems(data: {
1340
1368
  compKey?: string | null;
1341
1369
  }): void;
1342
1370
 
1371
+ /**
1372
+ * 全局设置 GIO 相关 session
1373
+ * @param data
1374
+ */
1375
+ export declare function setGioSessionItems(data: {
1376
+ registerEntry?: string | null;
1377
+ }): void;
1378
+
1343
1379
  /**
1344
1380
  * 记住账号 (替代存密码)
1345
1381
  */
@@ -1447,6 +1483,8 @@ export declare interface TokenData {
1447
1483
  */
1448
1484
  export declare const TokenKey = "JC-JAVA-Token-Root";
1449
1485
 
1486
+ export declare function toSafeHeaderValue(value: string): string;
1487
+
1450
1488
  export declare const tracker: GioTracker;
1451
1489
 
1452
1490
  /** 归一化之后的实体 */