@pipe0/react-sdk 0.0.9 → 0.0.11

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.
@@ -0,0 +1,35 @@
1
+ import { type PipeCatalogTableData, type PipeCategory, type PipeId } from "@pipe0/client-sdk";
2
+ import { type ColumnFilter } from "@tanstack/react-table";
3
+ export type InputFieldEntries = Record<string, PipeId[]>;
4
+ export type OutputFieldEntries = Record<string, PipeId[]>;
5
+ export declare function usePipeCatalogTable(config?: {
6
+ initialColumnFilters?: ColumnFilter[];
7
+ }): {
8
+ table: import("@tanstack/react-table").Table<PipeCatalogTableData>;
9
+ sidebar: {
10
+ sortedInputFieldEntries: [string, ("people:workemail:waterfall@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:is:workemail@1" | "company:websiteurl:email@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1" | "website:technologystack:builtwith@1" | "run:prompt@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1")[]][];
11
+ sortedOutputFieldEntries: [string, ("people:workemail:waterfall@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:is:workemail@1" | "company:websiteurl:email@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1" | "website:technologystack:builtwith@1" | "run:prompt@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1")[]][];
12
+ sortedTagEntries: [string, ("people:workemail:waterfall@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:is:workemail@1" | "company:websiteurl:email@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1" | "website:technologystack:builtwith@1" | "run:prompt@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1")[]][];
13
+ sortedProviderEntries: [string, ("people:workemail:waterfall@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:is:workemail@1" | "company:websiteurl:email@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1" | "website:technologystack:builtwith@1" | "run:prompt@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1")[]][];
14
+ pipeIdsByInputField: Record<string, ("people:workemail:waterfall@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:is:workemail@1" | "company:websiteurl:email@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1" | "website:technologystack:builtwith@1" | "run:prompt@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1")[]>;
15
+ pipeIdsByOutputField: Record<string, ("people:workemail:waterfall@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:is:workemail@1" | "company:websiteurl:email@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1" | "website:technologystack:builtwith@1" | "run:prompt@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1")[]>;
16
+ pipeIdsByProvider: Record<string, ("people:workemail:waterfall@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:is:workemail@1" | "company:websiteurl:email@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1" | "website:technologystack:builtwith@1" | "run:prompt@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1")[]>;
17
+ pipeIdsByTag: Record<string, ("people:workemail:waterfall@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:is:workemail@1" | "company:websiteurl:email@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1" | "website:technologystack:builtwith@1" | "run:prompt@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1")[]>;
18
+ expandedSidebarSections: string[];
19
+ setExpandedSidebarSections: import("react").Dispatch<import("react").SetStateAction<string[]>>;
20
+ removeColumnFilter: (id: "inputFields" | "outputFields" | "tags" | "providers") => void;
21
+ addColumnFilter: (id: "inputFields" | "outputFields" | "tags" | "providers", value: string) => void;
22
+ };
23
+ pipeEntriesByBasePipe: Record<string, (import("@pipe0/client-sdk").PipeCatalogEntry<"people:workemail:waterfall@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:is:workemail@1" | "company:websiteurl:email@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1" | "website:technologystack:builtwith@1" | "run:prompt@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1"> & {
24
+ pipeId: PipeId;
25
+ })[]>;
26
+ filterByField: (id: "inputFields" | "outputFields", fieldName: string) => void;
27
+ globalFilterInput: string;
28
+ setGlobalFilterInput: import("react").Dispatch<import("react").SetStateAction<string>>;
29
+ isFilterChecked: (id: "inputFields" | "outputFields" | "tags" | "providers", value: string) => boolean;
30
+ resetColumnFilters: () => void;
31
+ category: PipeCategory;
32
+ setCategory: (category: PipeCategory | null) => void;
33
+ showFeaturedPipes: boolean;
34
+ };
35
+ //# sourceMappingURL=usePipeCatalogTable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePipeCatalogTable.d.ts","sourceRoot":"","sources":["../../src/hooks/usePipeCatalogTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,MAAM,EACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,YAAY,EAOlB,MAAM,uBAAuB,CAAC;AA2C/B,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AACzD,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AAuC1D,wBAAgB,mBAAmB,CACjC,MAAM,GAAE;IACN,oBAAoB,CAAC,EAAE,YAAY,EAAE,CAAC;CAClC;;;;;;;;;;;;;iCAqFA,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,WAAW;8BAhBrD,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,WAAW,SAClD,MAAM;;;;;wBA4BT,aAAa,GAAG,cAAc,aACvB,MAAM;;;0BARb,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,WAAW,SAClD,MAAM;;;4BA1CgB,YAAY,GAAG,IAAI;;EA6FnD"}
@@ -1,6 +1,13 @@
1
1
  import { getInitialTableData, getTableDataAggregates, } from "@pipe0/client-sdk";
