@limrun/api 0.5.0 → 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 +29 -0
- package/internal/tslib.js +22 -22
- 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/resources/index.d.mts +2 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +2 -4
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -2
- package/resources/index.mjs.map +1 -1
- package/src/resources/assets-helpers.ts +7 -4
- package/src/resources/index.ts +1 -2
- 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,34 @@
|
|
|
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
|
+
|
|
18
|
+
## 0.5.1 (2025-09-07)
|
|
19
|
+
|
|
20
|
+
Full Changelog: [v0.5.0...v0.5.1](https://github.com/limrun-inc/typescript-sdk/compare/v0.5.0...v0.5.1)
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* **api:** fix the assets property of Limrun class export ([c35bfe7](https://github.com/limrun-inc/typescript-sdk/commit/c35bfe7abbbbc846802118fca3f9d5057083ca74))
|
|
25
|
+
* **examples:** add tunnel example ([1e316ec](https://github.com/limrun-inc/typescript-sdk/commit/1e316ec1d25e645f119c46ce37e0f13d0bf40380))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Chores
|
|
29
|
+
|
|
30
|
+
* lint issue ([96ff769](https://github.com/limrun-inc/typescript-sdk/commit/96ff769ac235de263be7ac9d48ece144a54b7148))
|
|
31
|
+
|
|
3
32
|
## 0.5.0 (2025-09-07)
|
|
4
33
|
|
|
5
34
|
Full Changelog: [v0.4.0...v0.5.0](https://github.com/limrun-inc/typescript-sdk/compare/v0.4.0...v0.5.0)
|
package/internal/tslib.js
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.__setModuleDefault = exports.__createBinding = void 0;
|
|
4
|
-
exports.__exportStar = __exportStar;
|
|
5
4
|
exports.__classPrivateFieldSet = __classPrivateFieldSet;
|
|
6
5
|
exports.__classPrivateFieldGet = __classPrivateFieldGet;
|
|
7
6
|
exports.__importStar = __importStar;
|
|
7
|
+
exports.__exportStar = __exportStar;
|
|
8
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
9
|
+
if (kind === "m")
|
|
10
|
+
throw new TypeError("Private method is not writable");
|
|
11
|
+
if (kind === "a" && !f)
|
|
12
|
+
throw new TypeError("Private accessor was defined without a setter");
|
|
13
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
14
|
+
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
15
|
+
return kind === "a" ? f.call(receiver, value) : f ? (f.value = value) : state.set(receiver, value), value;
|
|
16
|
+
}
|
|
17
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
18
|
+
if (kind === "a" && !f)
|
|
19
|
+
throw new TypeError("Private accessor was defined without a getter");
|
|
20
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
21
|
+
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
22
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
23
|
+
}
|
|
8
24
|
var __createBinding = Object.create
|
|
9
25
|
? function (o, m, k, k2) {
|
|
10
26
|
if (k2 === void 0)
|
|
@@ -26,27 +42,6 @@ var __createBinding = Object.create
|
|
|
26
42
|
o[k2] = m[k];
|
|
27
43
|
};
|
|
28
44
|
exports.__createBinding = __createBinding;
|
|
29
|
-
function __exportStar(m, o) {
|
|
30
|
-
for (var p in m)
|
|
31
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
32
|
-
__createBinding(o, m, p);
|
|
33
|
-
}
|
|
34
|
-
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
35
|
-
if (kind === "m")
|
|
36
|
-
throw new TypeError("Private method is not writable");
|
|
37
|
-
if (kind === "a" && !f)
|
|
38
|
-
throw new TypeError("Private accessor was defined without a setter");
|
|
39
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
40
|
-
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
41
|
-
return kind === "a" ? f.call(receiver, value) : f ? (f.value = value) : state.set(receiver, value), value;
|
|
42
|
-
}
|
|
43
|
-
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
44
|
-
if (kind === "a" && !f)
|
|
45
|
-
throw new TypeError("Private accessor was defined without a getter");
|
|
46
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
|
|
47
|
-
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
48
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
49
|
-
}
|
|
50
45
|
var __setModuleDefault = Object.create
|
|
51
46
|
? function (o, v) {
|
|
52
47
|
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
@@ -79,3 +74,8 @@ function __importStar(mod) {
|
|
|
79
74
|
__setModuleDefault(result, mod);
|
|
80
75
|
return result;
|
|
81
76
|
}
|
|
77
|
+
function __exportStar(m, o) {
|
|
78
|
+
for (var p in m)
|
|
79
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
|
80
|
+
__createBinding(o, m, p);
|
|
81
|
+
}
|
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,IAAI;OAG5B,EAAE,MAAM,IAAI,eAAe,EAAE;AAqBpC,MAAM,OAAO,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,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;SACvC,EACD,OAAO,CACR,CAAC;QACF,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1C,MAAM,GAAG,GAAG,UAAU,CAAC,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"}
|
package/resources/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { AndroidInstances, type AndroidInstance, type AndroidInstanceState, type AndroidInstanceListResponse, type AndroidInstanceCreateParams, type AndroidInstanceListParams, } from "./android-instances.mjs";
|
|
2
|
-
export {
|
|
3
|
-
export
|
|
2
|
+
export { type Asset, type AssetListResponse, type AssetGetOrCreateResponse, type AssetListParams, type AssetGetParams, type AssetGetOrCreateParams, } from "./assets.mjs";
|
|
3
|
+
export { Assets, AssetGetOrUploadParams, AssetGetOrUploadResponse } from "./assets-helpers.mjs";
|
|
4
4
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,GAC/B;OACM,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,GAC/B;OACM,EACL,KAAK,KAAK,EACV,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,sBAAsB,GAC5B;OAEM,EAAE,MAAM,EAAE,sBAAsB,EAAE,wBAAwB,EAAE"}
|
package/resources/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { AndroidInstances, type AndroidInstance, type AndroidInstanceState, type AndroidInstanceListResponse, type AndroidInstanceCreateParams, type AndroidInstanceListParams, } from "./android-instances.js";
|
|
2
|
-
export {
|
|
3
|
-
export
|
|
2
|
+
export { type Asset, type AssetListResponse, type AssetGetOrCreateResponse, type AssetListParams, type AssetGetParams, type AssetGetOrCreateParams, } from "./assets.js";
|
|
3
|
+
export { Assets, AssetGetOrUploadParams, AssetGetOrUploadResponse } from "./assets-helpers.js";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/resources/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,GAC/B;OACM,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,GAC/B;OACM,EACL,KAAK,KAAK,EACV,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,sBAAsB,GAC5B;OAEM,EAAE,MAAM,EAAE,sBAAsB,EAAE,wBAAwB,EAAE"}
|
package/resources/index.js
CHANGED
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.Assets = exports.AndroidInstances = void 0;
|
|
5
|
-
const tslib_1 = require("../internal/tslib.js");
|
|
6
5
|
var android_instances_1 = require("./android-instances.js");
|
|
7
6
|
Object.defineProperty(exports, "AndroidInstances", { enumerable: true, get: function () { return android_instances_1.AndroidInstances; } });
|
|
8
|
-
var
|
|
9
|
-
Object.defineProperty(exports, "Assets", { enumerable: true, get: function () { return
|
|
10
|
-
tslib_1.__exportStar(require("./assets-helpers.js"), exports);
|
|
7
|
+
var assets_helpers_1 = require("./assets-helpers.js");
|
|
8
|
+
Object.defineProperty(exports, "Assets", { enumerable: true, get: function () { return assets_helpers_1.Assets; } });
|
|
11
9
|
//# sourceMappingURL=index.js.map
|
package/resources/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,4DAO6B;AAN3B,qHAAA,gBAAgB,OAAA;AAgBlB,sDAA4F;AAAnF,wGAAA,MAAM,OAAA"}
|
package/resources/index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
export { AndroidInstances, } from "./android-instances.mjs";
|
|
3
|
-
export { Assets
|
|
4
|
-
export * from "./assets-helpers.mjs";
|
|
3
|
+
export { Assets } from "./assets-helpers.mjs";
|
|
5
4
|
//# sourceMappingURL=index.mjs.map
|
package/resources/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,gBAAgB,GAMjB;
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,gBAAgB,GAMjB;OAUM,EAAE,MAAM,EAAoD"}
|
|
@@ -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/resources/index.ts
CHANGED
|
@@ -9,7 +9,6 @@ export {
|
|
|
9
9
|
type AndroidInstanceListParams,
|
|
10
10
|
} from './android-instances';
|
|
11
11
|
export {
|
|
12
|
-
Assets,
|
|
13
12
|
type Asset,
|
|
14
13
|
type AssetListResponse,
|
|
15
14
|
type AssetGetOrCreateResponse,
|
|
@@ -18,4 +17,4 @@ export {
|
|
|
18
17
|
type AssetGetOrCreateParams,
|
|
19
18
|
} from './assets';
|
|
20
19
|
|
|
21
|
-
export
|
|
20
|
+
export { Assets, AssetGetOrUploadParams, AssetGetOrUploadResponse } from './assets-helpers';
|
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
|