@avenlabs/halal-trace-sdk 0.1.1 → 0.1.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/README.md +6 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/node.d.ts +1 -0
- package/dist/node.js +1 -0
- package/dist/utils.js +4 -1
- package/package.json +1 -1
- package/src/index.ts +0 -1
- package/src/node.ts +1 -0
- package/src/utils.ts +4 -2
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -2,4 +2,3 @@ export { ApiClient } from "./client.js";
|
|
|
2
2
|
export type { Anchor, ApiErrorResponse, ApiResponse, AuthResult, AuthSession, AuditLog, AuditPack, AuditPackManifest, Batch, CertificationRecord, Device, DocumentAnchor, EventDepartment, HealthResponse, Hologram, HologramVerification, Invite, Member, Org, OrgInviteResult, OrgUserLookup, Permission, PublicAttribute, RelayerJobSummary, SignatureRecord, TraceEvent, } from "./types.js";
|
|
3
3
|
export { ApiError } from "./http.js";
|
|
4
4
|
export type { AuthOptions, ClientHooks, RetryOptions } from "./http.js";
|
|
5
|
-
export { saveToFile } from "./utils.js";
|
package/dist/index.js
CHANGED
package/dist/node.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { saveToFile } from "./utils.js";
|
package/dist/node.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { saveToFile } from "./utils.js";
|
package/dist/utils.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { writeFile } from "node:fs/promises";
|
|
2
1
|
export const saveToFile = async (path, data) => {
|
|
2
|
+
if (typeof window !== "undefined") {
|
|
3
|
+
throw new Error("saveToFile is only available in Node.js");
|
|
4
|
+
}
|
|
5
|
+
const { writeFile } = await import("node:fs/promises");
|
|
3
6
|
const buffer = data instanceof Uint8Array ? data : Buffer.from(data);
|
|
4
7
|
await writeFile(path, buffer);
|
|
5
8
|
};
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
package/src/node.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { saveToFile } from "./utils.js";
|
package/src/utils.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { writeFile } from "node:fs/promises";
|
|
2
|
-
|
|
3
1
|
export const saveToFile = async (path: string, data: ArrayBuffer | Uint8Array) => {
|
|
2
|
+
if (typeof window !== "undefined") {
|
|
3
|
+
throw new Error("saveToFile is only available in Node.js");
|
|
4
|
+
}
|
|
5
|
+
const { writeFile } = await import("node:fs/promises");
|
|
4
6
|
const buffer = data instanceof Uint8Array ? data : Buffer.from(data);
|
|
5
7
|
await writeFile(path, buffer);
|
|
6
8
|
};
|