2
2
  import { createColumnHelper, getCoreRowModel, getFilteredRowModel, getPaginationRowModel, useReactTable, } from "@tanstack/react-table";
3
3
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
4
+ const globalFilterFn = (row, columnId, filterValue) => {
5
+ const value = row.getValue(columnId);
6
+ if (Array.isArray(value)) {
7
+ return value.some((item) => String(item).toLowerCase().includes(filterValue.toLowerCase()));
8
+ }
9
+ return String(value).toLowerCase().includes(filterValue.toLowerCase());
10
+ };
4
11
  function useDebounce(cb, config = {}) {
5
12
  const { initialValue = "", timeout = 400 } = config;
6
13
  const [value, setValue] = useState(initialValue);
@@ -20,21 +27,34 @@ function useDebounce(cb, config = {}) {
20
27
  }
21
28
  const columnHelper = createColumnHelper();
22
29
  const columns = [
23
- columnHelper.accessor("pipeId", {}),
24
- columnHelper.accessor((row) => row.inputGroups.flatMap((g) => Object.keys(g.fields)).join(", "), {
30
+ columnHelper.accessor("pipeId", {
31
+ filterFn: "includesString",
32
+ enableGlobalFilter: true,
33
+ }),
34
+ columnHelper.accessor((row) => row.defaultInputGroups.flatMap((g) => Object.keys(g.fields)) || [], {
25
35
  id: "inputFields",
36
+ filterFn: "arrIncludes",
37
+ enableGlobalFilter: true,
26
38
  }),
27
- columnHelper.accessor((row) => row.outputFields.join(", "), {
39
+ columnHelper.accessor((row) => row.defaultOutputFields || [], {
28
40
  id: "outputFields",
41
+ filterFn: "arrIncludes",
42
+ enableGlobalFilter: true,
29
43
  }),
30
- columnHelper.accessor((row) => row.tags.join(", "), {
44
+ columnHelper.accessor((row) => row.tags || [], {
31
45
  id: "tags",
46
+ filterFn: "arrIncludes",
47
+ enableGlobalFilter: true,
32
48
  }),
33
- columnHelper.accessor((row) => row.providers.join(", "), {
49
+ columnHelper.accessor((row) => row.providers || [], {
34
50
  id: "providers",
51
+ filterFn: "arrIncludes",
52
+ enableGlobalFilter: true,
35
53
  }),
36
- columnHelper.accessor((row) => row.categories.join(", "), {
54
+ columnHelper.accessor((row) => row.categories || [], {
37
55
  id: "categories",
56
+ filterFn: "arrIncludes",
57
+ enableGlobalFilter: true,
38
58
  }),
39
59
  ];
40
60
  export function usePipeCatalogTable(config = {}) {
@@ -46,6 +66,8 @@ export function usePipeCatalogTable(config = {}) {
46
66
  getCoreRowModel: getCoreRowModel(),
47
67
  getPaginationRowModel: getPaginationRowModel(),
48
68
  getFilteredRowModel: getFilteredRowModel(),
69
+ globalFilterFn: globalFilterFn,
70
+ getColumnCanGlobalFilter: (column) => column.columnDef.enableGlobalFilter !== false,
49
71
  initialState: {
50
72
  columnFilters: initialColumnFilters,
51
73
  pagination: {
@@ -102,9 +124,11 @@ export function usePipeCatalogTable(config = {}) {
102
124
  { id, value: fieldName },
103
125
  ]);
104
126
  };
127
+ const tableState = table.getState();
105
128
  const showFeaturedPipes = !globalFilterInput &&
106
129
  category === null &&
107
- table.getState().columnFilters.every((e) => e.id === "categories");
130
+ tableState.columnFilters.every((e) => e.id === "categories") &&
131
+ tableState.pagination.pageIndex === 0;
108
132
  return {
109
133
  table,
110
134
  sidebar: {
@@ -0,0 +1,30 @@
1
+ import { type SearchCatalogTableData, type SearchCategory, type SearchId } from "@pipe0/client-sdk";
2
+ import { type ColumnFilter } from "@tanstack/react-table";
3
+ export type SearchOutputFieldEntries = Record<string, SearchId[]>;
4
+ export declare function useSearchCatalogTable(config?: {
5
+ initialColumnFilters?: ColumnFilter[];
6
+ }): {
7
+ table: import("@tanstack/react-table").Table<SearchCatalogTableData>;
8
+ sidebar: {
9
+ sortedOutputFieldEntries: [string, ("people:profiles:icypeas@1" | "companies:profiles:icypeas@1")[]][];
10
+ sortedTagEntries: [string, ("people:profiles:icypeas@1" | "companies:profiles:icypeas@1")[]][];
11
+ sortedProviderEntries: [string, ("people:profiles:icypeas@1" | "companies:profiles:icypeas@1")[]][];
12
+ searchIdsByOutputField: Record<string, ("people:profiles:icypeas@1" | "companies:profiles:icypeas@1")[]>;
13
+ searchIdsByProvider: Record<string, ("people:profiles:icypeas@1" | "companies:profiles:icypeas@1")[]>;
14
+ searchIdsByTag: Record<string, ("people:profiles:icypeas@1" | "companies:profiles:icypeas@1")[]>;
15
+ expandedSidebarSections: string[];
16
+ setExpandedSidebarSections: import("react").Dispatch<import("react").SetStateAction<string[]>>;
17
+ removeColumnFilter: (id: "inputFields" | "outputFields" | "tags" | "providers") => void;
18
+ addColumnFilter: (id: "inputFields" | "outputFields" | "tags" | "providers", value: string) => void;
19
+ };
20
+ searchEntriesByBaseSearch: Record<string, import("@pipe0/client-sdk").SearchMetaEntryWithId[]>;
21
+ filterByField: (id: "inputFields" | "outputFields", fieldName: string) => void;
22
+ globalFilterInput: string;
23
+ setGlobalFilterInput: import("react").Dispatch<import("react").SetStateAction<string>>;
24
+ isFilterChecked: (id: "inputFields" | "outputFields" | "tags" | "providers", value: string) => boolean;
25
+ resetColumnFilters: () => void;
26
+ category: SearchCategory;
27
+ setCategory: (category: SearchCategory | null) => void;
28
+ showFeaturedPipes: boolean;
29
+ };
30
+ //# sourceMappingURL=useSearchCatalogTable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSearchCatalogTable.d.ts","sourceRoot":"","sources":["../../src/hooks/useSearchCatalogTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,QAAQ,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,YAAY,EAOlB,MAAM,uBAAuB,CAAC;AA2C/B,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;AA+BlE,wBAAgB,qBAAqB,CACnC,MAAM,GAAE;IACN,oBAAoB,CAAC,EAAE,YAAY,EAAE,CAAC;CAClC;;;;;;;;;;;iCAmFA,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,WAAW;8BAhBrD,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,WAAW,SAClD,MAAM;;;wBA4BT,aAAa,GAAG,cAAc,aACvB,MAAM;;;0BARb,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,WAAW,SAClD,MAAM;;;4BA1CgB,cAAc,GAAG,IAAI;;EA2FrD"}
@@ -0,0 +1,151 @@
1
+ import { getInitialSearchTableData, getSearchTableDataAggregates, } from "@pipe0/client-sdk";
2
+ import { createColumnHelper, getCoreRowModel, getFilteredRowModel, getPaginationRowModel, useReactTable, } from "@tanstack/react-table";
3
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
4
+ const globalFilterFn = (row, columnId, filterValue) => {
5
+ const value = row.getValue(columnId);
6
+ if (Array.isArray(value)) {
7
+ return value.some((item) => String(item).toLowerCase().includes(filterValue.toLowerCase()));
8
+ }
9
+ return String(value).toLowerCase().includes(filterValue.toLowerCase());
10
+ };
11
+ function useDebounce(cb, config = {}) {
12
+ const { initialValue = "", timeout = 400 } = config;
13
+ const [value, setValue] = useState(initialValue);
14
+ const cbRef = useRef(cb);
15
+ cbRef.current = cb;
16
+ const setImmediately = useCallback((v) => {
17
+ setValue(v);
18
+ cbRef.current(v);
19
+ }, []);
20
+ useEffect(() => {
21
+ const handle = setTimeout(() => {
22
+ cbRef.current(value);
23
+ }, timeout);
24
+ return () => clearTimeout(handle);
25
+ }, [value, timeout]);
26
+ return [value, setValue, setImmediately];
27
+ }
28
+ const columnHelper = createColumnHelper();
29
+ const columns = [
30
+ columnHelper.accessor("searchId", {
31
+ filterFn: "includesString",
32
+ enableGlobalFilter: true,
33
+ }),
34
+ columnHelper.accessor((row) => row.outputFields || [], {
35
+ id: "outputFields",
36
+ filterFn: "arrIncludes",
37
+ enableGlobalFilter: true,
38
+ }),
39
+ columnHelper.accessor((row) => row.tags || [], {
40
+ id: "tags",
41
+ filterFn: "arrIncludes",
42
+ enableGlobalFilter: true,
43
+ }),
44
+ columnHelper.accessor((row) => row.providers || [], {
45
+ id: "providers",
46
+ filterFn: "arrIncludes",
47
+ enableGlobalFilter: true,
48
+ }),
49
+ columnHelper.accessor((row) => row.categories || [], {
50
+ id: "categories",
51
+ filterFn: "arrIncludes",
52
+ enableGlobalFilter: true,
53
+ }),
54
+ ];
55
+ export function useSearchCatalogTable(config = {}) {
56
+ const { initialColumnFilters: initialColumnFilters = [] } = config;
57
+ const initialSearchTableData = useMemo(() => getInitialSearchTableData(), []);
58
+ const table = useReactTable({
59
+ columns,
60
+ data: initialSearchTableData,
61
+ getCoreRowModel: getCoreRowModel(),
62
+ getPaginationRowModel: getPaginationRowModel(),
63
+ getFilteredRowModel: getFilteredRowModel(),
64
+ globalFilterFn: globalFilterFn,
65
+ getColumnCanGlobalFilter: (column) => column.columnDef.enableGlobalFilter !== false,
66
+ initialState: {
67
+ columnFilters: initialColumnFilters,
68
+ pagination: {
69
+ pageSize: 10,
70
+ },
71
+ },
72
+ });
73
+ const columnFilters = table.getState().columnFilters;
74
+ const category = useMemo(() => columnFilters.find((e) => e.id === "categories" && e.value)
75
+ ?.value || null, [columnFilters]);
76
+ const { searchIdsByOutputField, searchIdsByTag, searchIdsByProvider, sortedTagEntries, sortedOutputFieldEntries, sortedProviderEntries, searchEntriesByBaseSearch, } = useMemo(() => {
77
+ return getSearchTableDataAggregates(initialSearchTableData, category);
78
+ }, [category, initialSearchTableData]);
79
+ const [expandedSidebarSections, setExpandedSidebarSections] = useState(["tags"]);
80
+ const setCategory = (category) => {
81
+ table.setGlobalFilter(null);
82
+ if (category) {
83
+ table.setColumnFilters([{ id: "categories", value: category }]);
84
+ }
85
+ else {
86
+ table.setColumnFilters([]);
87
+ }
88
+ };
89
+ const [globalFilterInput, setGlobalFilterInput, setGlobalFilterImmediately] = useDebounce((v) => {
90
+ if (v === table.getState().globalFilter)
91
+ return;
92
+ table.setGlobalFilter(v);
93
+ if (v) {
94
+ table.setColumnFilters([]);
95
+ }
96
+ });
97
+ const addColumnFilter = (id, value) => {
98
+ setGlobalFilterImmediately("");
99
+ table.setColumnFilters([
100
+ { id: "categories", value: category },
101
+ { id, value },
102
+ ]);
103
+ };
104
+ const resetColumnFilters = () => {
105
+ setGlobalFilterImmediately("");
106
+ table.setColumnFilters([{ id: "categories", value: null }]);
107
+ };
108
+ const removeColumnFilter = (id) => {
109
+ table.getColumn(id)?.setFilterValue(null);
110
+ };
111
+ const isFilterChecked = (id, value) => {
112
+ return columnFilters.some((f) => f.id === id && f.value === value);
113
+ };
114
+ const filterByField = (id, fieldName) => {
115
+ setExpandedSidebarSections([id]);
116
+ setGlobalFilterImmediately("");
117
+ table.setColumnFilters([
118
+ { id: "categories", value: null },
119
+ { id, value: fieldName },
120
+ ]);
121
+ };
122
+ const tableState = table.getState();
123
+ const showFeaturedSearches = !globalFilterInput &&
124
+ category === null &&
125
+ tableState.columnFilters.every((e) => e.id === "categories") &&
126
+ tableState.pagination.pageIndex === 0;
127
+ return {
128
+ table,
129
+ sidebar: {
130
+ sortedOutputFieldEntries,
131
+ sortedTagEntries,
132
+ sortedProviderEntries,
133
+ searchIdsByOutputField,
134
+ searchIdsByProvider,
135
+ searchIdsByTag,
136
+ expandedSidebarSections,
137
+ setExpandedSidebarSections,
138
+ removeColumnFilter,
139
+ addColumnFilter,
140
+ },
141
+ searchEntriesByBaseSearch,
142
+ filterByField,
143
+ globalFilterInput,
144
+ setGlobalFilterInput,
145
+ isFilterChecked,
146
+ resetColumnFilters,
147
+ category,
148
+ setCategory,
149
+ showFeaturedPipes: showFeaturedSearches,
150
+ };
151
+ }
package/dist/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
- export { usePipeCatalogTable, type InputFieldEntries, type OutputFieldEntries, } from "./hooks/usePipeCatalogTableHook.js";
1
+ export { usePipeCatalogTable, type InputFieldEntries, type OutputFieldEntries, } from "./hooks/usePipeCatalogTable.js";
2
+ export { useSearchCatalogTable, type SearchOutputFieldEntries, } from "./hooks/useSearchCatalogTable.js";
3
+ export * from "./utils/helpers.js";
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,GACxB,MAAM,oCAAoC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,GACxB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,qBAAqB,EACrB,KAAK,wBAAwB,GAC9B,MAAM,kCAAkC,CAAC;AAC1C,cAAc,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -1 +1,3 @@
1
- export { usePipeCatalogTable, } from "./hooks/usePipeCatalogTableHook.js";
1
+ export { usePipeCatalogTable, } from "./hooks/usePipeCatalogTable.js";
2
+ export { useSearchCatalogTable, } from "./hooks/useSearchCatalogTable.js";
3
+ export * from "./utils/helpers.js";
@@ -0,0 +1,3 @@
1
+ import type { RecordFieldStatus } from "@pipe0/client-sdk";
2
+ export declare function getFieldStatusIcon(fieldStatus: RecordFieldStatus): import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
3
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/utils/helpers.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAsB3D,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,iBAAiB,6IAEhE"}
@@ -0,0 +1,13 @@
1
+ import { BookDashed, Bookmark, CheckCheck, Loader, Pause, TriangleDashed, X, } from "lucide-react";
2
+ const fieldStatusIconMap = {
3
+ completed: CheckCheck,
4
+ failed: X,
5
+ no_result: BookDashed,
6
+ pending: Bookmark,
7
+ processing: Loader,
8
+ queued: Pause,
9
+ skipped: TriangleDashed,
10
+ };
11
+ export function getFieldStatusIcon(fieldStatus) {
12
+ return fieldStatusIconMap[fieldStatus];
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipe0/react-sdk",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "type": "module",
5
5
  "description": "React utils to work with pipe0",
6
6
  "keywords": [
@@ -25,16 +25,17 @@
25
25
  "author": "",
26
26
  "license": "MIT",
27
27
  "dependencies": {
28
- "@tanstack/react-table": "^8.21.2",
28
+ "@tanstack/react-table": "^8.21.3",
29
+ "lucide-react": "^0.475.0",
29
30
  "react": "^19.0.0",
30
31
  "react-dom": "^19.0.0",
31
- "@pipe0/client-sdk": "0.0.51"
32
+ "@pipe0/client-sdk": "0.0.53"
32
33
  },
33
34
  "devDependencies": {
34
35
  "@types/node": "^22.13.2",
35
36
  "@types/react": "^19.0.8",
36
37
  "@types/react-dom": "^19.0.3",
37
- "eslint": "^9.30.0",
38
+ "eslint": "^9.30.1",
38
39
  "rimraf": "^6.0.1",
39
40
  "@pipe0/eslint-config": "0.0.0"
40
41
  },
@@ -1,35 +0,0 @@
1
- import { type PipeCatalogTableData, type PipeCategory, type PipeId } from "@pipe0/client-sdk";
2
- import { type ColumnFilter } from "@tanstack/react-table";
3
- export type InputFieldEntries = Record<string, PipeId[]>;
4
- export type OutputFieldEntries = Record<string, PipeId[]>;
5
- export declare function usePipeCatalogTable(config?: {
6
- initialColumnFilters?: ColumnFilter[];
7
- }): {
8
- table: import("@tanstack/react-table").Table<PipeCatalogTableData>;
9
- sidebar: {
10
- sortedInputFieldEntries: [string, ("run:prompt@1" | "company:newssummary:website@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:is:workemail@1" | "people:split:name@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1")[]][];
11
- sortedOutputFieldEntries: [string, ("run:prompt@1" | "company:newssummary:website@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:is:workemail@1" | "people:split:name@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1")[]][];
12
- sortedTagEntries: [string, ("run:prompt@1" | "company:newssummary:website@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:is:workemail@1" | "people:split:name@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1")[]][];
13
- sortedProviderEntries: [string, ("run:prompt@1" | "company:newssummary:website@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:is:workemail@1" | "people:split:name@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1")[]][];
14
- pipeIdsByInputField: Record<string, ("run:prompt@1" | "company:newssummary:website@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:is:workemail@1" | "people:split:name@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1")[]>;
15
- pipeIdsByOutputField: Record<string, ("run:prompt@1" | "company:newssummary:website@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:is:workemail@1" | "people:split:name@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1")[]>;
16
- pipeIdsByProvider: Record<string, ("run:prompt@1" | "company:newssummary:website@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:is:workemail@1" | "people:split:name@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1")[]>;
17
- pipeIdsByTag: Record<string, ("run:prompt@1" | "company:newssummary:website@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:is:workemail@1" | "people:split:name@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1")[]>;
18
- expandedSidebarSections: string[];
19
- setExpandedSidebarSections: import("react").Dispatch<import("react").SetStateAction<string[]>>;
20
- removeColumnFilter: (id: "inputFields" | "outputFields" | "tags" | "providers") => void;
21
- addColumnFilter: (id: "inputFields" | "outputFields" | "tags" | "providers", value: string) => void;
22
- };
23
- pipeEntriesByBasePipe: Record<string, (import("@pipe0/client-sdk").PipeMetaCatalogEntry<"run:prompt@1" | "company:newssummary:website@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:is:workemail@1" | "people:split:name@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1"> & {
24
- pipeId: PipeId;
25
- })[]>;
26
- filterByField: (id: "inputFields" | "outputFields", fieldName: string) => void;
27
- globalFilterInput: string;
28
- setGlobalFilterInput: import("react").Dispatch<import("react").SetStateAction<string>>;
29
- isFilterChecked: (id: "inputFields" | "outputFields" | "tags" | "providers", value: string) => boolean;
30
- resetColumnFilters: () => void;
31
- category: PipeCategory;
32
- setCategory: (category: PipeCategory | null) => void;
33
- showFeaturedPipes: boolean;
34
- };
35
- //# sourceMappingURL=usePipeCatalogTableHook.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"usePipeCatalogTableHook.d.ts","sourceRoot":"","sources":["../../src/hooks/usePipeCatalogTableHook.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,MAAM,EACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,YAAY,EAMlB,MAAM,uBAAuB,CAAC;AA6B/B,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AACzD,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AA0B1D,wBAAgB,mBAAmB,CACjC,MAAM,GAAE;IACN,oBAAoB,CAAC,EAAE,YAAY,EAAE,CAAC;CAClC;;;;;;;;;;;;;iCAkFA,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,WAAW;8BAhBrD,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,WAAW,SAClD,MAAM;;;;;wBA4BT,aAAa,GAAG,cAAc,aACvB,MAAM;;;0BARb,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,WAAW,SAClD,MAAM;;;4BA1CgB,YAAY,GAAG,IAAI;;EA0FnD"}