@limrun/api 0.5.1 → 0.5.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/CHANGELOG.md +15 -0
- package/package.json +4 -1
- package/resources/assets-helpers.d.mts.map +1 -1
- package/resources/assets-helpers.d.ts.map +1 -1
- package/resources/assets-helpers.js +6 -4
- package/resources/assets-helpers.js.map +1 -1
- package/resources/assets-helpers.mjs +6 -4
- package/resources/assets-helpers.mjs.map +1 -1
- package/src/resources/assets-helpers.ts +7 -4
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.2 (2025-09-07)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.5.1...v0.5.2](https://github.com/limrun-inc/typescript-sdk/compare/v0.5.1...v0.5.2)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** add optional bufferutil lib for websocket performance ([0adf72f](https://github.com/limrun-inc/typescript-sdk/commit/0adf72f7521a552cea3fb670524f37ba95eb0ca3))
|
|
10
|
+
* **examples:** add the backend piece for fullstack example ([27d0ca8](https://github.com/limrun-inc/typescript-sdk/commit/27d0ca8da7d90fed9342c10290f24ece91e0c55f))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Chores
|
|
14
|
+
|
|
15
|
+
* **examples:** fix upload example ([5115276](https://github.com/limrun-inc/typescript-sdk/commit/51152767baf0cb2ecd47e380c006f977c150a96e))
|
|
16
|
+
* lint issues ([fff1159](https://github.com/limrun-inc/typescript-sdk/commit/fff1159b5445b13a115e6348a8453f56a703e8d2))
|
|
17
|
+
|
|
3
18
|
## 0.5.1 (2025-09-07)
|
|
4
19
|
|
|
5
20
|
Full Changelog: [v0.5.0...v0.5.1](https://github.com/limrun-inc/typescript-sdk/compare/v0.5.0...v0.5.1)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@limrun/api",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "The official TypeScript library for the Limrun API",
|
|
5
5
|
"author": "Limrun <contact@limrun.com>",
|
|
6
6
|
"types": "./index.d.ts",
|
|
@@ -136,5 +136,8 @@
|
|
|
136
136
|
"./version.mjs": {
|
|
137
137
|
"default": "./version.mjs"
|
|
138
138
|
}
|
|
139
|
+
},
|
|
140
|
+
"optionalDependencies": {
|
|
141
|
+
"bufferutil": "^4.0.9"
|
|
139
142
|
}
|
|
140
143
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets-helpers.d.mts","sourceRoot":"","sources":["../src/resources/assets-helpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"assets-helpers.d.mts","sourceRoot":"","sources":["../src/resources/assets-helpers.ts"],"names":[],"mappings":"OAIO,EAAE,cAAc,EAAE;OAClB,EAAE,MAAM,IAAI,eAAe,EAAE;AAEpC,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,qBAAa,MAAO,SAAQ,eAAe;IACnC,WAAW,CACf,IAAI,EAAE,sBAAsB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,wBAAwB,CAAC;CAmCrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets-helpers.d.ts","sourceRoot":"","sources":["../src/resources/assets-helpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"assets-helpers.d.ts","sourceRoot":"","sources":["../src/resources/assets-helpers.ts"],"names":[],"mappings":"OAIO,EAAE,cAAc,EAAE;OAClB,EAAE,MAAM,IAAI,eAAe,EAAE;AAEpC,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,qBAAa,MAAO,SAAQ,eAAe;IACnC,WAAW,CACf,IAAI,EAAE,sBAAsB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,wBAAwB,CAAC;CAmCrC"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Assets = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const crypto_1 = require("crypto");
|
|
6
|
+
const fs_1 = require("fs");
|
|
4
7
|
const assets_1 = require("./assets.js");
|
|
5
8
|
class Assets extends assets_1.Assets {
|
|
6
9
|
async getOrUpload(body, options) {
|
|
7
|
-
const { crypto, fs, path } = globalThis;
|
|
8
10
|
const creationResponse = await this.getOrCreate({
|
|
9
|
-
name: body.name ??
|
|
11
|
+
name: body.name ?? (0, path_1.basename)(body.path),
|
|
10
12
|
}, options);
|
|
11
|
-
const data = await
|
|
12
|
-
const md5 =
|
|
13
|
+
const data = await fs_1.promises.readFile(body.path);
|
|
14
|
+
const md5 = (0, crypto_1.createHash)('md5').update(data).digest('hex');
|
|
13
15
|
if (creationResponse.md5 && creationResponse.md5 === md5) {
|
|
14
16
|
return {
|
|
15
17
|
id: creationResponse.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets-helpers.js","sourceRoot":"","sources":["../src/resources/assets-helpers.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"assets-helpers.js","sourceRoot":"","sources":["../src/resources/assets-helpers.ts"],"names":[],"mappings":";;;AAAA,+BAAgC;AAChC,mCAAoC;AACpC,2BAAoC;AAGpC,wCAAqD;AAqBrD,MAAa,MAAO,SAAQ,eAAe;IACzC,KAAK,CAAC,WAAW,CACf,IAA4B,EAC5B,OAAwB;QAExB,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,WAAW,CAC7C;YACE,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,IAAA,eAAQ,EAAC,IAAI,CAAC,IAAI,CAAC;SACvC,EACD,OAAO,CACR,CAAC;QACF,MAAM,IAAI,GAAG,MAAM,aAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1C,MAAM,GAAG,GAAG,IAAA,mBAAU,EAAC,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACzD,IAAI,gBAAgB,CAAC,GAAG,IAAI,gBAAgB,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;YACzD,OAAO;gBACL,EAAE,EAAE,gBAAgB,CAAC,EAAE;gBACvB,IAAI,EAAE,gBAAgB,CAAC,IAAI;gBAC3B,iBAAiB,EAAE,gBAAgB,CAAC,iBAAiB;gBACrD,GAAG,EAAE,gBAAgB,CAAC,GAAG;aAC1B,CAAC;QACJ,CAAC;QACD,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,gBAAgB,CAAC,eAAe,EAAE;YACnE,OAAO,EAAE;gBACP,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;gBACxC,cAAc,EAAE,0BAA0B;aAC3C;YACD,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;SACX,CAAC,CAAC;QACH,IAAI,cAAc,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAClC,MAAM,IAAI,KAAK,CAAC,2BAA2B,cAAc,CAAC,MAAM,IAAI,MAAM,cAAc,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACrG,CAAC;QACD,OAAO;YACL,EAAE,EAAE,gBAAgB,CAAC,EAAE;YACvB,IAAI,EAAE,gBAAgB,CAAC,IAAI;YAC3B,iBAAiB,EAAE,gBAAgB,CAAC,iBAAiB;YACrD,GAAG;SACJ,CAAC;IACJ,CAAC;CACF;AAvCD,wBAuCC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { basename } from 'path';
|
|
2
|
+
import { createHash } from 'crypto';
|
|
3
|
+
import { promises as fs } from 'fs';
|
|
1
4
|
import { Assets as GeneratedAssets } from "./assets.mjs";
|
|
2
5
|
export class Assets extends GeneratedAssets {
|
|
3
6
|
async getOrUpload(body, options) {
|
|
4
|
-
const { crypto, fs, path } = globalThis;
|
|
5
7
|
const creationResponse = await this.getOrCreate({
|
|
6
|
-
name: body.name ??
|
|
8
|
+
name: body.name ?? basename(body.path),
|
|
7
9
|
}, options);
|
|
8
|
-
const data = await fs.
|
|
9
|
-
const md5 =
|
|
10
|
+
const data = await fs.readFile(body.path);
|
|
11
|
+
const md5 = createHash('md5').update(data).digest('hex');
|
|
10
12
|
if (creationResponse.md5 && creationResponse.md5 === md5) {
|
|
11
13
|
return {
|
|
12
14
|
id: creationResponse.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets-helpers.mjs","sourceRoot":"","sources":["../src/resources/assets-helpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"assets-helpers.mjs","sourceRoot":"","sources":["../src/resources/assets-helpers.ts"],"names":[],"mappings":"OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM;OACxB,EAAE,UAAU,EAAE,MAAM,QAAQ;OAC5B,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM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B,CAAC,EAAE;YACvB,IAAI,EAAE,gBAAgB,CAAC,IAAI;YAC3B,iBAAiB,EAAE,gBAAgB,CAAC,iBAAiB;YACrD,GAAG;SACJ,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { basename } from 'path';
|
|
2
|
+
import { createHash } from 'crypto';
|
|
3
|
+
import { promises as fs } from 'fs';
|
|
4
|
+
|
|
1
5
|
import { RequestOptions } from '../internal/request-options';
|
|
2
6
|
import { Assets as GeneratedAssets } from './assets';
|
|
3
7
|
|
|
@@ -25,15 +29,14 @@ export class Assets extends GeneratedAssets {
|
|
|
25
29
|
body: AssetGetOrUploadParams,
|
|
26
30
|
options?: RequestOptions,
|
|
27
31
|
): Promise<AssetGetOrUploadResponse> {
|
|
28
|
-
const { crypto, fs, path } = globalThis as any;
|
|
29
32
|
const creationResponse = await this.getOrCreate(
|
|
30
33
|
{
|
|
31
|
-
name: body.name ??
|
|
34
|
+
name: body.name ?? basename(body.path),
|
|
32
35
|
},
|
|
33
36
|
options,
|
|
34
37
|
);
|
|
35
|
-
const data = await fs.
|
|
36
|
-
const md5 =
|
|
38
|
+
const data = await fs.readFile(body.path);
|
|
39
|
+
const md5 = createHash('md5').update(data).digest('hex');
|
|
37
40
|
if (creationResponse.md5 && creationResponse.md5 === md5) {
|
|
38
41
|
return {
|
|
39
42
|
id: creationResponse.id,
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.5.
|
|
1
|
+
export const VERSION = '0.5.2'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.5.
|
|
1
|
+
export declare const VERSION = "0.5.2";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.5.
|
|
1
|
+
export declare const VERSION = "0.5.2";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.5.
|
|
1
|
+
export const VERSION = '0.5.2'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|