issue-sticker 0.7.0 → 0.8.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.
@@ -1,4 +1,4 @@
1
- import { u as uploadScreenshotDataUrls, a as uploadSignedMediaWithApi, d as directUploadToSignedUrl, p as pristineFetch, n as normalizeExposedJiraFields, b as normalizeJiraFieldId, g as getElementPosition, c as captureWithModernScreenshot, e as buildJiraCreateFields, f as buildNotionCreateFields, h as buildGuestOwnerQuery, i as buildIssueIntegrationsPayload, j as devLogger, C as ConsoleCollector, N as NetworkCollector, s as selectNetworkLogsForSubmit, k as filterExcludeServiceRelatedLogs, l as filterExcludeServiceRelatedConsoleLogs, m as compactNetworkLogsForTransport, o as CONSOLE_LOG_SUBMIT_LIMIT, q as buildExternalUserPayload, r as shrinkNetworkLogsToFit, t as measureJsonBytes, v as sanitizeString, w as getCurrentPageUrl, S as ScreenRecordingController, x as SessionReplayCaptureController, y as preloadModernScreenshot, I as ISSUE_STICKER_INTERNAL_LOG_PREFIX } from "./externalUserPayload-B26uCsCP.js";
1
+ import { u as uploadScreenshotDataUrls, a as uploadSignedMediaWithApi, d as directUploadToSignedUrl, p as pristineFetch, g as getElementPosition, c as captureWithModernScreenshot, b as buildJiraCreateFields, e as buildNotionCreateFields, f as buildGuestOwnerQuery, h as composeIssueFilterGroups, i as buildIssueIntegrationsPayload, j as devLogger, C as ConsoleCollector, N as NetworkCollector, s as selectNetworkLogsForSubmit, k as filterExcludeServiceRelatedLogs, l as filterExcludeServiceRelatedConsoleLogs, m as compactNetworkLogsForTransport, n as CONSOLE_LOG_SUBMIT_LIMIT, o as buildExternalUserPayload, q as shrinkNetworkLogsToFit, r as measureJsonBytes, t as sanitizeString, v as getCurrentPageUrl, S as ScreenRecordingController, w as SessionReplayCaptureController, x as preloadModernScreenshot, I as ISSUE_STICKER_INTERNAL_LOG_PREFIX } from "./externalUserPayload-k9LSBeMB.js";
2
2
  import "react/jsx-runtime";
3
3
  import "react";
4
4
  import "./mouse-pointer-2-BR00y3ir.js";
@@ -452,182 +452,6 @@ class HeadlessAuthBridge {
452
452
  this.options.onToken(result);
453
453
  }
454
454
  }
