effing-cloud-sdk 0.1.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/README.md +140 -0
- package/dist/index.cjs +123 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +49 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.js +85 -0
- package/dist/index.js.map +1 -0
- package/package.json +31 -0
package/README.md
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# effing-cloud-sdk
|
|
2
|
+
|
|
3
|
+
Official JavaScript/TypeScript SDK for [Effing Cloud](https://cloud.effing.dev).
|
|
4
|
+
|
|
5
|
+
Mint signed URLs for image, annie, and effie modules deployed to Effing Cloud —
|
|
6
|
+
no manual segment construction, no need to depend on `@effing/serde` directly.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install effing-cloud-sdk
|
|
12
|
+
# or
|
|
13
|
+
pnpm add effing-cloud-sdk
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Zero runtime dependencies — the signing primitive is bundled into the SDK.
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
The recommended API is the `EffingCloudClient` class. Configure it once with
|
|
21
|
+
your tenant slug, project slug, and URL secret, then call `mintSignedUrl()` for
|
|
22
|
+
each render.
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { EffingCloudClient } from "effing-cloud-sdk";
|
|
26
|
+
|
|
27
|
+
const client = new EffingCloudClient({
|
|
28
|
+
tenant: "acme",
|
|
29
|
+
project: "posters",
|
|
30
|
+
secret: process.env.EFFING_URL_SECRET!,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const url = await client.mintSignedUrl({
|
|
34
|
+
kind: "effie",
|
|
35
|
+
id: "poster",
|
|
36
|
+
props: { imageUrl: "https://cdn.example.com/sky.jpg", duration: 5 },
|
|
37
|
+
bounds: { width: 1080, height: 1920 },
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// https://fn.effing.dev/acme/posters/effie/<segment>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`kind` is one of `"image" | "annie" | "effie"` — the module type you want to
|
|
44
|
+
invoke.
|
|
45
|
+
|
|
46
|
+
### Prop naming
|
|
47
|
+
|
|
48
|
+
`props` is JSON-serialized verbatim — keys round-trip exactly as you write
|
|
49
|
+
them. The server does run a recursive `snake_case → camelCase` conversion
|
|
50
|
+
during deserialization, so any `image_url`-style keys (typical when minting
|
|
51
|
+
from a Python or Go caller) surface as `imageUrl` inside the module. Pure
|
|
52
|
+
camelCase keys pass through unchanged.
|
|
53
|
+
|
|
54
|
+
### One-shot function
|
|
55
|
+
|
|
56
|
+
A standalone `mintSignedUrl()` is also exported, useful for scripts and tests:
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
import { mintSignedUrl } from "effing-cloud-sdk";
|
|
60
|
+
|
|
61
|
+
const url = await mintSignedUrl({
|
|
62
|
+
tenant: "acme",
|
|
63
|
+
project: "posters",
|
|
64
|
+
kind: "effie",
|
|
65
|
+
id: "poster",
|
|
66
|
+
props: { ... },
|
|
67
|
+
bounds: { width: 1080, height: 1920 },
|
|
68
|
+
secret: process.env.EFFING_URL_SECRET!,
|
|
69
|
+
});
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Tagging runs
|
|
73
|
+
|
|
74
|
+
Tags travel inside the signed segment and surface in your run / render reports.
|
|
75
|
+
Pass them as an object (recommended) or as a list of bare values and/or
|
|
76
|
+
`name:value` strings:
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
const url = await client.mintSignedUrl({
|
|
80
|
+
kind: "effie",
|
|
81
|
+
id: "poster",
|
|
82
|
+
props: { ... },
|
|
83
|
+
bounds: { width: 1080, height: 1920 },
|
|
84
|
+
tags: { campaign: "summer", env: "prod" },
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
// Array form — useful for bare tags or pre-formatted entries.
|
|
88
|
+
const url2 = await client.mintSignedUrl({
|
|
89
|
+
kind: "effie",
|
|
90
|
+
id: "poster",
|
|
91
|
+
props: { ... },
|
|
92
|
+
bounds: { width: 1080, height: 1920 },
|
|
93
|
+
tags: ["vip", "env:prod"],
|
|
94
|
+
});
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Tag names in the object form must not contain `:` — that character is reserved
|
|
98
|
+
as the name/value separator in the array form.
|
|
99
|
+
|
|
100
|
+
### Custom base URL
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
new EffingCloudClient({
|
|
104
|
+
tenant: "acme",
|
|
105
|
+
project: "posters",
|
|
106
|
+
secret: process.env.EFFING_URL_SECRET!,
|
|
107
|
+
baseUrl: "https://fn.example.com",
|
|
108
|
+
});
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## API
|
|
112
|
+
|
|
113
|
+
### `new EffingCloudClient(opts)`
|
|
114
|
+
|
|
115
|
+
| Option | Type | Default | Description |
|
|
116
|
+
| --------- | --------- | ----------------------- | ---------------------------------------------- |
|
|
117
|
+
| `tenant` | `string` | — | Your tenant slug. |
|
|
118
|
+
| `project` | `string` | — | Your project slug. |
|
|
119
|
+
| `secret` | `string` | — | URL secret from `effing-cloud url-secret`. |
|
|
120
|
+
| `baseUrl` | `string?` | `https://fn.effing.dev` | Override for self-hosted or staging endpoints. |
|
|
121
|
+
|
|
122
|
+
### `client.mintSignedUrl({ kind, id, props, bounds, tags? })`
|
|
123
|
+
|
|
124
|
+
Returns `Promise<string>` — the fully-qualified signed URL.
|
|
125
|
+
|
|
126
|
+
### `mintSignedUrl(opts)`
|
|
127
|
+
|
|
128
|
+
Standalone equivalent that takes `tenant`, `project`, `secret`, and optional
|
|
129
|
+
`baseUrl` inline alongside the module fields. Returns `Promise<string>`.
|
|
130
|
+
|
|
131
|
+
### Types
|
|
132
|
+
|
|
133
|
+
```ts
|
|
134
|
+
type FnKind = "image" | "annie" | "effie";
|
|
135
|
+
interface FnBounds {
|
|
136
|
+
width: number;
|
|
137
|
+
height: number;
|
|
138
|
+
}
|
|
139
|
+
type FnTags = Record<string, string> | string[];
|
|
140
|
+
```
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
EffingCloudClient: () => EffingCloudClient,
|
|
34
|
+
mintSignedUrl: () => mintSignedUrl
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(index_exports);
|
|
37
|
+
|
|
38
|
+
// ../../node_modules/.pnpm/@effing+serde@0.35.2/node_modules/@effing/serde/dist/index.js
|
|
39
|
+
var import_zlib = __toESM(require("zlib"), 1);
|
|
40
|
+
var import_util = require("util");
|
|
41
|
+
var import_crypto = require("crypto");
|
|
42
|
+
var zip = (0, import_util.promisify)(import_zlib.default.gzip);
|
|
43
|
+
var unzip = (0, import_util.promisify)(import_zlib.default.unzip);
|
|
44
|
+
function urlsafeBase64Encode(data, unsafeCharsMapping = { "+": "-", "/": "_" }) {
|
|
45
|
+
return Buffer.from(data).toString("base64").replace(/[+/]/g, (m) => unsafeCharsMapping[m]);
|
|
46
|
+
}
|
|
47
|
+
function deriveSigningKey(secretKey, salt, algorithm) {
|
|
48
|
+
return (0, import_crypto.createHash)(algorithm).update(`${salt}signer${secretKey}`).digest();
|
|
49
|
+
}
|
|
50
|
+
async function serialize(obj, secretKey, options = {}) {
|
|
51
|
+
const { salt = "itsdangerous", algorithm = "sha1" } = options;
|
|
52
|
+
let json = Buffer.from(JSON.stringify(obj));
|
|
53
|
+
const compressed = await zip(json);
|
|
54
|
+
let isCompressed = false;
|
|
55
|
+
if (compressed.length < json.length - 1) {
|
|
56
|
+
json = compressed;
|
|
57
|
+
isCompressed = true;
|
|
58
|
+
}
|
|
59
|
+
let encoded = urlsafeBase64Encode(json);
|
|
60
|
+
if (isCompressed) {
|
|
61
|
+
encoded = `.${encoded}`;
|
|
62
|
+
}
|
|
63
|
+
const derivedKey = deriveSigningKey(secretKey, salt, algorithm);
|
|
64
|
+
const hmac = (0, import_crypto.createHmac)(algorithm, derivedKey).update(encoded).digest();
|
|
65
|
+
return `${encoded}.${urlsafeBase64Encode(hmac)}`;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// src/mint.ts
|
|
69
|
+
var DEFAULT_BASE_URL = "https://fn.effing.dev";
|
|
70
|
+
function trimTrailingSlash(url) {
|
|
71
|
+
return url.endsWith("/") ? url.slice(0, -1) : url;
|
|
72
|
+
}
|
|
73
|
+
async function mintSignedUrl(opts) {
|
|
74
|
+
const {
|
|
75
|
+
tenant,
|
|
76
|
+
project,
|
|
77
|
+
kind,
|
|
78
|
+
id,
|
|
79
|
+
props,
|
|
80
|
+
bounds,
|
|
81
|
+
tags,
|
|
82
|
+
secret,
|
|
83
|
+
baseUrl = DEFAULT_BASE_URL
|
|
84
|
+
} = opts;
|
|
85
|
+
const payload = { id, props, bounds };
|
|
86
|
+
if (tags !== void 0) payload.tags = tags;
|
|
87
|
+
const segment = await serialize(payload, secret);
|
|
88
|
+
const base = trimTrailingSlash(baseUrl);
|
|
89
|
+
return `${base}/${encodeURIComponent(tenant)}/${encodeURIComponent(project)}/${kind}/${segment}`;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// src/client.ts
|
|
93
|
+
var EffingCloudClient = class {
|
|
94
|
+
tenant;
|
|
95
|
+
project;
|
|
96
|
+
baseUrl;
|
|
97
|
+
#secret;
|
|
98
|
+
constructor(opts) {
|
|
99
|
+
this.tenant = opts.tenant;
|
|
100
|
+
this.project = opts.project;
|
|
101
|
+
this.#secret = opts.secret;
|
|
102
|
+
this.baseUrl = opts.baseUrl ?? "https://fn.effing.dev";
|
|
103
|
+
}
|
|
104
|
+
mintSignedUrl(opts) {
|
|
105
|
+
return mintSignedUrl({
|
|
106
|
+
tenant: this.tenant,
|
|
107
|
+
project: this.project,
|
|
108
|
+
kind: opts.kind,
|
|
109
|
+
id: opts.id,
|
|
110
|
+
props: opts.props,
|
|
111
|
+
bounds: opts.bounds,
|
|
112
|
+
tags: opts.tags,
|
|
113
|
+
secret: this.#secret,
|
|
114
|
+
baseUrl: this.baseUrl
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
119
|
+
0 && (module.exports = {
|
|
120
|
+
EffingCloudClient,
|
|
121
|
+
mintSignedUrl
|
|
122
|
+
});
|
|
123
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../../../node_modules/.pnpm/@effing+serde@0.35.2/node_modules/@effing/serde/src/itsdangerous.ts","../src/mint.ts","../src/client.ts"],"sourcesContent":["export { EffingCloudClient } from \"./client.js\";\nexport { mintSignedUrl } from \"./mint.js\";\nexport type {\n ClientMintOptions,\n EffingCloudClientOptions,\n FnBounds,\n FnKind,\n FnTags,\n MintSignedUrlOptions,\n} from \"./types.js\";\n","/**\n * TypeScript implementation of itsdangerous serialization logic.\n * @see https://github.com/pallets/itsdangerous/\n */\n\nimport zlib from \"node:zlib\";\nimport { promisify } from \"node:util\";\nimport { createHash, createHmac } from \"node:crypto\";\n\nconst zip = promisify(zlib.gzip);\nconst unzip = promisify(zlib.unzip);\n\n/**\n * Encode data as URL-safe base64.\n * Replaces + with - and / with _ by default.\n */\nexport function urlsafeBase64Encode(\n data: string | Buffer,\n unsafeCharsMapping: Record<string, string> = { \"+\": \"-\", \"/\": \"_\" },\n): string {\n return Buffer.from(data)\n .toString(\"base64\")\n .replace(/[+/]/g, (m) => unsafeCharsMapping[m]);\n}\n\n/**\n * Decode URL-safe base64 data.\n * Replaces - with + and _ with / by default.\n */\nexport function urlsafeBase64Decode(\n encoded: string,\n unsafeCharsMapping: Record<string, string> = { \"-\": \"+\", _: \"/\" },\n): Buffer {\n return Buffer.from(\n encoded.replace(/[-_]/g, (m) => unsafeCharsMapping[m]),\n \"base64\",\n );\n}\n\n/**\n * Derive an HMAC signing key using the itsdangerous-compatible format.\n */\nfunction deriveSigningKey(\n secretKey: string,\n salt: string,\n algorithm: string,\n): Buffer {\n return createHash(algorithm).update(`${salt}signer${secretKey}`).digest();\n}\n\n/**\n * Recursively convert snake_case keys to camelCase in plain objects and\n * arrays. Primitives and non-plain objects (Date, Buffer, class instances…)\n * pass through unchanged.\n */\nfunction keysToCamel(value: unknown): unknown {\n if (Array.isArray(value)) return value.map(keysToCamel);\n if (value === null || typeof value !== \"object\") return value;\n const proto = Object.getPrototypeOf(value);\n if (proto !== Object.prototype && proto !== null) return value;\n const out: Record<string, unknown> = {};\n for (const [key, v] of Object.entries(value as Record<string, unknown>)) {\n const camelKey = key.replace(/(_[a-z])/gi, (s) =>\n s.toUpperCase().replace(\"_\", \"\"),\n );\n out[camelKey] = keysToCamel(v);\n }\n return out;\n}\n\nexport interface SerializeOptions {\n /** Salt for key derivation (default: \"itsdangerous\") */\n salt?: string;\n /** Hash algorithm for HMAC (default: \"sha1\") */\n algorithm?: string;\n}\n\n/**\n * Serialize an object to a URL-safe segment with optional compression and HMAC signature.\n *\n * The format is compatible with Python's itsdangerous library.\n * - If compression saves space, the payload is prefixed with \".\"\n * - The signature is appended after a \".\" separator\n */\nexport async function serialize(\n obj: object,\n secretKey: string,\n options: SerializeOptions = {},\n): Promise<string> {\n const { salt = \"itsdangerous\", algorithm = \"sha1\" } = options;\n\n let json = Buffer.from(JSON.stringify(obj));\n const compressed = await zip(json);\n\n let isCompressed = false;\n if (compressed.length < json.length - 1) {\n json = compressed;\n isCompressed = true;\n }\n\n let encoded = urlsafeBase64Encode(json);\n if (isCompressed) {\n encoded = `.${encoded}`;\n }\n\n const derivedKey = deriveSigningKey(secretKey, salt, algorithm);\n const hmac = createHmac(algorithm, derivedKey).update(encoded).digest();\n return `${encoded}.${urlsafeBase64Encode(hmac)}`;\n}\n\nexport interface DeserializeOptions extends SerializeOptions {\n /** Whether to convert snake_case keys to camelCase (default: true) */\n convertKeysToCamel?: boolean;\n}\n\n/**\n * Deserialize a URL segment, verify its signature, and decompress if needed.\n *\n * Throws an error if the signature is invalid.\n */\nexport async function deserialize<T = Record<string, unknown>>(\n segment: string,\n secretKey: string,\n options: DeserializeOptions = {},\n): Promise<T> {\n const {\n salt = \"itsdangerous\",\n algorithm = \"sha1\",\n convertKeysToCamel = true,\n } = options;\n\n const parts = segment.split(\".\");\n const signature = parts.at(-1);\n let payload = parts.slice(0, -1).join(\".\");\n\n const derivedKey = deriveSigningKey(secretKey, salt, algorithm);\n const hmac = createHmac(algorithm, derivedKey).update(payload).digest();\n if (Buffer.compare(urlsafeBase64Decode(signature!), hmac) !== 0) {\n throw new Error(\"invalid url segment signature\");\n }\n\n let decompress = false;\n if (payload.startsWith(\".\")) {\n decompress = true;\n payload = payload.slice(1);\n }\n\n const decoded = urlsafeBase64Decode(payload);\n let parsed: Record<string, unknown>;\n\n if (decompress) {\n const decompressed = await unzip(decoded);\n parsed = JSON.parse(decompressed.toString()) as Record<string, unknown>;\n } else {\n parsed = JSON.parse(decoded.toString()) as Record<string, unknown>;\n }\n\n if (convertKeysToCamel) {\n return keysToCamel(parsed) as T;\n }\n return parsed as T;\n}\n","import { serialize } from \"@effing/serde\";\nimport type { MintSignedUrlOptions } from \"./types.js\";\n\nconst DEFAULT_BASE_URL = \"https://fn.effing.dev\";\n\nfunction trimTrailingSlash(url: string): string {\n return url.endsWith(\"/\") ? url.slice(0, -1) : url;\n}\n\nexport async function mintSignedUrl(opts: MintSignedUrlOptions): Promise<string> {\n const {\n tenant,\n project,\n kind,\n id,\n props,\n bounds,\n tags,\n secret,\n baseUrl = DEFAULT_BASE_URL,\n } = opts;\n const payload: Record<string, unknown> = { id, props, bounds };\n if (tags !== undefined) payload.tags = tags;\n const segment = await serialize(payload, secret);\n const base = trimTrailingSlash(baseUrl);\n return `${base}/${encodeURIComponent(tenant)}/${encodeURIComponent(project)}/${kind}/${segment}`;\n}\n","import { mintSignedUrl } from \"./mint.js\";\nimport type { ClientMintOptions, EffingCloudClientOptions } from \"./types.js\";\n\nexport class EffingCloudClient {\n readonly tenant: string;\n readonly project: string;\n readonly baseUrl: string;\n readonly #secret: string;\n\n constructor(opts: EffingCloudClientOptions) {\n this.tenant = opts.tenant;\n this.project = opts.project;\n this.#secret = opts.secret;\n this.baseUrl = opts.baseUrl ?? \"https://fn.effing.dev\";\n }\n\n mintSignedUrl(opts: ClientMintOptions): Promise<string> {\n return mintSignedUrl({\n tenant: this.tenant,\n project: this.project,\n kind: opts.kind,\n id: opts.id,\n props: opts.props,\n bounds: opts.bounds,\n tags: opts.tags,\n secret: this.#secret,\n baseUrl: this.baseUrl,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKA,kBAAiB;AACjB,kBAA0B;AAC1B,oBAAuC;AAEvC,IAAM,UAAM,uBAAU,YAAAA,QAAK,IAAI;AAC/B,IAAM,YAAQ,uBAAU,YAAAA,QAAK,KAAK;AAM3B,SAAS,oBACd,MACA,qBAA6C,EAAE,KAAK,KAAK,KAAK,IAAI,GAC1D;AACR,SAAO,OAAO,KAAK,IAAI,EACpB,SAAS,QAAQ,EACjB,QAAQ,SAAS,CAAC,MAAM,mBAAmB,CAAC,CAAC;AAClD;AAmBA,SAAS,iBACP,WACA,MACA,WACQ;AACR,aAAO,0BAAW,SAAS,EAAE,OAAO,GAAG,IAAI,SAAS,SAAS,EAAE,EAAE,OAAO;AAC1E;AAoCA,eAAsB,UACpB,KACA,WACA,UAA4B,CAAC,GACZ;AACjB,QAAM,EAAE,OAAO,gBAAgB,YAAY,OAAO,IAAI;AAEtD,MAAI,OAAO,OAAO,KAAK,KAAK,UAAU,GAAG,CAAC;AAC1C,QAAM,aAAa,MAAM,IAAI,IAAI;AAEjC,MAAI,eAAe;AACnB,MAAI,WAAW,SAAS,KAAK,SAAS,GAAG;AACvC,WAAO;AACP,mBAAe;EACjB;AAEA,MAAI,UAAU,oBAAoB,IAAI;AACtC,MAAI,cAAc;AAChB,cAAU,IAAI,OAAO;EACvB;AAEA,QAAM,aAAa,iBAAiB,WAAW,MAAM,SAAS;AAC9D,QAAM,WAAO,0BAAW,WAAW,UAAU,EAAE,OAAO,OAAO,EAAE,OAAO;AACtE,SAAO,GAAG,OAAO,IAAI,oBAAoB,IAAI,CAAC;AAChD;;;ACzGA,IAAM,mBAAmB;AAEzB,SAAS,kBAAkB,KAAqB;AAC9C,SAAO,IAAI,SAAS,GAAG,IAAI,IAAI,MAAM,GAAG,EAAE,IAAI;AAChD;AAEA,eAAsB,cAAc,MAA6C;AAC/E,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,EACZ,IAAI;AACJ,QAAM,UAAmC,EAAE,IAAI,OAAO,OAAO;AAC7D,MAAI,SAAS,OAAW,SAAQ,OAAO;AACvC,QAAM,UAAU,MAAM,UAAU,SAAS,MAAM;AAC/C,QAAM,OAAO,kBAAkB,OAAO;AACtC,SAAO,GAAG,IAAI,IAAI,mBAAmB,MAAM,CAAC,IAAI,mBAAmB,OAAO,CAAC,IAAI,IAAI,IAAI,OAAO;AAChG;;;ACvBO,IAAM,oBAAN,MAAwB;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,MAAgC;AAC1C,SAAK,SAAS,KAAK;AACnB,SAAK,UAAU,KAAK;AACpB,SAAK,UAAU,KAAK;AACpB,SAAK,UAAU,KAAK,WAAW;AAAA,EACjC;AAAA,EAEA,cAAc,MAA0C;AACtD,WAAO,cAAc;AAAA,MACnB,QAAQ,KAAK;AAAA,MACb,SAAS,KAAK;AAAA,MACd,MAAM,KAAK;AAAA,MACX,IAAI,KAAK;AAAA,MACT,OAAO,KAAK;AAAA,MACZ,QAAQ,KAAK;AAAA,MACb,MAAM,KAAK;AAAA,MACX,QAAQ,KAAK;AAAA,MACb,SAAS,KAAK;AAAA,IAChB,CAAC;AAAA,EACH;AACF;","names":["zlib"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
type FnKind = "image" | "annie" | "effie";
|
|
2
|
+
interface FnBounds {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Tags recorded against the run. Accepts either:
|
|
8
|
+
* - an object like `{ campaign: "summer", env: "prod" }`
|
|
9
|
+
* - an array of bare values and/or `name:value` strings like `["vip", "env:prod"]`
|
|
10
|
+
* Tag names cannot contain `:` when using the object form.
|
|
11
|
+
*/
|
|
12
|
+
type FnTags = Record<string, string> | string[];
|
|
13
|
+
interface MintSignedUrlOptions {
|
|
14
|
+
tenant: string;
|
|
15
|
+
project: string;
|
|
16
|
+
kind: FnKind;
|
|
17
|
+
id: string;
|
|
18
|
+
props: Record<string, unknown>;
|
|
19
|
+
bounds: FnBounds;
|
|
20
|
+
tags?: FnTags;
|
|
21
|
+
secret: string;
|
|
22
|
+
baseUrl?: string;
|
|
23
|
+
}
|
|
24
|
+
interface EffingCloudClientOptions {
|
|
25
|
+
tenant: string;
|
|
26
|
+
project: string;
|
|
27
|
+
secret: string;
|
|
28
|
+
baseUrl?: string;
|
|
29
|
+
}
|
|
30
|
+
interface ClientMintOptions {
|
|
31
|
+
kind: FnKind;
|
|
32
|
+
id: string;
|
|
33
|
+
props: Record<string, unknown>;
|
|
34
|
+
bounds: FnBounds;
|
|
35
|
+
tags?: FnTags;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare class EffingCloudClient {
|
|
39
|
+
#private;
|
|
40
|
+
readonly tenant: string;
|
|
41
|
+
readonly project: string;
|
|
42
|
+
readonly baseUrl: string;
|
|
43
|
+
constructor(opts: EffingCloudClientOptions);
|
|
44
|
+
mintSignedUrl(opts: ClientMintOptions): Promise<string>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
declare function mintSignedUrl(opts: MintSignedUrlOptions): Promise<string>;
|
|
48
|
+
|
|
49
|
+
export { type ClientMintOptions, EffingCloudClient, type EffingCloudClientOptions, type FnBounds, type FnKind, type FnTags, type MintSignedUrlOptions, mintSignedUrl };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
type FnKind = "image" | "annie" | "effie";
|
|
2
|
+
interface FnBounds {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Tags recorded against the run. Accepts either:
|
|
8
|
+
* - an object like `{ campaign: "summer", env: "prod" }`
|
|
9
|
+
* - an array of bare values and/or `name:value` strings like `["vip", "env:prod"]`
|
|
10
|
+
* Tag names cannot contain `:` when using the object form.
|
|
11
|
+
*/
|
|
12
|
+
type FnTags = Record<string, string> | string[];
|
|
13
|
+
interface MintSignedUrlOptions {
|
|
14
|
+
tenant: string;
|
|
15
|
+
project: string;
|
|
16
|
+
kind: FnKind;
|
|
17
|
+
id: string;
|
|
18
|
+
props: Record<string, unknown>;
|
|
19
|
+
bounds: FnBounds;
|
|
20
|
+
tags?: FnTags;
|
|
21
|
+
secret: string;
|
|
22
|
+
baseUrl?: string;
|
|
23
|
+
}
|
|
24
|
+
interface EffingCloudClientOptions {
|
|
25
|
+
tenant: string;
|
|
26
|
+
project: string;
|
|
27
|
+
secret: string;
|
|
28
|
+
baseUrl?: string;
|
|
29
|
+
}
|
|
30
|
+
interface ClientMintOptions {
|
|
31
|
+
kind: FnKind;
|
|
32
|
+
id: string;
|
|
33
|
+
props: Record<string, unknown>;
|
|
34
|
+
bounds: FnBounds;
|
|
35
|
+
tags?: FnTags;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
declare class EffingCloudClient {
|
|
39
|
+
#private;
|
|
40
|
+
readonly tenant: string;
|
|
41
|
+
readonly project: string;
|
|
42
|
+
readonly baseUrl: string;
|
|
43
|
+
constructor(opts: EffingCloudClientOptions);
|
|
44
|
+
mintSignedUrl(opts: ClientMintOptions): Promise<string>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
declare function mintSignedUrl(opts: MintSignedUrlOptions): Promise<string>;
|
|
48
|
+
|
|
49
|
+
export { type ClientMintOptions, EffingCloudClient, type EffingCloudClientOptions, type FnBounds, type FnKind, type FnTags, type MintSignedUrlOptions, mintSignedUrl };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// ../../node_modules/.pnpm/@effing+serde@0.35.2/node_modules/@effing/serde/dist/index.js
|
|
2
|
+
import zlib from "zlib";
|
|
3
|
+
import { promisify } from "util";
|
|
4
|
+
import { createHash, createHmac } from "crypto";
|
|
5
|
+
var zip = promisify(zlib.gzip);
|
|
6
|
+
var unzip = promisify(zlib.unzip);
|
|
7
|
+
function urlsafeBase64Encode(data, unsafeCharsMapping = { "+": "-", "/": "_" }) {
|
|
8
|
+
return Buffer.from(data).toString("base64").replace(/[+/]/g, (m) => unsafeCharsMapping[m]);
|
|
9
|
+
}
|
|
10
|
+
function deriveSigningKey(secretKey, salt, algorithm) {
|
|
11
|
+
return createHash(algorithm).update(`${salt}signer${secretKey}`).digest();
|
|
12
|
+
}
|
|
13
|
+
async function serialize(obj, secretKey, options = {}) {
|
|
14
|
+
const { salt = "itsdangerous", algorithm = "sha1" } = options;
|
|
15
|
+
let json = Buffer.from(JSON.stringify(obj));
|
|
16
|
+
const compressed = await zip(json);
|
|
17
|
+
let isCompressed = false;
|
|
18
|
+
if (compressed.length < json.length - 1) {
|
|
19
|
+
json = compressed;
|
|
20
|
+
isCompressed = true;
|
|
21
|
+
}
|
|
22
|
+
let encoded = urlsafeBase64Encode(json);
|
|
23
|
+
if (isCompressed) {
|
|
24
|
+
encoded = `.${encoded}`;
|
|
25
|
+
}
|
|
26
|
+
const derivedKey = deriveSigningKey(secretKey, salt, algorithm);
|
|
27
|
+
const hmac = createHmac(algorithm, derivedKey).update(encoded).digest();
|
|
28
|
+
return `${encoded}.${urlsafeBase64Encode(hmac)}`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// src/mint.ts
|
|
32
|
+
var DEFAULT_BASE_URL = "https://fn.effing.dev";
|
|
33
|
+
function trimTrailingSlash(url) {
|
|
34
|
+
return url.endsWith("/") ? url.slice(0, -1) : url;
|
|
35
|
+
}
|
|
36
|
+
async function mintSignedUrl(opts) {
|
|
37
|
+
const {
|
|
38
|
+
tenant,
|
|
39
|
+
project,
|
|
40
|
+
kind,
|
|
41
|
+
id,
|
|
42
|
+
props,
|
|
43
|
+
bounds,
|
|
44
|
+
tags,
|
|
45
|
+
secret,
|
|
46
|
+
baseUrl = DEFAULT_BASE_URL
|
|
47
|
+
} = opts;
|
|
48
|
+
const payload = { id, props, bounds };
|
|
49
|
+
if (tags !== void 0) payload.tags = tags;
|
|
50
|
+
const segment = await serialize(payload, secret);
|
|
51
|
+
const base = trimTrailingSlash(baseUrl);
|
|
52
|
+
return `${base}/${encodeURIComponent(tenant)}/${encodeURIComponent(project)}/${kind}/${segment}`;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// src/client.ts
|
|
56
|
+
var EffingCloudClient = class {
|
|
57
|
+
tenant;
|
|
58
|
+
project;
|
|
59
|
+
baseUrl;
|
|
60
|
+
#secret;
|
|
61
|
+
constructor(opts) {
|
|
62
|
+
this.tenant = opts.tenant;
|
|
63
|
+
this.project = opts.project;
|
|
64
|
+
this.#secret = opts.secret;
|
|
65
|
+
this.baseUrl = opts.baseUrl ?? "https://fn.effing.dev";
|
|
66
|
+
}
|
|
67
|
+
mintSignedUrl(opts) {
|
|
68
|
+
return mintSignedUrl({
|
|
69
|
+
tenant: this.tenant,
|
|
70
|
+
project: this.project,
|
|
71
|
+
kind: opts.kind,
|
|
72
|
+
id: opts.id,
|
|
73
|
+
props: opts.props,
|
|
74
|
+
bounds: opts.bounds,
|
|
75
|
+
tags: opts.tags,
|
|
76
|
+
secret: this.#secret,
|
|
77
|
+
baseUrl: this.baseUrl
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
export {
|
|
82
|
+
EffingCloudClient,
|
|
83
|
+
mintSignedUrl
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/@effing+serde@0.35.2/node_modules/@effing/serde/src/itsdangerous.ts","../src/mint.ts","../src/client.ts"],"sourcesContent":["/**\n * TypeScript implementation of itsdangerous serialization logic.\n * @see https://github.com/pallets/itsdangerous/\n */\n\nimport zlib from \"node:zlib\";\nimport { promisify } from \"node:util\";\nimport { createHash, createHmac } from \"node:crypto\";\n\nconst zip = promisify(zlib.gzip);\nconst unzip = promisify(zlib.unzip);\n\n/**\n * Encode data as URL-safe base64.\n * Replaces + with - and / with _ by default.\n */\nexport function urlsafeBase64Encode(\n data: string | Buffer,\n unsafeCharsMapping: Record<string, string> = { \"+\": \"-\", \"/\": \"_\" },\n): string {\n return Buffer.from(data)\n .toString(\"base64\")\n .replace(/[+/]/g, (m) => unsafeCharsMapping[m]);\n}\n\n/**\n * Decode URL-safe base64 data.\n * Replaces - with + and _ with / by default.\n */\nexport function urlsafeBase64Decode(\n encoded: string,\n unsafeCharsMapping: Record<string, string> = { \"-\": \"+\", _: \"/\" },\n): Buffer {\n return Buffer.from(\n encoded.replace(/[-_]/g, (m) => unsafeCharsMapping[m]),\n \"base64\",\n );\n}\n\n/**\n * Derive an HMAC signing key using the itsdangerous-compatible format.\n */\nfunction deriveSigningKey(\n secretKey: string,\n salt: string,\n algorithm: string,\n): Buffer {\n return createHash(algorithm).update(`${salt}signer${secretKey}`).digest();\n}\n\n/**\n * Recursively convert snake_case keys to camelCase in plain objects and\n * arrays. Primitives and non-plain objects (Date, Buffer, class instances…)\n * pass through unchanged.\n */\nfunction keysToCamel(value: unknown): unknown {\n if (Array.isArray(value)) return value.map(keysToCamel);\n if (value === null || typeof value !== \"object\") return value;\n const proto = Object.getPrototypeOf(value);\n if (proto !== Object.prototype && proto !== null) return value;\n const out: Record<string, unknown> = {};\n for (const [key, v] of Object.entries(value as Record<string, unknown>)) {\n const camelKey = key.replace(/(_[a-z])/gi, (s) =>\n s.toUpperCase().replace(\"_\", \"\"),\n );\n out[camelKey] = keysToCamel(v);\n }\n return out;\n}\n\nexport interface SerializeOptions {\n /** Salt for key derivation (default: \"itsdangerous\") */\n salt?: string;\n /** Hash algorithm for HMAC (default: \"sha1\") */\n algorithm?: string;\n}\n\n/**\n * Serialize an object to a URL-safe segment with optional compression and HMAC signature.\n *\n * The format is compatible with Python's itsdangerous library.\n * - If compression saves space, the payload is prefixed with \".\"\n * - The signature is appended after a \".\" separator\n */\nexport async function serialize(\n obj: object,\n secretKey: string,\n options: SerializeOptions = {},\n): Promise<string> {\n const { salt = \"itsdangerous\", algorithm = \"sha1\" } = options;\n\n let json = Buffer.from(JSON.stringify(obj));\n const compressed = await zip(json);\n\n let isCompressed = false;\n if (compressed.length < json.length - 1) {\n json = compressed;\n isCompressed = true;\n }\n\n let encoded = urlsafeBase64Encode(json);\n if (isCompressed) {\n encoded = `.${encoded}`;\n }\n\n const derivedKey = deriveSigningKey(secretKey, salt, algorithm);\n const hmac = createHmac(algorithm, derivedKey).update(encoded).digest();\n return `${encoded}.${urlsafeBase64Encode(hmac)}`;\n}\n\nexport interface DeserializeOptions extends SerializeOptions {\n /** Whether to convert snake_case keys to camelCase (default: true) */\n convertKeysToCamel?: boolean;\n}\n\n/**\n * Deserialize a URL segment, verify its signature, and decompress if needed.\n *\n * Throws an error if the signature is invalid.\n */\nexport async function deserialize<T = Record<string, unknown>>(\n segment: string,\n secretKey: string,\n options: DeserializeOptions = {},\n): Promise<T> {\n const {\n salt = \"itsdangerous\",\n algorithm = \"sha1\",\n convertKeysToCamel = true,\n } = options;\n\n const parts = segment.split(\".\");\n const signature = parts.at(-1);\n let payload = parts.slice(0, -1).join(\".\");\n\n const derivedKey = deriveSigningKey(secretKey, salt, algorithm);\n const hmac = createHmac(algorithm, derivedKey).update(payload).digest();\n if (Buffer.compare(urlsafeBase64Decode(signature!), hmac) !== 0) {\n throw new Error(\"invalid url segment signature\");\n }\n\n let decompress = false;\n if (payload.startsWith(\".\")) {\n decompress = true;\n payload = payload.slice(1);\n }\n\n const decoded = urlsafeBase64Decode(payload);\n let parsed: Record<string, unknown>;\n\n if (decompress) {\n const decompressed = await unzip(decoded);\n parsed = JSON.parse(decompressed.toString()) as Record<string, unknown>;\n } else {\n parsed = JSON.parse(decoded.toString()) as Record<string, unknown>;\n }\n\n if (convertKeysToCamel) {\n return keysToCamel(parsed) as T;\n }\n return parsed as T;\n}\n","import { serialize } from \"@effing/serde\";\nimport type { MintSignedUrlOptions } from \"./types.js\";\n\nconst DEFAULT_BASE_URL = \"https://fn.effing.dev\";\n\nfunction trimTrailingSlash(url: string): string {\n return url.endsWith(\"/\") ? url.slice(0, -1) : url;\n}\n\nexport async function mintSignedUrl(opts: MintSignedUrlOptions): Promise<string> {\n const {\n tenant,\n project,\n kind,\n id,\n props,\n bounds,\n tags,\n secret,\n baseUrl = DEFAULT_BASE_URL,\n } = opts;\n const payload: Record<string, unknown> = { id, props, bounds };\n if (tags !== undefined) payload.tags = tags;\n const segment = await serialize(payload, secret);\n const base = trimTrailingSlash(baseUrl);\n return `${base}/${encodeURIComponent(tenant)}/${encodeURIComponent(project)}/${kind}/${segment}`;\n}\n","import { mintSignedUrl } from \"./mint.js\";\nimport type { ClientMintOptions, EffingCloudClientOptions } from \"./types.js\";\n\nexport class EffingCloudClient {\n readonly tenant: string;\n readonly project: string;\n readonly baseUrl: string;\n readonly #secret: string;\n\n constructor(opts: EffingCloudClientOptions) {\n this.tenant = opts.tenant;\n this.project = opts.project;\n this.#secret = opts.secret;\n this.baseUrl = opts.baseUrl ?? \"https://fn.effing.dev\";\n }\n\n mintSignedUrl(opts: ClientMintOptions): Promise<string> {\n return mintSignedUrl({\n tenant: this.tenant,\n project: this.project,\n kind: opts.kind,\n id: opts.id,\n props: opts.props,\n bounds: opts.bounds,\n tags: opts.tags,\n secret: this.#secret,\n baseUrl: this.baseUrl,\n });\n }\n}\n"],"mappings":";AAKA,OAAO,UAAU;AACjB,SAAS,iBAAiB;AAC1B,SAAS,YAAY,kBAAkB;AAEvC,IAAM,MAAM,UAAU,KAAK,IAAI;AAC/B,IAAM,QAAQ,UAAU,KAAK,KAAK;AAM3B,SAAS,oBACd,MACA,qBAA6C,EAAE,KAAK,KAAK,KAAK,IAAI,GAC1D;AACR,SAAO,OAAO,KAAK,IAAI,EACpB,SAAS,QAAQ,EACjB,QAAQ,SAAS,CAAC,MAAM,mBAAmB,CAAC,CAAC;AAClD;AAmBA,SAAS,iBACP,WACA,MACA,WACQ;AACR,SAAO,WAAW,SAAS,EAAE,OAAO,GAAG,IAAI,SAAS,SAAS,EAAE,EAAE,OAAO;AAC1E;AAoCA,eAAsB,UACpB,KACA,WACA,UAA4B,CAAC,GACZ;AACjB,QAAM,EAAE,OAAO,gBAAgB,YAAY,OAAO,IAAI;AAEtD,MAAI,OAAO,OAAO,KAAK,KAAK,UAAU,GAAG,CAAC;AAC1C,QAAM,aAAa,MAAM,IAAI,IAAI;AAEjC,MAAI,eAAe;AACnB,MAAI,WAAW,SAAS,KAAK,SAAS,GAAG;AACvC,WAAO;AACP,mBAAe;EACjB;AAEA,MAAI,UAAU,oBAAoB,IAAI;AACtC,MAAI,cAAc;AAChB,cAAU,IAAI,OAAO;EACvB;AAEA,QAAM,aAAa,iBAAiB,WAAW,MAAM,SAAS;AAC9D,QAAM,OAAO,WAAW,WAAW,UAAU,EAAE,OAAO,OAAO,EAAE,OAAO;AACtE,SAAO,GAAG,OAAO,IAAI,oBAAoB,IAAI,CAAC;AAChD;;;ACzGA,IAAM,mBAAmB;AAEzB,SAAS,kBAAkB,KAAqB;AAC9C,SAAO,IAAI,SAAS,GAAG,IAAI,IAAI,MAAM,GAAG,EAAE,IAAI;AAChD;AAEA,eAAsB,cAAc,MAA6C;AAC/E,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,EACZ,IAAI;AACJ,QAAM,UAAmC,EAAE,IAAI,OAAO,OAAO;AAC7D,MAAI,SAAS,OAAW,SAAQ,OAAO;AACvC,QAAM,UAAU,MAAM,UAAU,SAAS,MAAM;AAC/C,QAAM,OAAO,kBAAkB,OAAO;AACtC,SAAO,GAAG,IAAI,IAAI,mBAAmB,MAAM,CAAC,IAAI,mBAAmB,OAAO,CAAC,IAAI,IAAI,IAAI,OAAO;AAChG;;;ACvBO,IAAM,oBAAN,MAAwB;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,MAAgC;AAC1C,SAAK,SAAS,KAAK;AACnB,SAAK,UAAU,KAAK;AACpB,SAAK,UAAU,KAAK;AACpB,SAAK,UAAU,KAAK,WAAW;AAAA,EACjC;AAAA,EAEA,cAAc,MAA0C;AACtD,WAAO,cAAc;AAAA,MACnB,QAAQ,KAAK;AAAA,MACb,SAAS,KAAK;AAAA,MACd,MAAM,KAAK;AAAA,MACX,IAAI,KAAK;AAAA,MACT,OAAO,KAAK;AAAA,MACZ,QAAQ,KAAK;AAAA,MACb,MAAM,KAAK;AAAA,MACX,QAAQ,KAAK;AAAA,MACb,SAAS,KAAK;AAAA,IAChB,CAAC;AAAA,EACH;AACF;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "effing-cloud-sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Official JavaScript/TypeScript SDK for Effing Cloud.",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"import": "./dist/index.js",
|
|
10
|
+
"require": "./dist/index.cjs"
|
|
11
|
+
},
|
|
12
|
+
"./package.json": "./package.json"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsup",
|
|
22
|
+
"typecheck": "tsc --noEmit",
|
|
23
|
+
"test": "vitest run"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@effing/serde": "catalog:",
|
|
27
|
+
"tsup": "^8.0.0",
|
|
28
|
+
"typescript": "catalog:",
|
|
29
|
+
"vitest": "catalog:"
|
|
30
|
+
}
|
|
31
|
+
}
|