@xyo-network/file-browser-plugin 4.2.0 → 5.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/file-browser-plugin",
3
- "version": "4.2.0",
3
+ "version": "5.0.1",
4
4
  "description": "Typescript/Javascript Plugins for XYO Platform",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -28,24 +28,28 @@
28
28
  },
29
29
  "module": "dist/browser/index.mjs",
30
30
  "types": "dist/browser/index.d.ts",
31
+ "files": [
32
+ "dist",
33
+ "src"
34
+ ],
31
35
  "dependencies": {
32
- "@scure/base": "^1.2.6",
33
- "@xylabs/assert": "^4.15.1",
34
- "@xylabs/promise": "^4.15.1",
35
- "@xyo-network/abstract-witness": "^4.3.0",
36
- "@xyo-network/module-model": "^4.3.0",
37
- "@xyo-network/payload-builder": "^4.3.0",
38
- "@xyo-network/payload-model": "^4.3.0",
39
- "@xyo-network/payloadset-plugin": "^4.3.0",
40
- "@xyo-network/witness-model": "^4.3.0"
36
+ "@scure/base": "~1.2.6",
37
+ "@xylabs/assert": "~5.0.7",
38
+ "@xylabs/promise": "~5.0.7",
39
+ "@xyo-network/abstract-witness": "~5.0.2",
40
+ "@xyo-network/module-model": "~5.0.2",
41
+ "@xyo-network/payload-builder": "~5.0.2",
42
+ "@xyo-network/payload-model": "~5.0.2",
43
+ "@xyo-network/payloadset-plugin": "~5.0.2",
44
+ "@xyo-network/witness-model": "~5.0.2"
41
45
  },
42
46
  "devDependencies": {
43
- "@types/sha.js": "^2.4.4",
44
- "@xylabs/ts-scripts-yarn3": "^7.0.1",
45
- "@xylabs/tsconfig": "^7.0.1",
46
- "@xylabs/vitest-extended": "^4.15.1",
47
- "typescript": "^5.8.3",
48
- "vitest": "^3.2.4"
47
+ "@types/sha.js": "~2.4.4",
48
+ "@xylabs/ts-scripts-yarn3": "~7.1.0",
49
+ "@xylabs/tsconfig": "~7.1.0",
50
+ "@xylabs/vitest-extended": "~5.0.7",
51
+ "typescript": "~5.9.2",
52
+ "vitest": "~3.2.4"
49
53
  },
50
54
  "publishConfig": {
51
55
  "access": "public"
@@ -0,0 +1,41 @@
1
+ import '@xylabs/vitest-extended'
2
+
3
+ import {
4
+ beforeEach, describe, expect, test,
5
+ } from 'vitest'
6
+
7
+ import { BrowserFileWitness } from '../BrowserFileWitness.ts'
8
+ import { FileWitnessConfigSchema } from '../Config.ts'
9
+ import { isFilePayload } from '../Payload.ts'
10
+
11
+ // Leave off modified since its a timestamp and won't be known till the test runs
12
+ const expectedFilePayload = {
13
+ hash: '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08',
14
+ length: 4,
15
+ meta: { name: 'test.txt', type: 'text/plain' },
16
+ schema: 'network.xyo.file',
17
+ uri: 'data:application/octet-stream;base64,dGVzdA==',
18
+ }
19
+
20
+ describe('FileWitness', () => {
21
+ let browserFileWitness: BrowserFileWitness
22
+
23
+ beforeEach(async () => {
24
+ const file = new File(['test'], 'test.txt', { type: 'text/plain' })
25
+
26
+ browserFileWitness = await BrowserFileWitness.create({
27
+ account: 'random',
28
+ config: {
29
+ name: 'BrowserFileWitness', schema: FileWitnessConfigSchema, storage: 'data-uri',
30
+ },
31
+ ...(file ? { file } : {}),
32
+ })
33
+ })
34
+
35
+ test('BrowserFileWitness', async () => {
36
+ expect(browserFileWitness).toBeDefined()
37
+ const [payload] = await browserFileWitness.observe()
38
+ expect(isFilePayload(payload)).toBeTrue()
39
+ expect(payload).toMatchObject(expectedFilePayload)
40
+ })
41
+ })
package/typedoc.json DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "$schema": "https://typedoc.org/schema.json",
3
- "entryPoints": ["./src/indexNode.ts"],
4
- "tsconfig": "./tsconfig.typedoc.json"
5
- }
package/xy.config.ts DELETED
@@ -1,10 +0,0 @@
1
- import type { XyTsupConfig } from '@xylabs/ts-scripts-yarn3'
2
- const config: XyTsupConfig = {
3
- compile: {
4
- browser: { src: true },
5
- neutral: {},
6
- node: {},
7
- },
8
- }
9
-
10
- export default config