@celljs/ta-gateway 4.33.0 → 4.35.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.
@@ -1,12 +1,10 @@
1
1
  import { createHash, randomBytes } from 'node:crypto';
2
- import { chmodSync, mkdirSync, readdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs';
2
+ import { mkdirSync, readdirSync, readFileSync } from 'node:fs';
3
3
  import { join } from 'node:path';
4
+ import { FileUtil } from '@celljs/core/lib/node/fs';
4
5
  /** Files written whole or not at all, readable by this user only. */
5
6
  export function writePrivate(file, data) {
6
- const temporary = `${file}.${process.pid}.tmp`;
7
- writeFileSync(temporary, JSON.stringify(data, undefined, 2), { mode: 0o600 });
8
- chmodSync(temporary, 0o600);
9
- renameSync(temporary, file);
7
+ FileUtil.write(file, JSON.stringify(data, undefined, 2), { mode: 0o600, mkdir: false });
10
8
  }
11
9
  export var TenantUtil;
12
10
  (function (TenantUtil) {
@@ -5,12 +5,10 @@ exports.writePrivate = writePrivate;
5
5
  const node_crypto_1 = require("node:crypto");
6
6
  const node_fs_1 = require("node:fs");
7
7
  const node_path_1 = require("node:path");
8
+ const fs_1 = require("@celljs/core/lib/node/fs");
8
9
  /** Files written whole or not at all, readable by this user only. */
9
10
  function writePrivate(file, data) {
10
- const temporary = `${file}.${process.pid}.tmp`;
11
- (0, node_fs_1.writeFileSync)(temporary, JSON.stringify(data, undefined, 2), { mode: 0o600 });
12
- (0, node_fs_1.chmodSync)(temporary, 0o600);
13
- (0, node_fs_1.renameSync)(temporary, file);
11
+ fs_1.FileUtil.write(file, JSON.stringify(data, undefined, 2), { mode: 0o600, mkdir: false });
14
12
  }
15
13
  var TenantUtil;
16
14
  (function (TenantUtil) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/ta-gateway",
3
- "version": "4.33.0",
3
+ "version": "4.35.0",
4
4
  "description": "ta gateway: one Ta per account, each in a sandbox of its own, behind one sign-in",
5
5
  "homepage": "https://github.com/cellbang/ta",
6
6
  "bugs": {
@@ -29,10 +29,11 @@
29
29
  "watch": "tsc -b -w --preserveWatchOutput"
30
30
  },
31
31
  "dependencies": {
32
- "@celljs/rpc": "4.33.0",
33
- "@celljs/ta-host": "4.33.0",
34
- "@celljs/ta-protocol": "4.33.0",
35
- "@celljs/ta-relay": "4.33.0"
32
+ "@celljs/core": "4.35.0",
33
+ "@celljs/rpc": "4.35.0",
34
+ "@celljs/ta-host": "4.35.0",
35
+ "@celljs/ta-protocol": "4.35.0",
36
+ "@celljs/ta-relay": "4.35.0"
36
37
  },
37
38
  "publishConfig": {
38
39
  "access": "public"