@hackersheet/core 0.1.0-alpha.1

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.
Files changed (104) hide show
  1. package/README.md +3 -0
  2. package/dist/chunk-3GXIDS5H.mjs +23 -0
  3. package/dist/chunk-5X53IRLN.mjs +2417 -0
  4. package/dist/chunk-7R3CATQT.mjs +143 -0
  5. package/dist/chunk-C3G2CMRR.mjs +13 -0
  6. package/dist/chunk-EXRG4APR.mjs +34 -0
  7. package/dist/chunk-FIFBNWMD.mjs +21 -0
  8. package/dist/chunk-FRXB4F4I.mjs +0 -0
  9. package/dist/chunk-JGQBUURE.mjs +60 -0
  10. package/dist/chunk-PA32N4A6.mjs +6 -0
  11. package/dist/chunk-PUTNZ4GU.mjs +12 -0
  12. package/dist/chunk-RRJUH3D4.mjs +0 -0
  13. package/dist/chunk-SYHSU6VH.mjs +38 -0
  14. package/dist/chunk-TXCPBPKN.mjs +12 -0
  15. package/dist/chunk-VKWT2GNZ.mjs +0 -0
  16. package/dist/chunk-WIUPPYM5.mjs +60 -0
  17. package/dist/chunk-YAN7TO2B.mjs +0 -0
  18. package/dist/chunk-ZZFAG7Y6.mjs +705 -0
  19. package/dist/client/client.d.mts +51 -0
  20. package/dist/client/client.d.ts +51 -0
  21. package/dist/client/client.js +3424 -0
  22. package/dist/client/client.mjs +20 -0
  23. package/dist/client/create-client.d.mts +11 -0
  24. package/dist/client/create-client.d.ts +11 -0
  25. package/dist/client/create-client.js +3429 -0
  26. package/dist/client/create-client.mjs +21 -0
  27. package/dist/client/operations/get-document.d.mts +15 -0
  28. package/dist/client/operations/get-document.d.ts +15 -0
  29. package/dist/client/operations/get-document.js +881 -0
  30. package/dist/client/operations/get-document.mjs +14 -0
  31. package/dist/client/operations/get-documents.d.mts +14 -0
  32. package/dist/client/operations/get-documents.d.ts +14 -0
  33. package/dist/client/operations/get-documents.js +798 -0
  34. package/dist/client/operations/get-documents.mjs +14 -0
  35. package/dist/client/operations/get-tag.d.mts +12 -0
  36. package/dist/client/operations/get-tag.d.ts +12 -0
  37. package/dist/client/operations/get-tag.js +776 -0
  38. package/dist/client/operations/get-tag.mjs +14 -0
  39. package/dist/client/operations/get-tags.d.mts +14 -0
  40. package/dist/client/operations/get-tags.d.ts +14 -0
  41. package/dist/client/operations/get-tags.js +772 -0
  42. package/dist/client/operations/get-tags.mjs +14 -0
  43. package/dist/client/operations/get-websites.d.mts +14 -0
  44. package/dist/client/operations/get-websites.d.ts +14 -0
  45. package/dist/client/operations/get-websites.js +798 -0
  46. package/dist/client/operations/get-websites.mjs +14 -0
  47. package/dist/client/operations/index.d.mts +11 -0
  48. package/dist/client/operations/index.d.ts +11 -0
  49. package/dist/client/operations/index.js +1041 -0
  50. package/dist/client/operations/index.mjs +31 -0
  51. package/dist/gql/fragment-masking.d.mts +22 -0
  52. package/dist/gql/fragment-masking.d.ts +22 -0
  53. package/dist/gql/fragment-masking.js +47 -0
  54. package/dist/gql/fragment-masking.mjs +10 -0
  55. package/dist/gql/gql.d.mts +70 -0
  56. package/dist/gql/gql.d.ts +70 -0
  57. package/dist/gql/gql.js +739 -0
  58. package/dist/gql/gql.mjs +7 -0
  59. package/dist/gql/graphql.d.mts +722 -0
  60. package/dist/gql/graphql.d.ts +722 -0
  61. package/dist/gql/graphql.js +733 -0
  62. package/dist/gql/graphql.mjs +14 -0
  63. package/dist/gql/index.d.mts +4 -0
  64. package/dist/gql/index.d.ts +4 -0
  65. package/dist/gql/index.js +761 -0
  66. package/dist/gql/index.mjs +16 -0
  67. package/dist/index.d.mts +8 -0
  68. package/dist/index.d.ts +8 -0
  69. package/dist/index.js +3429 -0
  70. package/dist/index.mjs +22 -0
  71. package/dist/types/document.d.mts +71 -0
  72. package/dist/types/document.d.ts +71 -0
  73. package/dist/types/document.js +18 -0
  74. package/dist/types/document.mjs +0 -0
  75. package/dist/types/index.d.mts +3 -0
  76. package/dist/types/index.d.ts +3 -0
  77. package/dist/types/index.js +18 -0
  78. package/dist/types/index.mjs +1 -0
  79. package/dist/types/tag.d.mts +23 -0
  80. package/dist/types/tag.d.ts +23 -0
  81. package/dist/types/tag.js +18 -0
  82. package/dist/types/tag.mjs +0 -0
  83. package/dist/types/website.d.mts +29 -0
  84. package/dist/types/website.d.ts +29 -0
  85. package/dist/types/website.js +18 -0
  86. package/dist/types/website.mjs +0 -0
  87. package/dist/utils/index.d.mts +2 -0
  88. package/dist/utils/index.d.ts +2 -0
  89. package/dist/utils/index.js +49 -0
  90. package/dist/utils/index.mjs +12 -0
  91. package/dist/utils/make-after-cursor-from-page.d.mts +3 -0
  92. package/dist/utils/make-after-cursor-from-page.d.ts +3 -0
  93. package/dist/utils/make-after-cursor-from-page.js +32 -0
  94. package/dist/utils/make-after-cursor-from-page.mjs +6 -0
  95. package/dist/utils/non-nullable-filter.d.mts +3 -0
  96. package/dist/utils/non-nullable-filter.d.ts +3 -0
  97. package/dist/utils/non-nullable-filter.js +30 -0
  98. package/dist/utils/non-nullable-filter.mjs +6 -0
  99. package/dist/utils/to-array-from-edges.d.mts +6 -0
  100. package/dist/utils/to-array-from-edges.d.ts +6 -0
  101. package/dist/utils/to-array-from-edges.js +34 -0
  102. package/dist/utils/to-array-from-edges.mjs +7 -0
  103. package/license.md +21 -0
  104. package/package.json +36 -0
