@seed-hypermedia/client 0.0.1 → 0.0.2
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/auto-link.d.ts +61 -0
- package/dist/block-diff.d.ts +62 -0
- package/dist/blocks-to-markdown.d.ts +33 -0
- package/dist/change.d.ts +7 -0
- package/dist/{chunk-YUKHBJYL.mjs → chunk-PPK3SKPV.mjs} +253 -6
- package/dist/client.d.ts +1 -1
- package/dist/comment.d.ts +5 -0
- package/dist/contact.d.ts +16 -2
- package/dist/document-state.d.ts +23 -0
- package/dist/file-to-ipfs.d.ts +53 -0
- package/dist/grobid.d.ts +22 -0
- package/dist/hm-types.d.ts +2935 -202
- package/dist/hm-types.mjs +47 -1
- package/dist/index.d.ts +33 -13
- package/dist/index.mjs +2378 -64
- package/dist/markdown-to-blocks.d.ts +88 -0
- package/dist/pdf-to-blocks-embedded.d.ts +23 -0
- package/dist/pdf-to-blocks.d.ts +55 -0
- package/dist/ref.d.ts +2 -0
- package/dist/tei-to-blocks.d.ts +52 -0
- package/package.json +45 -17
- package/src/index.ts +74 -0
- package/LICENSE +0 -201
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Markdown → Seed block tree parser.
|
|
3
|
+
*
|
|
4
|
+
* Converts markdown content into a tree of Seed Hypermedia blocks
|
|
5
|
+
* with proper hierarchy: headings contain their content as children,
|
|
6
|
+
* lists use childrenType attributes, and inline formatting becomes
|
|
7
|
+
* annotations.
|
|
8
|
+
*
|
|
9
|
+
* Supports:
|
|
10
|
+
* - YAML frontmatter (--- delimited) for metadata extraction
|
|
11
|
+
* -  image syntax for Image blocks
|
|
12
|
+
* - $$ delimited math blocks
|
|
13
|
+
* - Block ID preservation via <!-- id:XXXXXXXX --> HTML comments
|
|
14
|
+
* - `title:` as backward-compatible alias for `name:` in frontmatter
|
|
15
|
+
*/
|
|
16
|
+
import type { HMMetadata } from './hm-types';
|
|
17
|
+
import type { DocumentOperation } from './change';
|
|
18
|
+
export type Annotation = {
|
|
19
|
+
type: string;
|
|
20
|
+
starts: number[];
|
|
21
|
+
ends: number[];
|
|
22
|
+
link?: string;
|
|
23
|
+
};
|
|
24
|
+
export type SeedBlock = {
|
|
25
|
+
type: string;
|
|
26
|
+
id: string;
|
|
27
|
+
text: string;
|
|
28
|
+
annotations: Annotation[];
|
|
29
|
+
childrenType?: string;
|
|
30
|
+
language?: string;
|
|
31
|
+
link?: string;
|
|
32
|
+
};
|
|
33
|
+
export type BlockNode = {
|
|
34
|
+
block: SeedBlock;
|
|
35
|
+
children: BlockNode[];
|
|
36
|
+
};
|
|
37
|
+
type InlineParseResult = {
|
|
38
|
+
text: string;
|
|
39
|
+
annotations: Annotation[];
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Parses inline markdown formatting into plain text + annotation spans.
|
|
43
|
+
* Supports: **bold**, *italic*, `code`, [text](url)
|
|
44
|
+
*/
|
|
45
|
+
export declare function parseInlineFormatting(raw: string): InlineParseResult;
|
|
46
|
+
/**
|
|
47
|
+
* Strip YAML frontmatter (--- delimited) from markdown content.
|
|
48
|
+
* Returns the remaining content and any parsed metadata.
|
|
49
|
+
*
|
|
50
|
+
* Frontmatter keys map 1:1 to HMMetadata field names (e.g. `name:`,
|
|
51
|
+
* `displayAuthor:`, `displayPublishTime:`, `cover:`, etc.).
|
|
52
|
+
*
|
|
53
|
+
* Also accepts `title:` as a backward-compatible alias for `name:`.
|
|
54
|
+
*/
|
|
55
|
+
export declare function parseFrontmatter(markdown: string): {
|
|
56
|
+
content: string;
|
|
57
|
+
metadata: HMMetadata;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Builds a hierarchical block tree from markdown.
|
|
61
|
+
*
|
|
62
|
+
* The hierarchy is determined by heading levels:
|
|
63
|
+
* - H1 headings are root-level blocks; lower headings and content become children
|
|
64
|
+
* - H2 headings become children of the preceding H1, etc.
|
|
65
|
+
* - Content before the first heading goes to root level
|
|
66
|
+
*
|
|
67
|
+
* YAML frontmatter (--- delimited) is parsed for document metadata
|
|
68
|
+
* (all HMMetadata fields) and stripped from the content before tokenizing.
|
|
69
|
+
*
|
|
70
|
+
* Block IDs from `<!-- id:XXXXXXXX -->` HTML comments are preserved.
|
|
71
|
+
* When no ID is present, random 8-char IDs are generated.
|
|
72
|
+
*/
|
|
73
|
+
export declare function parseMarkdown(markdown: string): {
|
|
74
|
+
tree: BlockNode[];
|
|
75
|
+
metadata: HMMetadata;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Flattens a block tree into Seed document operations.
|
|
79
|
+
*
|
|
80
|
+
* For each block:
|
|
81
|
+
* 1. ReplaceBlock — defines the block content
|
|
82
|
+
* 2. MoveBlocks — positions the block under its parent
|
|
83
|
+
*
|
|
84
|
+
* Operations are ordered so that ReplaceBlock comes before MoveBlocks
|
|
85
|
+
* for each level, and children are processed recursively.
|
|
86
|
+
*/
|
|
87
|
+
export declare function flattenToOperations(tree: BlockNode[], parentId?: string): DocumentOperation[];
|
|
88
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Embedded PDF-to-HMBlockNode converter using pdfjs-dist.
|
|
3
|
+
*
|
|
4
|
+
* Extracts text from PDFs using Mozilla's PDF.js and converts to Seed
|
|
5
|
+
* Hypermedia blocks via font-size clustering and heuristic detection.
|
|
6
|
+
*
|
|
7
|
+
* This is the fallback path when no GROBID server is available.
|
|
8
|
+
* Requires `pdfjs-dist` to be installed (optional peer dependency).
|
|
9
|
+
*/
|
|
10
|
+
import type { HMBlockNode, HMMetadata } from './hm-types';
|
|
11
|
+
export type EmbeddedPdfResult = {
|
|
12
|
+
metadata: Pick<HMMetadata, 'name'>;
|
|
13
|
+
blocks: HMBlockNode[];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Convert PDF binary data to HM blocks using pdfjs-dist (embedded, no server required).
|
|
17
|
+
*
|
|
18
|
+
* Uses font-size clustering for heading detection, font-name heuristics for
|
|
19
|
+
* bold/italic/monospace, and regex patterns for list detection.
|
|
20
|
+
*
|
|
21
|
+
* @throws Error if pdfjs-dist is not installed
|
|
22
|
+
*/
|
|
23
|
+
export declare function embeddedPdfToBlocks(pdfData: ArrayBuffer): Promise<EmbeddedPdfResult>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified PDF-to-HMBlockNode converter.
|
|
3
|
+
*
|
|
4
|
+
* Uses embedded pdfjs-dist extraction by default (no server needed).
|
|
5
|
+
* When a GROBID server URL is provided, uses GROBID for high-fidelity
|
|
6
|
+
* ML-based extraction (better for academic papers).
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import {pdfToBlocks} from '@seed-hypermedia/client'
|
|
11
|
+
*
|
|
12
|
+
* // Embedded extraction (default, no server needed)
|
|
13
|
+
* const result = await pdfToBlocks(pdfArrayBuffer)
|
|
14
|
+
*
|
|
15
|
+
* // Use GROBID for higher fidelity
|
|
16
|
+
* const result = await pdfToBlocks(pdfArrayBuffer, {
|
|
17
|
+
* grobidUrl: 'http://localhost:8070',
|
|
18
|
+
* })
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
import type { HMBlockNode, HMMetadata } from './hm-types';
|
|
22
|
+
import type { GrobidOptions } from './grobid';
|
|
23
|
+
import type { TeiToBlocksOptions } from './tei-to-blocks';
|
|
24
|
+
/** Options for the unified PDF-to-blocks converter. */
|
|
25
|
+
export type PdfToBlocksOptions = {
|
|
26
|
+
/** GROBID server URL. When provided, GROBID is used instead of embedded extraction. */
|
|
27
|
+
grobidUrl?: string;
|
|
28
|
+
/** GROBID health-check timeout in milliseconds (default: 3000). */
|
|
29
|
+
grobidTimeoutMs?: number;
|
|
30
|
+
/** Options passed to the TEI-to-blocks converter (GROBID path only). */
|
|
31
|
+
teiOptions?: TeiToBlocksOptions;
|
|
32
|
+
/** Options passed to the GROBID API (e.g. teiCoordinates). */
|
|
33
|
+
grobidOptions?: Pick<GrobidOptions, 'teiCoordinates'>;
|
|
34
|
+
};
|
|
35
|
+
/** Result of the PDF-to-blocks conversion. */
|
|
36
|
+
export type PdfToBlocksResult = {
|
|
37
|
+
/** Document metadata (title, authors, abstract, etc.). */
|
|
38
|
+
metadata: Pick<HMMetadata, 'name' | 'summary' | 'displayPublishTime' | 'displayAuthor'>;
|
|
39
|
+
/** Document content as a hierarchical block tree. */
|
|
40
|
+
blocks: HMBlockNode[];
|
|
41
|
+
/** Which extraction method was used. */
|
|
42
|
+
source: 'grobid' | 'embedded';
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Convert a PDF to Seed Hypermedia blocks.
|
|
46
|
+
*
|
|
47
|
+
* Uses embedded pdfjs-dist extraction by default. When `grobidUrl` is
|
|
48
|
+
* provided, connects to a GROBID server for higher-fidelity extraction
|
|
49
|
+
* (academic papers, structured documents with references, figures, etc.).
|
|
50
|
+
*
|
|
51
|
+
* @param pdfData - Raw PDF file content as ArrayBuffer
|
|
52
|
+
* @param options - Extraction options
|
|
53
|
+
* @returns Metadata, block tree, and which source was used
|
|
54
|
+
*/
|
|
55
|
+
export declare function pdfToBlocks(pdfData: ArrayBuffer, options?: PdfToBlocksOptions): Promise<PdfToBlocksResult>;
|
package/dist/ref.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ export type CreateVersionRefInput = {
|
|
|
15
15
|
generation: number;
|
|
16
16
|
/** Optional capability CID string */
|
|
17
17
|
capability?: string;
|
|
18
|
+
/** Optional CBOR visibility value (e.g., "Private"). Omit or leave empty for public. */
|
|
19
|
+
visibility?: string;
|
|
18
20
|
};
|
|
19
21
|
export type CreateTombstoneRefInput = {
|
|
20
22
|
/** Account UID (base58btc-encoded principal) */
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { HMBlockNode, HMMetadata } from './hm-types';
|
|
2
|
+
/** Bounding-box information GROBID attaches when `teiCoordinates=figure`. */
|
|
3
|
+
export type FigureCoords = {
|
|
4
|
+
page: number;
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
};
|
|
10
|
+
/** Information about a figure extracted from the TEI. */
|
|
11
|
+
export type TeiFigure = {
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
caption: string;
|
|
15
|
+
coords: FigureCoords | null;
|
|
16
|
+
};
|
|
17
|
+
/** Options for the TEI-to-blocks converter. */
|
|
18
|
+
export type TeiToBlocksOptions = {
|
|
19
|
+
/**
|
|
20
|
+
* Called for each `<figure>` that has bounding-box coordinates.
|
|
21
|
+
* Return an `ipfs://CID` URL string to embed the image, or `null` to skip.
|
|
22
|
+
*/
|
|
23
|
+
extractFigureImage?: (figure: TeiFigure) => Promise<string | null>;
|
|
24
|
+
};
|
|
25
|
+
/** Result of the TEI-to-blocks conversion. */
|
|
26
|
+
export type TeiToBlocksResult = {
|
|
27
|
+
metadata: Pick<HMMetadata, 'name' | 'summary' | 'displayPublishTime' | 'displayAuthor'>;
|
|
28
|
+
blocks: HMBlockNode[];
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Convert GROBID TEI XML into Seed Hypermedia blocks and metadata.
|
|
32
|
+
*
|
|
33
|
+
* @param teiXml - Raw TEI XML string from GROBID's processFulltextDocument
|
|
34
|
+
* @param opts - Optional callbacks for figure image extraction
|
|
35
|
+
* @returns Metadata (title, authors, abstract) and block tree
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const teiXml = await fetch('http://localhost:8070/api/processFulltextDocument', {
|
|
40
|
+
* method: 'POST',
|
|
41
|
+
* body: formData,
|
|
42
|
+
* }).then(r => r.text())
|
|
43
|
+
*
|
|
44
|
+
* const {metadata, blocks} = await teiToBlocks(teiXml, {
|
|
45
|
+
* extractFigureImage: async (fig) => {
|
|
46
|
+
* // render PDF region, upload to IPFS, return ipfs://CID
|
|
47
|
+
* return `ipfs://${cid}`
|
|
48
|
+
* },
|
|
49
|
+
* })
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare function teiToBlocks(teiXml: string, opts?: TeiToBlocksOptions): Promise<TeiToBlocksResult>;
|
package/package.json
CHANGED
|
@@ -1,28 +1,57 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seed-hypermedia/client",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/seed-hypermedia/seed",
|
|
7
|
+
"directory": "frontend/packages/client"
|
|
8
|
+
},
|
|
9
|
+
"main": "src/index.ts",
|
|
10
|
+
"types": "src/index.ts",
|
|
6
11
|
"exports": {
|
|
7
12
|
".": {
|
|
8
|
-
"
|
|
9
|
-
"types": "./dist/index.d.ts"
|
|
13
|
+
"default": "./src/index.ts"
|
|
10
14
|
},
|
|
11
15
|
"./*": {
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
"default": "./src/*.ts"
|
|
17
|
+
},
|
|
18
|
+
"./package.json": "./package.json"
|
|
15
19
|
},
|
|
16
20
|
"files": [
|
|
17
21
|
"dist"
|
|
18
22
|
],
|
|
23
|
+
"sideEffects": false,
|
|
19
24
|
"publishConfig": {
|
|
20
|
-
"access": "public"
|
|
25
|
+
"access": "public",
|
|
26
|
+
"main": "./dist/index.js",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"import": "./dist/index.js",
|
|
31
|
+
"types": "./dist/index.d.ts"
|
|
32
|
+
},
|
|
33
|
+
"./*": {
|
|
34
|
+
"import": "./dist/*.js",
|
|
35
|
+
"types": "./dist/*.d.ts"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "tsup && tsc --project tsconfig.build.json",
|
|
41
|
+
"format:check": "prettier --check .",
|
|
42
|
+
"format:write": "prettier --write .",
|
|
43
|
+
"prepublishOnly": "pnpm build",
|
|
44
|
+
"test": "vitest --run",
|
|
45
|
+
"typecheck": "tsc --noEmit --project tsconfig.app.json"
|
|
21
46
|
},
|
|
22
47
|
"dependencies": {
|
|
23
48
|
"@ipld/dag-cbor": "^9.2.5",
|
|
49
|
+
"blockstore-core": "^5.0.2",
|
|
50
|
+
"cheerio": "^1.2.0",
|
|
51
|
+
"ipfs-unixfs-importer": "^15.3.2",
|
|
24
52
|
"multiformats": "^13.4.1",
|
|
25
|
-
"superjson": "2.2.1"
|
|
53
|
+
"superjson": "2.2.1",
|
|
54
|
+
"yaml": "^2.6.0"
|
|
26
55
|
},
|
|
27
56
|
"devDependencies": {
|
|
28
57
|
"tsup": "^8.5.1",
|
|
@@ -31,13 +60,12 @@
|
|
|
31
60
|
"zod": "3.25.76"
|
|
32
61
|
},
|
|
33
62
|
"peerDependencies": {
|
|
63
|
+
"pdfjs-dist": "^4.2.67",
|
|
34
64
|
"zod": ">=3.20.0"
|
|
35
65
|
},
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"test": "vitest --run",
|
|
41
|
-
"typecheck": "tsc --noEmit --project tsconfig.app.json"
|
|
66
|
+
"peerDependenciesMeta": {
|
|
67
|
+
"pdfjs-dist": {
|
|
68
|
+
"optional": true
|
|
69
|
+
}
|
|
42
70
|
}
|
|
43
|
-
}
|
|
71
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export {createCapability} from './capability'
|
|
2
|
+
export type {CapabilityRole, CreateCapabilityInput} from './capability'
|
|
3
|
+
export {
|
|
4
|
+
createChange,
|
|
5
|
+
createChangeOps,
|
|
6
|
+
createDocumentChange,
|
|
7
|
+
createDocumentChangeFromOps,
|
|
8
|
+
createGenesisChange,
|
|
9
|
+
signDocumentChange,
|
|
10
|
+
signPreparedChange,
|
|
11
|
+
} from './change'
|
|
12
|
+
export type {
|
|
13
|
+
CreateChangeOpsInput,
|
|
14
|
+
CreateDocumentChangeFromOpsInput,
|
|
15
|
+
CreateDocumentChangeInput,
|
|
16
|
+
DocumentOperation,
|
|
17
|
+
SignDocumentChangeInput,
|
|
18
|
+
} from './change'
|
|
19
|
+
export {createSeedClient} from './client'
|
|
20
|
+
export type {PublishDocumentInput, SeedClient, SeedClientOptions} from './client'
|
|
21
|
+
export {commentRecordIdFromBlob, createComment, deleteComment} from './comment'
|
|
22
|
+
export type {CommentAttachmentBlob, CreateCommentInput, DeleteCommentInput} from './comment'
|
|
23
|
+
export {contactRecordIdFromBlob, createContact, deleteContact, updateContact} from './contact'
|
|
24
|
+
export type {CreateContactInput, CreateContactResult, DeleteContactInput, UpdateContactInput} from './contact'
|
|
25
|
+
export {SeedClientError, SeedNetworkError, SeedValidationError} from './errors'
|
|
26
|
+
export {createRedirectRef, createTombstoneRef, createVersionRef} from './ref'
|
|
27
|
+
export type {CreateRedirectRefInput, CreateTombstoneRefInput, CreateVersionRefInput} from './ref'
|
|
28
|
+
export {teiToBlocks} from './tei-to-blocks'
|
|
29
|
+
export type {TeiToBlocksOptions, TeiToBlocksResult, TeiFigure, FigureCoords} from './tei-to-blocks'
|
|
30
|
+
export {pdfToBlocks} from './pdf-to-blocks'
|
|
31
|
+
export type {PdfToBlocksOptions, PdfToBlocksResult} from './pdf-to-blocks'
|
|
32
|
+
export {isGrobidAvailable, processFulltextDocument, DEFAULT_GROBID_URL} from './grobid'
|
|
33
|
+
export type {GrobidOptions} from './grobid'
|
|
34
|
+
export {embeddedPdfToBlocks} from './pdf-to-blocks-embedded'
|
|
35
|
+
export type {EmbeddedPdfResult} from './pdf-to-blocks-embedded'
|
|
36
|
+
|
|
37
|
+
export {trimTrailingEmptyBlocks} from './comment'
|
|
38
|
+
export {
|
|
39
|
+
codePointLength,
|
|
40
|
+
entityQueryPathToHmIdPath,
|
|
41
|
+
getHMQueryString,
|
|
42
|
+
hmIdPathToEntityQueryPath,
|
|
43
|
+
HYPERMEDIA_SCHEME,
|
|
44
|
+
isSurrogate,
|
|
45
|
+
packBaseId,
|
|
46
|
+
packHmId,
|
|
47
|
+
parseCustomURL,
|
|
48
|
+
parseFragment,
|
|
49
|
+
serializeBlockRange,
|
|
50
|
+
unpackHmId,
|
|
51
|
+
} from './hm-types'
|
|
52
|
+
export type {HMRequest, HMSigner, UnpackedHypermediaId} from './hm-types'
|
|
53
|
+
|
|
54
|
+
export {fileToIpfsBlobs, filesToIpfsBlobs, resolveFileLinksInBlocks, hasFileLinks} from './file-to-ipfs'
|
|
55
|
+
export type {CollectedBlob} from './file-to-ipfs'
|
|
56
|
+
|
|
57
|
+
export {parseMarkdown, flattenToOperations, parseInlineFormatting, parseFrontmatter} from './markdown-to-blocks'
|
|
58
|
+
export type {BlockNode, SeedBlock, Annotation} from './markdown-to-blocks'
|
|
59
|
+
export {blocksToMarkdown, emitFrontmatter} from './blocks-to-markdown'
|
|
60
|
+
export type {BlocksToMarkdownOptions} from './blocks-to-markdown'
|
|
61
|
+
|
|
62
|
+
export {createBlocksMap, matchBlockIds, computeReplaceOps, hmBlockNodeToBlockNode} from './block-diff'
|
|
63
|
+
export type {APIBlockNode, APIBlock} from './block-diff'
|
|
64
|
+
|
|
65
|
+
export {
|
|
66
|
+
autoLinkChildToParent,
|
|
67
|
+
createAutoLinkOps,
|
|
68
|
+
documentContainsLinkToChild,
|
|
69
|
+
documentHasSelfQuery,
|
|
70
|
+
shouldAutoLinkParent,
|
|
71
|
+
} from './auto-link'
|
|
72
|
+
export type {AutoLinkChildToParentOptions} from './auto-link'
|
|
73
|
+
export {resolveDocumentState} from './document-state'
|
|
74
|
+
export type {DocumentState} from './document-state'
|
package/LICENSE
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright 2024 Mintter Inc.
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|