@kevisual/cnb 0.0.27 → 0.0.29

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/routes.d.ts CHANGED
@@ -136,6 +136,19 @@ declare class Workspace extends CNBCore {
136
136
  /** 如果存在开发环境,则返回 WebIDE 访问 url;如果不存在开发环境,则返回启动云原生开发的 loading 页面 url 地址 */
137
137
  url: string;
138
138
  }>>;
139
+ /**
140
+ * 添加使用cookie获取工作空间访问权限的功能,适用于需要保持工作空间连接状态的场景,
141
+ * 例如使用 WebSocket 连接工作空间时需要携带 cookie 进行身份验证。
142
+ * https://cnb.cool/kevisual/dev-env/-/workspace/vscode-web/cnb-708-1ji9sog7o-001
143
+ * @param repo
144
+ * @param pipelineId
145
+ * @returns
146
+ */
147
+ getWorkspaceCookie(repo: string, pipelineId: string): Promise<Result$1<{
148
+ value: string;
149
+ cookie: string;
150
+ cookieName: string;
151
+ }>>;
139
152
  }
140
153
  interface WorkspaceLinkDetail {
141
154
  codebuddy: string;
@@ -378,6 +391,11 @@ declare class User extends CNBCore {
378
391
  * @returns
379
392
  */
380
393
  getCurrentUser(): Promise<Result$2<UserInfo>>;
394
+ /**
395
+ * 判断当前 Cookie 是否有效
396
+ * @returns
397
+ */
398
+ checkCookieValid(): Promise<Result$2>;
381
399
  /**
382
400
  * 使用 Token 获取用户信息
383
401
  * @returns
@@ -778,6 +796,8 @@ declare const config: {
778
796
  KUBECONFIG_DATA?: string;
779
797
  };
780
798
  declare const cnb: CNB;
781
- declare const app: QueryRouterServer;
799
+ declare const app: QueryRouterServer<{
800
+ [x: string]: any;
801
+ }>;
782
802
 
783
803
  export { app, cnb, config };