@solhun/feedback-kit-core 0.10.0 → 0.12.0

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.cjs CHANGED
@@ -2679,6 +2679,45 @@ function createLassoAdapter(opts = {}) {
2679
2679
  * `HintProvider`(hints/ 소유자) 몫이라, 어댑터가 매 실패마다 경고를 찍으면 그 판단과
2680
2680
  * 어긋난다.
2681
2681
  */
2682
+ /**
2683
+ * 지금 어디에 연결돼 있나. **던지지 않는다** — 못 얻으면 `null` 이고, 그러면 위젯이
2684
+ * "확인 못 했습니다"를 보여준다. 이건 표시용이라 실패가 제보를 막으면 안 된다.
2685
+ */
2686
+ async fetchConnection() {
2687
+ const url = absoluteEndpoint(`${endpoint.replace(/\/+$/, "")}/connection`);
2688
+ if (url === null) return null;
2689
+ const sender = resolveFetch(opts.fetch);
2690
+ if (sender === null) return null;
2691
+ const headers = {};
2692
+ if (token !== null) headers.Authorization = `Bearer ${token}`;
2693
+ let res;
2694
+ try {
2695
+ res = await sender(url, { method: "GET", headers });
2696
+ } catch {
2697
+ return null;
2698
+ }
2699
+ if (res.status < 200 || res.status >= 300) return null;
2700
+ let body;
2701
+ try {
2702
+ body = JSON.parse(await res.text());
2703
+ } catch {
2704
+ return null;
2705
+ }
2706
+ const raw = body;
2707
+ if (!raw || raw.ok !== true) return null;
2708
+ const str = (v) => typeof v === "string" && v !== "" ? v : null;
2709
+ return {
2710
+ collector: "lasso",
2711
+ project: { id: str(raw.project?.id), name: str(raw.project?.name) },
2712
+ linear: {
2713
+ connected: raw.linear?.connected === true,
2714
+ teamName: str(raw.linear?.teamName),
2715
+ projectName: str(raw.linear?.projectName),
2716
+ autoExport: raw.linear?.autoExport === true
2717
+ },
2718
+ symphonySlug: str(raw.symphony?.slug)
2719
+ };
2720
+ },
2682
2721
  async fetchHints(etag) {
2683
2722
  const url = absoluteEndpoint(`${endpoint.replace(/\/+$/, "")}/hints`);
2684
2723
  if (url === null) return { kind: "fail" };