@fission-codes/homestar
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -32,2 +32,3 @@ import type { ZodTypeAny } from 'zod'; | ||
export type Placeholder = `{{${string}${`:${string}` | ''}}}`; | ||
export type DataURI = `data:${string};base64,${string}`; | ||
export interface InvocationOptions<Args extends Record<string, any> = Record<string, any>> { | ||
@@ -37,6 +38,9 @@ name: string; | ||
args: Args; | ||
/** | ||
* The resource to use for the invocation. This should be a URI but for now just pass the CID string. | ||
*/ | ||
resource: string; | ||
} | ||
export type CropInvocation = TemplateInvocation<[ | ||
CID | Placeholder, | ||
CID | Placeholder | DataURI, | ||
number, | ||
@@ -48,3 +52,3 @@ number, | ||
export type CropOptions = InvocationOptions<{ | ||
data: CID | Placeholder; | ||
data: CID | Placeholder | DataURI; | ||
x: number; | ||
@@ -55,13 +59,20 @@ y: number; | ||
}>; | ||
export type GrayscaleInvocation = TemplateInvocation<[CID | Placeholder]>; | ||
export type GrayscaleInvocation = TemplateInvocation<[ | ||
CID | Placeholder | DataURI | ||
]>; | ||
export type GrayscaleOptions = InvocationOptions<{ | ||
data: CID | Placeholder; | ||
data: CID | Placeholder | DataURI; | ||
}>; | ||
export type Rotate90Invocation = TemplateInvocation<[CID | Placeholder]>; | ||
export type Rotate90Invocation = TemplateInvocation<[ | ||
CID | Placeholder | DataURI | ||
]>; | ||
export type Rotate90Options = InvocationOptions<{ | ||
data: CID | Placeholder; | ||
data: CID | Placeholder | DataURI; | ||
}>; | ||
export type BlurInvocation = TemplateInvocation<[CID | Placeholder, number]>; | ||
export type BlurInvocation = TemplateInvocation<[ | ||
CID | Placeholder | DataURI, | ||
number | ||
]>; | ||
export type BlurOptions = InvocationOptions<{ | ||
data: CID | Placeholder; | ||
data: CID | Placeholder | DataURI; | ||
sigma: number; | ||
@@ -68,0 +79,0 @@ }>; |
@@ -24,2 +24,8 @@ /** | ||
* | ||
* @param {import('./types.js').GrayscaleOptions} opts | ||
* @returns {import('./types.js').GrayscaleInvocation} | ||
*/ | ||
export function grayscaleBase64(opts: import('./types.js').GrayscaleOptions): import('./types.js').GrayscaleInvocation; | ||
/** | ||
* | ||
* @param {import('./types.js').Rotate90Options} opts | ||
@@ -31,2 +37,8 @@ * @returns {import('./types.js').Rotate90Invocation} | ||
* | ||
* @param {import('./types.js').Rotate90Options} opts | ||
* @returns {import('./types.js').Rotate90Invocation} | ||
*/ | ||
export function rotate90Base64(opts: import('./types.js').Rotate90Options): import('./types.js').Rotate90Invocation; | ||
/** | ||
* | ||
* @param {import('./types.js').BlurOptions} opts | ||
@@ -33,0 +45,0 @@ * @returns {import('./types.js').BlurInvocation} |
{ | ||
"name": "@fission-codes/homestar", | ||
"type": "module", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "Homestart Client.", | ||
@@ -71,4 +71,4 @@ "author": "Hugo Dias <hugomrdias@gmail.com> (hugodias.me)", | ||
"p-defer": "^4.0.0", | ||
"playwright-test": "^12.4.3", | ||
"type-fest": "^4.6.0", | ||
"playwright-test": "^12.6.0", | ||
"type-fest": "^4.7.1", | ||
"unws": "^0.2.4", | ||
@@ -105,5 +105,5 @@ "ws": "^8.14.2" | ||
"test": "pnpm run test:node && pnpm run test:browser", | ||
"test:node": "playwright-test 'test/**/!(*.browser).test.js' --mode node", | ||
"test:browser": "playwright-test 'test/**/!(*.node).test.js'" | ||
"test:node": "playwright-test 'test/**/!(*.browser).test.js' --mode node --assets test/fixtures", | ||
"test:browser": "playwright-test 'test/**/!(*.node).test.js' --assets test/fixtures" | ||
} | ||
} |
@@ -19,3 +19,3 @@ # Homestar | ||
import { Homestar } from '@fission-codes/homestar' | ||
import { WebsocketTransport } from '@fission-codes/homestar/transports/ws' | ||
import { WebsocketTransport } from '@fission-codes/homestar/channel/transports/ws' | ||
@@ -22,0 +22,0 @@ // if you need isomorphic support |
@@ -41,2 +41,3 @@ import type { ZodTypeAny } from 'zod' | ||
export type Placeholder = `{{${string}${`:${string}` | ''}}}` | ||
export type DataURI = `data:${string};base64,${string}` | ||
@@ -49,2 +50,5 @@ export interface InvocationOptions< | ||
args: Args | ||
/** | ||
* The resource to use for the invocation. This should be a URI but for now just pass the CID string. | ||
*/ | ||
resource: string | ||
@@ -54,6 +58,6 @@ } | ||
export type CropInvocation = TemplateInvocation< | ||
[CID | Placeholder, number, number, number, number] | ||
[CID | Placeholder | DataURI, number, number, number, number] | ||
> | ||
export type CropOptions = InvocationOptions<{ | ||
data: CID | Placeholder | ||
data: CID | Placeholder | DataURI | ||
x: number | ||
@@ -65,15 +69,21 @@ y: number | ||
export type GrayscaleInvocation = TemplateInvocation<[CID | Placeholder]> | ||
export type GrayscaleInvocation = TemplateInvocation< | ||
[CID | Placeholder | DataURI] | ||
> | ||
export type GrayscaleOptions = InvocationOptions<{ | ||
data: CID | Placeholder | ||
data: CID | Placeholder | DataURI | ||
}> | ||
export type Rotate90Invocation = TemplateInvocation<[CID | Placeholder]> | ||
export type Rotate90Invocation = TemplateInvocation< | ||
[CID | Placeholder | DataURI] | ||
> | ||
export type Rotate90Options = InvocationOptions<{ | ||
data: CID | Placeholder | ||
data: CID | Placeholder | DataURI | ||
}> | ||
export type BlurInvocation = TemplateInvocation<[CID | Placeholder, number]> | ||
export type BlurInvocation = TemplateInvocation< | ||
[CID | Placeholder | DataURI, number] | ||
> | ||
export type BlurOptions = InvocationOptions<{ | ||
data: CID | Placeholder | ||
data: CID | Placeholder | DataURI | ||
sigma: number | ||
@@ -80,0 +90,0 @@ }> |
@@ -103,2 +103,11 @@ import { CID } from 'multiformats/cid' | ||
* | ||
* @param {import('./types.js').GrayscaleOptions} opts | ||
* @returns {import('./types.js').GrayscaleInvocation} | ||
*/ | ||
export function grayscaleBase64(opts) { | ||
return baseInvocation(opts, 'grayscale-base64', [opts.args.data]) | ||
} | ||
/** | ||
* | ||
* @param {import('./types.js').Rotate90Options} opts | ||
@@ -113,2 +122,11 @@ * @returns {import('./types.js').Rotate90Invocation} | ||
* | ||
* @param {import('./types.js').Rotate90Options} opts | ||
* @returns {import('./types.js').Rotate90Invocation} | ||
*/ | ||
export function rotate90Base64(opts) { | ||
return baseInvocation(opts, 'rotate90-base64', [opts.args.data]) | ||
} | ||
/** | ||
* | ||
* @param {import('./types.js').BlurOptions} opts | ||
@@ -192,3 +210,3 @@ * @returns {import('./types.js').BlurInvocation} | ||
op: 'wasm/run', | ||
rsc: opts.resource, | ||
rsc: 'ipfs://' + opts.resource, | ||
}, | ||
@@ -195,0 +213,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
72897
1870