455
- const JIRA_FILTERABLE_FIELD_IDS = /* @__PURE__ */ new Set([
456
- "status",
457
- "priority",
458
- "assignee",
459
- "reporter",
460
- "fixVersions",
461
- "issuetype",
462
- "project_key",
463
- "sprint_id",
464
- "sprint_name",
465
- "epic_link",
466
- "story_points"
467
- ]);
468
- const NOTION_FILTERABLE_FIELD_TYPES = /* @__PURE__ */ new Set(["select", "multi_select", "status", "checkbox"]);
469
- function getJiraConfig(integration) {
470
- if (integration.service_type !== "JIRA") return null;
471
- return integration.config ?? null;
472
- }
473
- function getNotionConfig(integration) {
474
- if (integration.service_type !== "NOTION") return null;
475
- return integration.config ?? null;
476
- }
477
- function getExposedFields(config) {
478
- if (!(config == null ? void 0 : config.exposed_fields)) return [];
479
- return normalizeExposedJiraFields(
480
- Array.isArray(config.exposed_fields) ? config.exposed_fields : void 0
481
- );
482
- }
483
- function getLastKnownJiraFields(config) {
484
- const fields = config == null ? void 0 : config.last_known_fields;
485
- if (!Array.isArray(fields)) return [];
486
- return fields.filter(
487
- (field) => Boolean(field) && typeof field === "object" && typeof field.id === "string" && typeof field.name === "string"
488
- );
489
- }
490
- function getSelectedNotionFields(config) {
491
- const fields = config == null ? void 0 : config.selected_fields;
492
- if (!Array.isArray(fields)) return [];
493
- return fields.filter((field) => typeof field === "string");
494
- }
495
- function getLastKnownNotionFields(config) {
496
- const fields = config == null ? void 0 : config.last_known_fields;
497
- if (!Array.isArray(fields)) return [];
498
- return fields.filter(
499
- (field) => Boolean(field) && typeof field === "object" && typeof field.id === "string" && typeof field.name === "string" && typeof field.type === "string"
500
- );
501
- }
502
- const OPTION_CUSTOM_FIELD_TYPES = /* @__PURE__ */ new Set(["select", "multi_select"]);
503
- function getSelectableCustomFieldOptions(field) {
504
- var _a;
505
- if (!OPTION_CUSTOM_FIELD_TYPES.has(field.field_type)) return [];
506
- const rawOptions = (_a = field.field_config) == null ? void 0 : _a.options;
507
- if (!Array.isArray(rawOptions)) return [];
508
- return rawOptions.filter((option) => typeof option === "string" && option.trim().length > 0).map((option) => ({ label: option, value: option }));
509
- }
510
- function getJiraOptionValue(option) {
511
- return option.id;
512
- }
513
- function getJiraFieldFilterOptions(field) {
514
- const options = field.options ?? [];
515
- if (!options.length) return [];
516
- return options.map((option) => ({
517
- label: option.name || option.value || option.id,
518
- value: getJiraOptionValue(option)
519
- })).filter((option) => option.value.length > 0);
520
- }
521
- function getNotionFieldFilterOptions(field) {
522
- if (field.type === "checkbox") {
523
- return [
524
- { label: "체크됨", value: "true" },
525
- { label: "체크 안 됨", value: "false" }
526
- ];
527
- }
528
- const options = field.options ?? [];
529
- if (!options.length) return [];
530
- return options.map((option) => ({
531
- label: option.name,
532
- value: option.name
533
- })).filter((option) => option.value.length > 0);
534
- }
535
- function mergeOptions(current, next) {
536
- const byValue = new Map(current.map((option) => [option.value, option]));
537
- for (const option of next) {
538
- if (!byValue.has(option.value)) {
539
- byValue.set(option.value, option);
540
- }
541
- }
542
- return Array.from(byValue.values()).sort((a, b) => a.label.localeCompare(b.label));
543
- }
544
- function upsertFilterGroup(groups, group) {
545
- const existing = groups.get(group.id);
546
- if (!existing) {
547
- groups.set(group.id, {
548
- ...group,
549
- options: mergeOptions([], group.options)
550
- });
551
- return;
552
- }
553
- groups.set(group.id, {
554
- ...existing,
555
- options: mergeOptions(existing.options, group.options)
556
- });
557
- }
558
- function appendCustomFieldFilterGroups(groups, customFields) {
559
- for (const field of customFields) {
560
- const options = getSelectableCustomFieldOptions(field);
561
- if (!options.length) continue;
562
- upsertFilterGroup(groups, {
563
- kind: "custom",
564
- id: `custom:${field.id}`,
565
- fieldDefinitionId: field.id,
566
- label: field.field_name,
567
- options
568
- });
569
- }
570
- }
571
- function appendJiraFieldFilterGroups(groups, exposedFieldIds, fields) {
572
- for (const field of fields) {
573
- const normalizedFieldId = normalizeJiraFieldId(field.id);
574
- if (!exposedFieldIds.has(normalizedFieldId) || !JIRA_FILTERABLE_FIELD_IDS.has(normalizedFieldId)) {
575
- continue;
576
- }
577
- const options = getJiraFieldFilterOptions(field);
578
- if (!options.length) continue;
579
- upsertFilterGroup(groups, {
580
- kind: "jira",
581
- id: `jira:${normalizedFieldId}`,
582
- fieldName: normalizedFieldId,
583
- label: field.name,
584
- options
585
- });
586
- }
587
- }
588
- function appendNotionFieldFilterGroups(groups, selectedFields, fields) {
589
- for (const field of fields) {
590
- if (!selectedFields.has(field.id) && !selectedFields.has(field.name)) continue;
591
- if (!NOTION_FILTERABLE_FIELD_TYPES.has(field.type)) continue;
592
- const options = getNotionFieldFilterOptions(field);
593
- if (!options.length) continue;
594
- upsertFilterGroup(groups, {
595
- kind: "notion",
596
- id: `notion:${field.id}`,
597
- fieldName: field.name,
598
- label: field.name,
599
- options
600
- });
601
- }
602
- }
603
- function composeIssueFilterGroups(integrations, customFields) {
604
- const groups = /* @__PURE__ */ new Map();
605
- const jiraIntegration = integrations.find((integration) => {
606
- const config = getJiraConfig(integration);
607
- return integration.is_active !== false && config;
608
- });
609
- appendCustomFieldFilterGroups(groups, customFields);
610
- const jiraConfig = jiraIntegration ? getJiraConfig(jiraIntegration) : null;
611
- const configExposedFields = getExposedFields(jiraConfig);
612
- if (configExposedFields.length) {
613
- appendJiraFieldFilterGroups(
614
- groups,
615
- new Set(configExposedFields),
616
- getLastKnownJiraFields(jiraConfig)
617
- );
618
- }
619
- for (const integration of integrations) {
620
- if (integration.is_active === false) continue;
621
- const notionConfig = getNotionConfig(integration);
622
- if (!notionConfig) continue;
623
- appendNotionFieldFilterGroups(
624
- groups,
625
- new Set(getSelectedNotionFields(notionConfig)),
626
- getLastKnownNotionFields(notionConfig)
627
- );
628
- }
629
- return Array.from(groups.values()).sort((a, b) => a.label.localeCompare(b.label));
630
- }
631
455
  function buildHeadlessCaptureContext({
632
456
  target,
633
457
  event,