package/dist/index.mjs ADDED
@@ -0,0 +1,22 @@
1
+ import "./chunk-YAN7TO2B.mjs";
2
+ import {
3
+ createClient
4
+ } from "./chunk-TXCPBPKN.mjs";
5
+ import "./chunk-5X53IRLN.mjs";
6
+ import "./chunk-FRXB4F4I.mjs";
7
+ import "./chunk-JGQBUURE.mjs";
8
+ import "./chunk-SYHSU6VH.mjs";
9
+ import "./chunk-EXRG4APR.mjs";
10
+ import "./chunk-WIUPPYM5.mjs";
11
+ import "./chunk-7R3CATQT.mjs";
12
+ import "./chunk-VKWT2GNZ.mjs";
13
+ import "./chunk-PUTNZ4GU.mjs";
14
+ import "./chunk-C3G2CMRR.mjs";
15
+ import "./chunk-PA32N4A6.mjs";
16
+ import "./chunk-RRJUH3D4.mjs";
17
+ import "./chunk-FIFBNWMD.mjs";
18
+ import "./chunk-3GXIDS5H.mjs";
19
+ import "./chunk-ZZFAG7Y6.mjs";
20
+ export {
21
+ createClient
22
+ };
@@ -0,0 +1,71 @@
1
+ type DocumentList = DocumentListItem[];
2
+ type DocumentListItem = {
3
+ id: string;
4
+ slug: string;
5
+ emoji: string;
6
+ title: string;
7
+ draft: boolean;
8
+ path?: string | null;
9
+ publishedAt: string;
10
+ modifiedAt: string;
11
+ tags: Tag[];
12
+ preview?: Preview | null;
13
+ };
14
+ type Document = {
15
+ id: string;
16
+ slug: string;
17
+ emoji: string;
18
+ title: string;
19
+ draft: boolean;
20
+ content: string;
21
+ path?: string | null;
22
+ publishedAt: string;
23
+ modifiedAt: string;
24
+ tags: Tag[];
25
+ assets: Asset[];
26
+ outboundLinkDocuments: DocumentListItem[];
27
+ inboundLinkDocuments: DocumentListItem[];
28
+ websites: Website[];
29
+ preview?: Preview | null;
30
+ };
31
+ type Website = {
32
+ id: string;
33
+ url: string;
34
+ domain: string;
35
+ title: string;
36
+ description: string;
37
+ ogSiteName: string;
38
+ ogTitle: string;
39
+ ogType: string;
40
+ ogUrl: string;
41
+ ogImage?: OgImage | null;
42
+ ogDescription: string;
43
+ ogLocale: string;
44
+ };
45
+ type OgImage = {
46
+ id: string;
47
+ fileUrl?: string | null;
48
+ height: number;
49
+ width: number;
50
+ };
51
+ type Preview = {
52
+ id: string;
53
+ width: number;
54
+ height: number;
55
+ path?: string | null;
56
+ fileUrl: string;
57
+ };
58
+ type Tag = {
59
+ id: string;
60
+ name: string;
61
+ };
62
+ type Asset = {
63
+ id: string;
64
+ path?: string | null;
65
+ name: string;
66
+ fileUrl: string;
67
+ height: number;
68
+ width: number;
69
+ };
70
+
71
+ export type { Document, DocumentList, DocumentListItem, Tag };
@@ -0,0 +1,71 @@
1
+ type DocumentList = DocumentListItem[];
2
+ type DocumentListItem = {
3
+ id: string;
4
+ slug: string;
5
+ emoji: string;
6
+ title: string;
7
+ draft: boolean;
8
+ path?: string | null;
9
+ publishedAt: string;
10
+ modifiedAt: string;
11
+ tags: Tag[];
12
+ preview?: Preview | null;
13
+ };
14
+ type Document = {
15
+ id: string;
16
+ slug: string;
17
+ emoji: string;
18
+ title: string;
19
+ draft: boolean;
20
+ content: string;
21
+ path?: string | null;
22
+ publishedAt: string;
23
+ modifiedAt: string;
24
+ tags: Tag[];
25
+ assets: Asset[];
26
+ outboundLinkDocuments: DocumentListItem[];
27
+ inboundLinkDocuments: DocumentListItem[];
28
+ websites: Website[];
29
+ preview?: Preview | null;
30
+ };
31
+ type Website = {
32
+ id: string;
33
+ url: string;
34
+ domain: string;
35
+ title: string;
36
+ description: string;
37
+ ogSiteName: string;
38
+ ogTitle: string;
39
+ ogType: string;
40
+ ogUrl: string;
41
+ ogImage?: OgImage | null;
42
+ ogDescription: string;
43
+ ogLocale: string;
44
+ };
45
+ type OgImage = {
46
+ id: string;
47
+ fileUrl?: string | null;
48
+ height: number;
49
+ width: number;
50
+ };
51
+ type Preview = {
52
+ id: string;
53
+ width: number;
54
+ height: number;
55
+ path?: string | null;
56
+ fileUrl: string;
57
+ };
58
+ type Tag = {
59
+ id: string;
60
+ name: string;
61
+ };
62
+ type Asset = {
63
+ id: string;
64
+ path?: string | null;
65
+ name: string;
66
+ fileUrl: string;
67
+ height: number;
68
+ width: number;
69
+ };
70
+
71
+ export type { Document, DocumentList, DocumentListItem, Tag };
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/types/document.ts
17
+ var document_exports = {};
18
+ module.exports = __toCommonJS(document_exports);
File without changes
@@ -0,0 +1,3 @@
1
+ export { Document, DocumentList, DocumentListItem } from './document.mjs';
2
+ export { Tag, TagList, TagListItem } from './tag.mjs';
3
+ export { WebsiteListeItem } from './website.mjs';
@@ -0,0 +1,3 @@
1
+ export { Document, DocumentList, DocumentListItem } from './document.js';
2
+ export { Tag, TagList, TagListItem } from './tag.js';
3
+ export { WebsiteListeItem } from './website.js';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/types/index.ts
17
+ var types_exports = {};
18
+ module.exports = __toCommonJS(types_exports);
@@ -0,0 +1 @@
1
+ import "../chunk-YAN7TO2B.mjs";
@@ -0,0 +1,23 @@
1
+ type Tag = {
2
+ id: string;
3
+ name: string;
4
+ documentCount: number;
5
+ documentCountInPublished: number;
6
+ relatedTags: RelatedTagList;
7
+ };
8
+ type TagListItem = {
9
+ id: string;
10
+ name: string;
11
+ documentCount: number;
12
+ documentCountInPublished: number;
13
+ };
14
+ type TagList = TagListItem[];
15
+ type RelatedTagListItem = {
16
+ id: string;
17
+ name: string;
18
+ documentCount: number;
19
+ documentCountInPublished: number;
20
+ };
21
+ type RelatedTagList = RelatedTagListItem[];
22
+
23
+ export type { RelatedTagList, RelatedTagListItem, Tag, TagList, TagListItem };
@@ -0,0 +1,23 @@
1
+ type Tag = {
2
+ id: string;
3
+ name: string;
4
+ documentCount: number;
5
+ documentCountInPublished: number;
6
+ relatedTags: RelatedTagList;
7
+ };
8
+ type TagListItem = {
9
+ id: string;
10
+ name: string;
11
+ documentCount: number;
12
+ documentCountInPublished: number;
13
+ };
14
+ type TagList = TagListItem[];
15
+ type RelatedTagListItem = {
16
+ id: string;
17
+ name: string;
18
+ documentCount: number;
19
+ documentCountInPublished: number;
20
+ };
21
+ type RelatedTagList = RelatedTagListItem[];
22
+
23
+ export type { RelatedTagList, RelatedTagListItem, Tag, TagList, TagListItem };
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/types/tag.ts
17
+ var tag_exports = {};
18
+ module.exports = __toCommonJS(tag_exports);
File without changes
@@ -0,0 +1,29 @@
1
+ type WebsiteListeItem = {
2
+ id: string;
3
+ url: string;
4
+ domain: string;
5
+ title: string;
6
+ description: string;
7
+ ogSiteName: string;
8
+ ogTitle: string;
9
+ ogType: string;
10
+ ogUrl: string;
11
+ ogImage?: OgImage | null;
12
+ ogDescription: string;
13
+ ogLocale: string;
14
+ documents: Document[];
15
+ };
16
+ type OgImage = {
17
+ id: string;
18
+ fileUrl?: string | null;
19
+ height: number;
20
+ width: number;
21
+ };
22
+ type Document = {
23
+ id: string;
24
+ draft: boolean;
25
+ title: string;
26
+ slug: string;
27
+ };
28
+
29
+ export type { WebsiteListeItem };
@@ -0,0 +1,29 @@
1
+ type WebsiteListeItem = {
2
+ id: string;
3
+ url: string;
4
+ domain: string;
5
+ title: string;
6
+ description: string;
7
+ ogSiteName: string;
8
+ ogTitle: string;
9
+ ogType: string;
10
+ ogUrl: string;
11
+ ogImage?: OgImage | null;
12
+ ogDescription: string;
13
+ ogLocale: string;
14
+ documents: Document[];
15
+ };
16
+ type OgImage = {
17
+ id: string;
18
+ fileUrl?: string | null;
19
+ height: number;
20
+ width: number;
21
+ };
22
+ type Document = {
23
+ id: string;
24
+ draft: boolean;
25
+ title: string;
26
+ slug: string;
27
+ };
28
+
29
+ export type { WebsiteListeItem };
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/types/website.ts
17
+ var website_exports = {};
18
+ module.exports = __toCommonJS(website_exports);
File without changes
@@ -0,0 +1,2 @@
1
+ export { default as makeAfterCursorFromPage } from './make-after-cursor-from-page.mjs';
2
+ export { default as toArrayFromEdges } from './to-array-from-edges.mjs';
@@ -0,0 +1,2 @@
1
+ export { default as makeAfterCursorFromPage } from './make-after-cursor-from-page.js';
2
+ export { default as toArrayFromEdges } from './to-array-from-edges.js';
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/utils/index.ts
21
+ var utils_exports = {};
22
+ __export(utils_exports, {
23
+ makeAfterCursorFromPage: () => makeAfterCursorFromPage,
24
+ toArrayFromEdges: () => toArrayFromEdges
25
+ });
26
+ module.exports = __toCommonJS(utils_exports);
27
+
28
+ // src/utils/make-after-cursor-from-page.ts
29
+ function makeAfterCursorFromPage(page, first) {
30
+ const after = (page - 1) * first;
31
+ if (after === 0) {
32
+ return void 0;
33
+ }
34
+ return Buffer.from(after.toString()).toString("base64");
35
+ }
36
+
37
+ // src/utils/non-nullable-filter.ts
38
+ var nonNullableFilter = (value) => value != null;
39
+
40
+ // src/utils/to-array-from-edges.ts
41
+ function toArrayFromEdges(edges) {
42
+ if (!edges) return [];
43
+ return edges.map((edge) => edge?.node).filter(nonNullableFilter) ?? [];
44
+ }
45
+ // Annotate the CommonJS export names for ESM import in node:
46
+ 0 && (module.exports = {
47
+ makeAfterCursorFromPage,
48
+ toArrayFromEdges
49
+ });
@@ -0,0 +1,12 @@
1
+ import "../chunk-VKWT2GNZ.mjs";
2
+ import {
3
+ makeAfterCursorFromPage
4
+ } from "../chunk-PUTNZ4GU.mjs";
5
+ import {
6
+ toArrayFromEdges
7
+ } from "../chunk-C3G2CMRR.mjs";
8
+ import "../chunk-PA32N4A6.mjs";
9
+ export {
10
+ makeAfterCursorFromPage,
11
+ toArrayFromEdges
12
+ };
@@ -0,0 +1,3 @@
1
+ declare function makeAfterCursorFromPage(page: number, first: number): string | undefined;
2
+
3
+ export { makeAfterCursorFromPage as default };
@@ -0,0 +1,3 @@
1
+ declare function makeAfterCursorFromPage(page: number, first: number): string | undefined;
2
+
3
+ export { makeAfterCursorFromPage as default };
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/utils/make-after-cursor-from-page.ts
21
+ var make_after_cursor_from_page_exports = {};
22
+ __export(make_after_cursor_from_page_exports, {
23
+ default: () => makeAfterCursorFromPage
24
+ });
25
+ module.exports = __toCommonJS(make_after_cursor_from_page_exports);
26
+ function makeAfterCursorFromPage(page, first) {
27
+ const after = (page - 1) * first;
28
+ if (after === 0) {
29
+ return void 0;
30
+ }
31
+ return Buffer.from(after.toString()).toString("base64");
32
+ }
@@ -0,0 +1,6 @@
1
+ import {
2
+ makeAfterCursorFromPage
3
+ } from "../chunk-PUTNZ4GU.mjs";
4
+ export {
5
+ makeAfterCursorFromPage as default
6
+ };
@@ -0,0 +1,3 @@
1
+ declare const nonNullableFilter: <T>(value: T) => value is NonNullable<typeof value>;
2
+
3
+ export { nonNullableFilter };
@@ -0,0 +1,3 @@
1
+ declare const nonNullableFilter: <T>(value: T) => value is NonNullable<typeof value>;
2
+
3
+ export { nonNullableFilter };
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/utils/non-nullable-filter.ts
21
+ var non_nullable_filter_exports = {};
22
+ __export(non_nullable_filter_exports, {
23
+ nonNullableFilter: () => nonNullableFilter
24
+ });
25
+ module.exports = __toCommonJS(non_nullable_filter_exports);
26
+ var nonNullableFilter = (value) => value != null;
27
+ // Annotate the CommonJS export names for ESM import in node:
28
+ 0 && (module.exports = {
29
+ nonNullableFilter
30
+ });
@@ -0,0 +1,6 @@
1
+ import {
2
+ nonNullableFilter
3
+ } from "../chunk-PA32N4A6.mjs";
4
+ export {
5
+ nonNullableFilter
6
+ };
@@ -0,0 +1,6 @@
1
+ type Edges<T> = ({
2
+ node?: T | null | undefined;
3
+ } | null)[] | null | undefined;
4
+ declare function toArrayFromEdges<T>(edges: Edges<T>): (T & {})[];
5
+
6
+ export { toArrayFromEdges as default };
@@ -0,0 +1,6 @@
1
+ type Edges<T> = ({
2
+ node?: T | null | undefined;
3
+ } | null)[] | null | undefined;
4
+ declare function toArrayFromEdges<T>(edges: Edges<T>): (T & {})[];
5
+
6
+ export { toArrayFromEdges as default };
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/utils/to-array-from-edges.ts
21
+ var to_array_from_edges_exports = {};
22
+ __export(to_array_from_edges_exports, {
23
+ default: () => toArrayFromEdges
24
+ });
25
+ module.exports = __toCommonJS(to_array_from_edges_exports);
26
+
27
+ // src/utils/non-nullable-filter.ts
28
+ var nonNullableFilter = (value) => value != null;
29
+
30
+ // src/utils/to-array-from-edges.ts
31
+ function toArrayFromEdges(edges) {
32
+ if (!edges) return [];
33
+ return edges.map((edge) => edge?.node).filter(nonNullableFilter) ?? [];
34
+ }
@@ -0,0 +1,7 @@
1
+ import {
2
+ toArrayFromEdges
3
+ } from "../chunk-C3G2CMRR.mjs";
4
+ import "../chunk-PA32N4A6.mjs";
5
+ export {
6
+ toArrayFromEdges as default
7
+ };
package/license.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Hacker Sheet
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@hackersheet/core",
3
+ "version": "0.1.0-alpha.1",
4
+ "description": "A core package that includes Hacker Sheet's GraphQL API client.",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "require": "./dist/index.js",
11
+ "import": "./dist/index.mjs",
12
+ "types": "./dist/index.d.ts"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "keywords": [],
19
+ "author": "",
20
+ "license": "MIT",
21
+ "devDependencies": {
22
+ "@graphql-typed-document-node/core": "3.2.0",
23
+ "@urql/core": "5.0.4",
24
+ "graphql": "16.9.0",
25
+ "@hackersheet/eslint-config-custom": "0.0.0"
26
+ },
27
+ "scripts": {
28
+ "build": "rm -rf ./dist && pnpm tsup ./src",
29
+ "test": "echo \"Error: no test specified\" && exit 1",
30
+ "lint": "eslint \"**/*.{ts,tsx}\"",
31
+ "lint:fix": "eslint --fix \"**/*.{ts,tsx}\"",
32
+ "format": "pnpm -w format && pnpm lint:fix",
33
+ "check": "pnpm tsc && pnpm lint",
34
+ "pub": "pnpm publish --access=public --tag alpha"
35
+ }
36
+ }