@nodaro/sdk 2.4.0 → 2.5.0
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/index.cjs +17 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +59 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -4679,6 +4679,65 @@ declare class MediaResource {
|
|
|
4679
4679
|
}): Promise<{
|
|
4680
4680
|
jobId: string;
|
|
4681
4681
|
}>;
|
|
4682
|
+
/**
|
|
4683
|
+
* Place 1–12 layers — pictures, real text, QR codes, shapes — on a base image,
|
|
4684
|
+
* pixel-exactly (`POST /v1/image-overlay`) — local, deterministic, no AI.
|
|
4685
|
+
* Every layer position/size is a PERCENT of the base image: `anchor` (nine
|
|
4686
|
+
* positions, default `"center"`), `x`/`y` (offset from the anchor in % of
|
|
4687
|
+
* the base width/height; negative on a right/bottom anchor moves inward),
|
|
4688
|
+
* `width` (% of the base width, default 25 — height follows the layer's
|
|
4689
|
+
* aspect unless `height` is set). Plus `opacity` (0..1), `rotation`
|
|
4690
|
+
* (degrees), `blend` (`"over"` | `"multiply"` | `"screen"`), `fit`,
|
|
4691
|
+
* `shadow` and `roundedCorners`. The output keeps the base's pixel size
|
|
4692
|
+
* unless `canvas` is set. Flat credit cost. Poll `jobs.get(jobId)` for the
|
|
4693
|
+
* finished image.
|
|
4694
|
+
*/
|
|
4695
|
+
imageOverlay(input: {
|
|
4696
|
+
imageUrl: string;
|
|
4697
|
+
layers: Array<{
|
|
4698
|
+
imageUrl: string;
|
|
4699
|
+
anchor?: "top-left" | "top" | "top-right" | "left" | "center" | "right" | "bottom-left" | "bottom" | "bottom-right";
|
|
4700
|
+
x?: number;
|
|
4701
|
+
y?: number;
|
|
4702
|
+
width?: number;
|
|
4703
|
+
height?: number;
|
|
4704
|
+
opacity?: number;
|
|
4705
|
+
rotation?: number;
|
|
4706
|
+
blend?: "over" | "multiply" | "screen";
|
|
4707
|
+
fit?: "contain" | "cover" | "stretch";
|
|
4708
|
+
shadow?: {
|
|
4709
|
+
blur: number;
|
|
4710
|
+
offsetX: number;
|
|
4711
|
+
offsetY: number;
|
|
4712
|
+
color: string;
|
|
4713
|
+
opacity: number;
|
|
4714
|
+
};
|
|
4715
|
+
roundedCorners?: number;
|
|
4716
|
+
zIndex?: number;
|
|
4717
|
+
/** "image" (default, needs imageUrl) | "text" | "qr" | "shape" — see @nodaro/shared image-overlay-layers. */
|
|
4718
|
+
kind?: "image" | "text" | "qr" | "shape";
|
|
4719
|
+
text?: Record<string, unknown>;
|
|
4720
|
+
qr?: Record<string, unknown>;
|
|
4721
|
+
shape?: Record<string, unknown>;
|
|
4722
|
+
effects?: Record<string, unknown>;
|
|
4723
|
+
}>;
|
|
4724
|
+
canvas?: {
|
|
4725
|
+
width: number;
|
|
4726
|
+
height: number;
|
|
4727
|
+
backgroundColor?: string;
|
|
4728
|
+
};
|
|
4729
|
+
baseFit?: "contain" | "cover";
|
|
4730
|
+
outputFormat?: "png" | "jpg" | "webp";
|
|
4731
|
+
/** Extra platform renders (see OVERLAY_PLATFORMS in @nodaro/shared); returned as output `variants[]`. */
|
|
4732
|
+
variants?: string[];
|
|
4733
|
+
/** The mask the job also emits as output `maskUrl` (white = may change). Default "around". */
|
|
4734
|
+
maskMode?: "none" | "layers" | "around" | "outside";
|
|
4735
|
+
maskSpread?: number;
|
|
4736
|
+
/** Fills every QR layer whose `qr.fromInput` is true — the node's QR link handle. */
|
|
4737
|
+
qrText?: string;
|
|
4738
|
+
}): Promise<{
|
|
4739
|
+
jobId: string;
|
|
4740
|
+
}>;
|
|
4682
4741
|
/**
|
|
4683
4742
|
* Trim a video to a range (`POST /v1/trim-video`). Give the range in whichever
|
|
4684
4743
|
* unit fits: `startTime`/`endTime` seconds, `trim*Frames`, `trim*Seconds`, or
|
package/dist/index.d.ts
CHANGED
|
@@ -4679,6 +4679,65 @@ declare class MediaResource {
|
|
|
4679
4679
|
}): Promise<{
|
|
4680
4680
|
jobId: string;
|
|
4681
4681
|
}>;
|
|
4682
|
+
/**
|
|
4683
|
+
* Place 1–12 layers — pictures, real text, QR codes, shapes — on a base image,
|
|
4684
|
+
* pixel-exactly (`POST /v1/image-overlay`) — local, deterministic, no AI.
|
|
4685
|
+
* Every layer position/size is a PERCENT of the base image: `anchor` (nine
|
|
4686
|
+
* positions, default `"center"`), `x`/`y` (offset from the anchor in % of
|
|
4687
|
+
* the base width/height; negative on a right/bottom anchor moves inward),
|
|
4688
|
+
* `width` (% of the base width, default 25 — height follows the layer's
|
|
4689
|
+
* aspect unless `height` is set). Plus `opacity` (0..1), `rotation`
|
|
4690
|
+
* (degrees), `blend` (`"over"` | `"multiply"` | `"screen"`), `fit`,
|
|
4691
|
+
* `shadow` and `roundedCorners`. The output keeps the base's pixel size
|
|
4692
|
+
* unless `canvas` is set. Flat credit cost. Poll `jobs.get(jobId)` for the
|
|
4693
|
+
* finished image.
|
|
4694
|
+
*/
|
|
4695
|
+
imageOverlay(input: {
|
|
4696
|
+
imageUrl: string;
|
|
4697
|
+
layers: Array<{
|
|
4698
|
+
imageUrl: string;
|
|
4699
|
+
anchor?: "top-left" | "top" | "top-right" | "left" | "center" | "right" | "bottom-left" | "bottom" | "bottom-right";
|
|
4700
|
+
x?: number;
|
|
4701
|
+
y?: number;
|
|
4702
|
+
width?: number;
|
|
4703
|
+
height?: number;
|
|
4704
|
+
opacity?: number;
|
|
4705
|
+
rotation?: number;
|
|
4706
|
+
blend?: "over" | "multiply" | "screen";
|
|
4707
|
+
fit?: "contain" | "cover" | "stretch";
|
|
4708
|
+
shadow?: {
|
|
4709
|
+
blur: number;
|
|
4710
|
+
offsetX: number;
|
|
4711
|
+
offsetY: number;
|
|
4712
|
+
color: string;
|
|
4713
|
+
opacity: number;
|
|
4714
|
+
};
|
|
4715
|
+
roundedCorners?: number;
|
|
4716
|
+
zIndex?: number;
|
|
4717
|
+
/** "image" (default, needs imageUrl) | "text" | "qr" | "shape" — see @nodaro/shared image-overlay-layers. */
|
|
4718
|
+
kind?: "image" | "text" | "qr" | "shape";
|
|
4719
|
+
text?: Record<string, unknown>;
|
|
4720
|
+
qr?: Record<string, unknown>;
|
|
4721
|
+
shape?: Record<string, unknown>;
|
|
4722
|
+
effects?: Record<string, unknown>;
|
|
4723
|
+
}>;
|
|
4724
|
+
canvas?: {
|
|
4725
|
+
width: number;
|
|
4726
|
+
height: number;
|
|
4727
|
+
backgroundColor?: string;
|
|
4728
|
+
};
|
|
4729
|
+
baseFit?: "contain" | "cover";
|
|
4730
|
+
outputFormat?: "png" | "jpg" | "webp";
|
|
4731
|
+
/** Extra platform renders (see OVERLAY_PLATFORMS in @nodaro/shared); returned as output `variants[]`. */
|
|
4732
|
+
variants?: string[];
|
|
4733
|
+
/** The mask the job also emits as output `maskUrl` (white = may change). Default "around". */
|
|
4734
|
+
maskMode?: "none" | "layers" | "around" | "outside";
|
|
4735
|
+
maskSpread?: number;
|
|
4736
|
+
/** Fills every QR layer whose `qr.fromInput` is true — the node's QR link handle. */
|
|
4737
|
+
qrText?: string;
|
|
4738
|
+
}): Promise<{
|
|
4739
|
+
jobId: string;
|
|
4740
|
+
}>;
|
|
4682
4741
|
/**
|
|
4683
4742
|
* Trim a video to a range (`POST /v1/trim-video`). Give the range in whichever
|
|
4684
4743
|
* unit fits: `startTime`/`endTime` seconds, `trim*Frames`, `trim*Seconds`, or
|
package/dist/index.js
CHANGED
|
@@ -2138,6 +2138,22 @@ var MediaResource = class {
|
|
|
2138
2138
|
imageCollage(input) {
|
|
2139
2139
|
return this.client.request("POST", "/v1/image-collage", { body: input });
|
|
2140
2140
|
}
|
|
2141
|
+
/**
|
|
2142
|
+
* Place 1–12 layers — pictures, real text, QR codes, shapes — on a base image,
|
|
2143
|
+
* pixel-exactly (`POST /v1/image-overlay`) — local, deterministic, no AI.
|
|
2144
|
+
* Every layer position/size is a PERCENT of the base image: `anchor` (nine
|
|
2145
|
+
* positions, default `"center"`), `x`/`y` (offset from the anchor in % of
|
|
2146
|
+
* the base width/height; negative on a right/bottom anchor moves inward),
|
|
2147
|
+
* `width` (% of the base width, default 25 — height follows the layer's
|
|
2148
|
+
* aspect unless `height` is set). Plus `opacity` (0..1), `rotation`
|
|
2149
|
+
* (degrees), `blend` (`"over"` | `"multiply"` | `"screen"`), `fit`,
|
|
2150
|
+
* `shadow` and `roundedCorners`. The output keeps the base's pixel size
|
|
2151
|
+
* unless `canvas` is set. Flat credit cost. Poll `jobs.get(jobId)` for the
|
|
2152
|
+
* finished image.
|
|
2153
|
+
*/
|
|
2154
|
+
imageOverlay(input) {
|
|
2155
|
+
return this.client.request("POST", "/v1/image-overlay", { body: input });
|
|
2156
|
+
}
|
|
2141
2157
|
/**
|
|
2142
2158
|
* Trim a video to a range (`POST /v1/trim-video`). Give the range in whichever
|
|
2143
2159
|
* unit fits: `startTime`/`endTime` seconds, `trim*Frames`, `trim*Seconds`, or
|
|
@@ -3232,7 +3248,7 @@ var WorkspacesResource = class {
|
|
|
3232
3248
|
return this.client.requestText("GET", `/v1/workspaces/${encodeURIComponent(id)}/usage`, { query: { ...opts, format: "csv" } });
|
|
3233
3249
|
}
|
|
3234
3250
|
};
|
|
3235
|
-
var SDK_VERSION = "2.
|
|
3251
|
+
var SDK_VERSION = "2.5.0" ;
|
|
3236
3252
|
var CLIENT_HEADER = "X-Nodaro-Client";
|
|
3237
3253
|
var isBrowser = () => typeof window !== "undefined" && typeof window.document !== "undefined";
|
|
3238
3254
|
var NodaroClient = class _NodaroClient {
|