ccdeck 3.49.1 → 3.51.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.
Files changed (114) hide show
  1. package/README.md +7 -3
  2. package/THIRD_PARTY_NOTICES.md +28 -0
  3. package/bin/cli/commands.js +34 -3
  4. package/bin/cli/second-start.js +6 -1
  5. package/dist/web/assets/BrowserWatchModal-CDpunrq9.js +1 -0
  6. package/dist/web/assets/IntegrationModal-BctMcNU8.js +7 -0
  7. package/dist/web/assets/{RadioPanel-gFYxdsBg.js → RadioPanel-DQNFtYOx.js} +1 -1
  8. package/dist/web/assets/{TrafficRadar-B9MfKca4.js → TrafficRadar-DRt3Al7E.js} +1 -1
  9. package/dist/web/assets/UsageHistoryModal-DlgPufgs.js +1 -0
  10. package/dist/web/assets/{app-D2NP6IPl.js → app-4x4wTE-L.js} +73 -73
  11. package/dist/web/assets/{app-DfGYllmZ.css → app-o4kL0FgZ.css} +1 -1
  12. package/dist/web/assets/{index-Be6Ox-74.js → index-CWUj8Kqh.js} +1 -1
  13. package/dist/web/index.html +3 -3
  14. package/node_modules/bare-addon-resolve/LICENSE +201 -0
  15. package/node_modules/bare-addon-resolve/README.md +226 -0
  16. package/node_modules/bare-addon-resolve/index.d.ts +100 -0
  17. package/node_modules/bare-addon-resolve/index.js +531 -0
  18. package/node_modules/bare-addon-resolve/lib/errors.d.ts +16 -0
  19. package/node_modules/bare-addon-resolve/lib/errors.js +21 -0
  20. package/node_modules/bare-addon-resolve/package.json +57 -0
  21. package/node_modules/bare-module-resolve/LICENSE +201 -0
  22. package/node_modules/bare-module-resolve/README.md +322 -0
  23. package/node_modules/bare-module-resolve/index.d.ts +171 -0
  24. package/node_modules/bare-module-resolve/index.js +899 -0
  25. package/node_modules/bare-module-resolve/lib/errors.d.ts +31 -0
  26. package/node_modules/bare-module-resolve/lib/errors.js +37 -0
  27. package/node_modules/bare-module-resolve/package.json +56 -0
  28. package/node_modules/bare-semver/LICENSE +201 -0
  29. package/node_modules/bare-semver/README.md +147 -0
  30. package/node_modules/bare-semver/index.d.ts +61 -0
  31. package/node_modules/bare-semver/index.js +13 -0
  32. package/node_modules/bare-semver/lib/comparator.js +37 -0
  33. package/node_modules/bare-semver/lib/constants.js +7 -0
  34. package/node_modules/bare-semver/lib/errors.js +22 -0
  35. package/node_modules/bare-semver/lib/range.js +256 -0
  36. package/node_modules/bare-semver/lib/version.js +240 -0
  37. package/node_modules/bare-semver/package.json +43 -0
  38. package/node_modules/fs-native-extensions/CMakeLists.txt +118 -0
  39. package/node_modules/fs-native-extensions/LICENSE +201 -0
  40. package/node_modules/fs-native-extensions/README.md +160 -0
  41. package/node_modules/fs-native-extensions/binding.c +1825 -0
  42. package/node_modules/fs-native-extensions/binding.js +3 -0
  43. package/node_modules/fs-native-extensions/include/fs-ext.h +193 -0
  44. package/node_modules/fs-native-extensions/index.js +356 -0
  45. package/node_modules/fs-native-extensions/package.json +72 -0
  46. package/node_modules/fs-native-extensions/prebuilds/android-arm/fs-native-extensions.bare +0 -0
  47. package/node_modules/fs-native-extensions/prebuilds/android-arm/fs-native-extensions.node +0 -0
  48. package/node_modules/fs-native-extensions/prebuilds/android-arm64/fs-native-extensions.bare +0 -0
  49. package/node_modules/fs-native-extensions/prebuilds/android-arm64/fs-native-extensions.node +0 -0
  50. package/node_modules/fs-native-extensions/prebuilds/android-ia32/fs-native-extensions.bare +0 -0
  51. package/node_modules/fs-native-extensions/prebuilds/android-ia32/fs-native-extensions.node +0 -0
  52. package/node_modules/fs-native-extensions/prebuilds/android-x64/fs-native-extensions.bare +0 -0
  53. package/node_modules/fs-native-extensions/prebuilds/android-x64/fs-native-extensions.node +0 -0
  54. package/node_modules/fs-native-extensions/prebuilds/darwin-arm64/fs-native-extensions.bare +0 -0
  55. package/node_modules/fs-native-extensions/prebuilds/darwin-arm64/fs-native-extensions.node +0 -0
  56. package/node_modules/fs-native-extensions/prebuilds/darwin-x64/fs-native-extensions.bare +0 -0
  57. package/node_modules/fs-native-extensions/prebuilds/darwin-x64/fs-native-extensions.node +0 -0
  58. package/node_modules/fs-native-extensions/prebuilds/ios-arm64/fs-native-extensions.bare +0 -0
  59. package/node_modules/fs-native-extensions/prebuilds/ios-arm64-simulator/fs-native-extensions.bare +0 -0
  60. package/node_modules/fs-native-extensions/prebuilds/ios-x64-simulator/fs-native-extensions.bare +0 -0
  61. package/node_modules/fs-native-extensions/prebuilds/linux-arm64/fs-native-extensions.bare +0 -0
  62. package/node_modules/fs-native-extensions/prebuilds/linux-arm64/fs-native-extensions.node +0 -0
  63. package/node_modules/fs-native-extensions/prebuilds/linux-x64/fs-native-extensions.bare +0 -0
  64. package/node_modules/fs-native-extensions/prebuilds/linux-x64/fs-native-extensions.node +0 -0
  65. package/node_modules/fs-native-extensions/prebuilds/win32-arm64/fs-native-extensions.bare +0 -0
  66. package/node_modules/fs-native-extensions/prebuilds/win32-arm64/fs-native-extensions.node +0 -0
  67. package/node_modules/fs-native-extensions/prebuilds/win32-x64/fs-native-extensions.bare +0 -0
  68. package/node_modules/fs-native-extensions/prebuilds/win32-x64/fs-native-extensions.node +0 -0
  69. package/node_modules/fs-native-extensions/src/apple.c +197 -0
  70. package/node_modules/fs-native-extensions/src/linux.c +146 -0
  71. package/node_modules/fs-native-extensions/src/platform.h +51 -0
  72. package/node_modules/fs-native-extensions/src/posix.c +33 -0
  73. package/node_modules/fs-native-extensions/src/shared.c +397 -0
  74. package/node_modules/fs-native-extensions/src/win32/nt.h +226 -0
  75. package/node_modules/fs-native-extensions/src/win32.c +531 -0
  76. package/node_modules/require-addon/LICENSE +201 -0
  77. package/node_modules/require-addon/README.md +19 -0
  78. package/node_modules/require-addon/lib/bare.js +1 -0
  79. package/node_modules/require-addon/lib/default.js +7 -0
  80. package/node_modules/require-addon/lib/node.js +79 -0
  81. package/node_modules/require-addon/package.json +64 -0
  82. package/node_modules/which-runtime/LICENSE +201 -0
  83. package/node_modules/which-runtime/README.md +29 -0
  84. package/node_modules/which-runtime/index.js +36 -0
  85. package/node_modules/which-runtime/package.json +32 -0
  86. package/package.json +12 -2
  87. package/release-notes.json +25 -0
  88. package/src/server/claude-accounts.mjs +19 -3
  89. package/src/server/claude-collector.mjs +18 -2
  90. package/src/server/cswap-install.mjs +60 -18
  91. package/src/server/integrations/jira-comment.mjs +37 -0
  92. package/src/server/integrations/jira-move.mjs +37 -11
  93. package/src/server/integrations/jira-transition.mjs +43 -0
  94. package/src/server/integrations/jira-write-guard.mjs +218 -0
  95. package/src/server/integrations/jira.mjs +16 -0
  96. package/src/server/integrations/routes.mjs +70 -7
  97. package/src/server/lan-deck.mjs +9 -0
  98. package/src/server/lan-engine.mjs +17 -2
  99. package/src/server/lan-manifest.mjs +10 -3
  100. package/src/server/lifecycle.mjs +27 -2
  101. package/src/server/login-guard.mjs +4 -0
  102. package/src/server/npm-upgrade.mjs +46 -18
  103. package/src/server/pinned-build.mjs +5 -0
  104. package/src/server/quota-store-resets.mjs +13 -6
  105. package/src/server/quota.mjs +8 -1
  106. package/src/server/running-deck.mjs +14 -0
  107. package/src/server/static-cache.mjs +34 -16
  108. package/src/server/terminal-cli-update.mjs +189 -0
  109. package/src/server/terminal-cli.mjs +93 -0
  110. package/src/server/traffic-radar-wire.mjs +6 -0
  111. package/src/server/usage-share.mjs +444 -0
  112. package/dist/web/assets/BrowserWatchModal-CCARqAMn.js +0 -1
  113. package/dist/web/assets/IntegrationModal-B8t53aE5.js +0 -7
  114. package/dist/web/assets/UsageHistoryModal-DvYWhsYv.js +0 -1
@@ -0,0 +1,3 @@
1
+ require.addon = require('require-addon')
2
+
3
+ module.exports = require.addon('.', __filename)
@@ -0,0 +1,193 @@
1
+ #ifndef FS_EXT_H
2
+ #define FS_EXT_H
3
+
4
+ #ifdef __cplusplus
5
+ extern "C" {
6
+ #endif
7
+
8
+ #include <stdint.h>
9
+ #include <uv.h>
10
+
11
+ // Requests
12
+
13
+ typedef struct fs_ext_lock_s fs_ext_lock_t;
14
+ typedef struct fs_ext_trim_s fs_ext_trim_t;
15
+ typedef struct fs_ext_sparse_s fs_ext_sparse_t;
16
+ typedef struct fs_ext_swap_s fs_ext_swap_t;
17
+ typedef struct fs_ext_get_attr_s fs_ext_get_attr_t;
18
+ typedef struct fs_ext_set_attr_s fs_ext_set_attr_t;
19
+ typedef struct fs_ext_remove_attr_s fs_ext_remove_attr_t;
20
+ typedef struct fs_ext_list_attrs_s fs_ext_list_attrs_t;
21
+
22
+ // Callbacks
23
+
24
+ typedef void (*fs_ext_lock_cb)(fs_ext_lock_t *req, int status);
25
+ typedef void (*fs_ext_trim_cb)(fs_ext_trim_t *req, int status);
26
+ typedef void (*fs_ext_sparse_cb)(fs_ext_sparse_t *req, int status);
27
+ typedef void (*fs_ext_swap_cb)(fs_ext_swap_t *req, int status);
28
+ typedef void (*fs_ext_get_attr_cb)(fs_ext_get_attr_t *req, int status, const uv_buf_t *value);
29
+ typedef void (*fs_ext_set_attr_cb)(fs_ext_set_attr_t *req, int status);
30
+ typedef void (*fs_ext_remove_attr_cb)(fs_ext_remove_attr_t *req, int status);
31
+ typedef void (*fs_ext_list_attrs_cb)(fs_ext_list_attrs_t *req, int status, const char *attrs[], ssize_t len);
32
+
33
+ typedef enum {
34
+ FS_EXT_RDLOCK = 1,
35
+ FS_EXT_WRLOCK,
36
+ } fs_ext_lock_type_t;
37
+
38
+ struct fs_ext_lock_s {
39
+ uv_thread_t thread;
40
+ uv_async_t signal;
41
+
42
+ uv_os_fd_t fd;
43
+ uint64_t offset;
44
+ uint64_t length;
45
+ fs_ext_lock_type_t type;
46
+
47
+ fs_ext_lock_cb cb;
48
+
49
+ int result;
50
+
51
+ void *data;
52
+ };
53
+
54
+ struct fs_ext_trim_s {
55
+ uv_work_t req;
56
+
57
+ uv_os_fd_t fd;
58
+ uint64_t offset;
59
+ uint64_t length;
60
+
61
+ fs_ext_trim_cb cb;
62
+
63
+ int result;
64
+
65
+ void *data;
66
+ };
67
+
68
+ struct fs_ext_sparse_s {
69
+ uv_work_t req;
70
+
71
+ uv_os_fd_t fd;
72
+
73
+ fs_ext_sparse_cb cb;
74
+
75
+ int result;
76
+
77
+ void *data;
78
+ };
79
+
80
+ struct fs_ext_swap_s {
81
+ uv_work_t req;
82
+
83
+ char *from;
84
+ char *to;
85
+
86
+ fs_ext_swap_cb cb;
87
+
88
+ int result;
89
+
90
+ void *data;
91
+ };
92
+
93
+ struct fs_ext_get_attr_s {
94
+ uv_work_t req;
95
+
96
+ uv_os_fd_t fd;
97
+ char *name;
98
+ uv_buf_t value;
99
+
100
+ fs_ext_get_attr_cb cb;
101
+
102
+ int result;
103
+
104
+ void *data;
105
+ };
106
+
107
+ struct fs_ext_set_attr_s {
108
+ uv_work_t req;
109
+
110
+ uv_os_fd_t fd;
111
+ char *name;
112
+ uv_buf_t value;
113
+
114
+ fs_ext_set_attr_cb cb;
115
+
116
+ int result;
117
+
118
+ void *data;
119
+ };
120
+
121
+ struct fs_ext_remove_attr_s {
122
+ uv_work_t req;
123
+
124
+ uv_os_fd_t fd;
125
+ char *name;
126
+
127
+ fs_ext_remove_attr_cb cb;
128
+
129
+ int result;
130
+
131
+ void *data;
132
+ };
133
+
134
+ struct fs_ext_list_attrs_s {
135
+ uv_work_t req;
136
+
137
+ uv_os_fd_t fd;
138
+ char *names;
139
+ size_t length;
140
+
141
+ fs_ext_list_attrs_cb cb;
142
+
143
+ int result;
144
+
145
+ void *data;
146
+ };
147
+
148
+ int
149
+ fs_ext_try_lock(uv_os_fd_t fd, uint64_t offset, size_t length, fs_ext_lock_type_t type);
150
+
151
+ int
152
+ fs_ext_wait_for_lock(uv_loop_t *loop, fs_ext_lock_t *req, uv_os_fd_t fd, uint64_t offset, size_t length, fs_ext_lock_type_t type, fs_ext_lock_cb cb);
153
+
154
+ int
155
+ fs_ext_try_downgrade_lock(uv_os_fd_t fd, uint64_t offset, size_t length);
156
+
157
+ int
158
+ fs_ext_wait_for_downgrade_lock(uv_loop_t *loop, fs_ext_lock_t *req, uv_os_fd_t fd, uint64_t offset, size_t length, fs_ext_lock_cb cb);
159
+
160
+ int
161
+ fs_ext_try_upgrade_lock(uv_os_fd_t fd, uint64_t offset, size_t length);
162
+
163
+ int
164
+ fs_ext_wait_for_upgrade_lock(uv_loop_t *loop, fs_ext_lock_t *req, uv_os_fd_t fd, uint64_t offset, size_t length, fs_ext_lock_cb cb);
165
+
166
+ int
167
+ fs_ext_unlock(uv_os_fd_t fd, uint64_t offset, size_t length);
168
+
169
+ int
170
+ fs_ext_trim(uv_loop_t *loop, fs_ext_trim_t *req, uv_os_fd_t fd, uint64_t offset, size_t length, fs_ext_trim_cb cb);
171
+
172
+ int
173
+ fs_ext_sparse(uv_loop_t *loop, fs_ext_sparse_t *req, uv_os_fd_t fd, fs_ext_sparse_cb cb);
174
+
175
+ int
176
+ fs_ext_swap(uv_loop_t *loop, fs_ext_swap_t *req, const char *from, const char *to, fs_ext_swap_cb cb);
177
+
178
+ int
179
+ fs_ext_get_attr(uv_loop_t *loop, fs_ext_get_attr_t *req, uv_os_fd_t fd, const char *name, fs_ext_get_attr_cb cb);
180
+
181
+ int
182
+ fs_ext_set_attr(uv_loop_t *loop, fs_ext_set_attr_t *req, uv_os_fd_t fd, const char *name, const uv_buf_t *value, fs_ext_set_attr_cb cb);
183
+
184
+ int
185
+ fs_ext_remove_attr(uv_loop_t *loop, fs_ext_remove_attr_t *req, uv_os_fd_t fd, const char *name, fs_ext_remove_attr_cb cb);
186
+
187
+ int
188
+ fs_ext_list_attrs(uv_loop_t *loop, fs_ext_list_attrs_t *req, uv_os_fd_t fd, fs_ext_list_attrs_cb cb);
189
+
190
+ #ifdef __cplusplus
191
+ }
192
+ #endif
193
+ #endif // FS_EXT_H
@@ -0,0 +1,356 @@
1
+ const { isWindows } = require('which-runtime')
2
+ const binding = require('./binding')
3
+
4
+ function onwork(err, result) {
5
+ if (err) this.reject(err)
6
+ else this.resolve(result)
7
+ }
8
+
9
+ exports.tryLock = function tryLock(fd, offset = 0, length = 0, opts = {}) {
10
+ if (typeof offset === 'object') {
11
+ opts = offset
12
+ offset = 0
13
+ }
14
+
15
+ if (typeof length === 'object') {
16
+ opts = length
17
+ length = 0
18
+ }
19
+
20
+ if (typeof opts !== 'object' || opts === null) {
21
+ opts = {}
22
+ }
23
+
24
+ try {
25
+ binding.tryLock(fd, offset, length, opts.shared !== true)
26
+ } catch (err) {
27
+ if (err.code === 'EAGAIN') return false
28
+ throw err
29
+ }
30
+
31
+ return true
32
+ }
33
+
34
+ exports.waitForLock = function waitForLock(fd, offset = 0, length = 0, opts = {}) {
35
+ if (typeof offset === 'object') {
36
+ opts = offset
37
+ offset = 0
38
+ }
39
+
40
+ if (typeof length === 'object') {
41
+ opts = length
42
+ length = 0
43
+ }
44
+
45
+ if (typeof opts !== 'object' || opts === null) {
46
+ opts = {}
47
+ }
48
+
49
+ const req = {
50
+ handle: null,
51
+ resolve: null,
52
+ reject: null
53
+ }
54
+
55
+ const promise = new Promise((resolve, reject) => {
56
+ req.resolve = resolve
57
+ req.reject = reject
58
+ })
59
+
60
+ try {
61
+ req.handle = binding.waitForLock(fd, offset, length, opts.shared !== true, req, onwork)
62
+ } catch (err) {
63
+ return Promise.reject(err)
64
+ }
65
+
66
+ return promise
67
+ }
68
+
69
+ exports.waitForLockSync = function waitForLockSync(fd, offset = 0, length = 0, opts = {}) {
70
+ if (typeof offset === 'object') {
71
+ opts = offset
72
+ offset = 0
73
+ }
74
+
75
+ if (typeof length === 'object') {
76
+ opts = length
77
+ length = 0
78
+ }
79
+
80
+ if (typeof opts !== 'object' || opts === null) {
81
+ opts = {}
82
+ }
83
+
84
+ binding.waitForLockSync(fd, offset, length, opts.shared !== true)
85
+ }
86
+
87
+ exports.tryDowngradeLock = function tryDowngradeLock(fd, offset = 0, length = 0) {
88
+ try {
89
+ binding.tryDowngradeLock(fd, offset, length)
90
+ } catch (err) {
91
+ if (err.code === 'EAGAIN') return false
92
+ throw err
93
+ }
94
+
95
+ return true
96
+ }
97
+
98
+ exports.waitForDowngradeLock = function downgradeLock(fd, offset = 0, length = 0) {
99
+ const req = {
100
+ handle: null,
101
+ resolve: null,
102
+ reject: null
103
+ }
104
+
105
+ const promise = new Promise((resolve, reject) => {
106
+ req.resolve = resolve
107
+ req.reject = reject
108
+ })
109
+
110
+ try {
111
+ req.handle = binding.waitForDowngradeLock(fd, offset, length, req, onwork)
112
+ } catch (err) {
113
+ return Promise.reject(err)
114
+ }
115
+
116
+ return promise
117
+ }
118
+
119
+ exports.waitForDowngradeLockSync = function waitForDowngradeLockSync(fd, offset = 0, length = 0) {
120
+ binding.waitForDowngradeLockSync(fd, offset, length)
121
+ }
122
+
123
+ exports.tryUpgradeLock = function tryUpgradeLock(fd, offset = 0, length = 0) {
124
+ try {
125
+ binding.tryUpgradeLock(fd, offset, length)
126
+ } catch (err) {
127
+ if (err.code === 'EAGAIN') return false
128
+ throw err
129
+ }
130
+
131
+ return true
132
+ }
133
+
134
+ exports.waitForUpgradeLock = function upgradeLock(fd, offset = 0, length = 0) {
135
+ const req = {
136
+ handle: null,
137
+ resolve: null,
138
+ reject: null
139
+ }
140
+
141
+ const promise = new Promise((resolve, reject) => {
142
+ req.resolve = resolve
143
+ req.reject = reject
144
+ })
145
+
146
+ try {
147
+ req.handle = binding.waitForUpgradeLock(fd, offset, length, req, onwork)
148
+ } catch (err) {
149
+ return Promise.reject(err)
150
+ }
151
+
152
+ return promise
153
+ }
154
+
155
+ exports.waitForUpgradeLockSync = function waitForUpgradeLockSync(fd, offset = 0, length = 0) {
156
+ binding.waitForUpgradeLockSync(fd, offset, length)
157
+ }
158
+
159
+ exports.unlock = function unlock(fd, offset = 0, length = 0) {
160
+ binding.unlock(fd, offset, length)
161
+ }
162
+
163
+ exports.trim = function trim(fd, offset, length) {
164
+ const req = {
165
+ handle: null,
166
+ resolve: null,
167
+ reject: null
168
+ }
169
+
170
+ const promise = new Promise((resolve, reject) => {
171
+ req.resolve = resolve
172
+ req.reject = reject
173
+ })
174
+
175
+ try {
176
+ req.handle = binding.trim(fd, offset, length, req, onwork)
177
+ } catch (err) {
178
+ return Promise.reject(err)
179
+ }
180
+
181
+ return promise
182
+ }
183
+
184
+ exports.trimSync = function trimSync(fd, offset, length) {
185
+ binding.trimSync(fd, offset, length)
186
+ }
187
+
188
+ exports.sparse = function sparse(fd) {
189
+ // Short circuit on everything but Windows
190
+ if (!isWindows) return Promise.resolve()
191
+
192
+ const req = {
193
+ handle: null,
194
+ resolve: null,
195
+ reject: null
196
+ }
197
+
198
+ const promise = new Promise((resolve, reject) => {
199
+ req.resolve = resolve
200
+ req.reject = reject
201
+ })
202
+
203
+ try {
204
+ req.handle = binding.sparse(fd, req, onwork)
205
+ } catch (err) {
206
+ return Promise.reject(err)
207
+ }
208
+
209
+ return promise
210
+ }
211
+
212
+ exports.sparseSync = function sparseSync(fd) {
213
+ // Short circuit on everything but Windows
214
+ if (!isWindows) return
215
+
216
+ binding.sparseSync(fd)
217
+ }
218
+
219
+ exports.swap = function swap(from, to) {
220
+ const req = {
221
+ handle: null,
222
+ resolve: null,
223
+ reject: null
224
+ }
225
+
226
+ const promise = new Promise((resolve, reject) => {
227
+ req.resolve = resolve
228
+ req.reject = reject
229
+ })
230
+
231
+ try {
232
+ req.handle = binding.swap(from, to, req, onwork)
233
+ } catch (err) {
234
+ return Promise.reject(err)
235
+ }
236
+
237
+ return promise
238
+ }
239
+
240
+ exports.swapSync = function swapSync(from, to) {
241
+ binding.swapSync(from, to)
242
+ }
243
+
244
+ exports.getAttr = function getAttr(fd, name) {
245
+ const req = {
246
+ handle: null,
247
+ resolve: null,
248
+ reject: null
249
+ }
250
+
251
+ const promise = new Promise((resolve, reject) => {
252
+ req.resolve = resolve
253
+ req.reject = reject
254
+ })
255
+
256
+ try {
257
+ req.handle = binding.getAttr(fd, name, req, onwork)
258
+ } catch (err) {
259
+ return Promise.reject(err)
260
+ }
261
+
262
+ return promise.then((buffer) => (buffer === null ? null : Buffer.from(buffer)))
263
+ }
264
+
265
+ exports.getAttrSync = function getAttrSync(fd, name) {
266
+ const buffer = binding.getAttrSync(fd, name)
267
+ return buffer === null ? null : Buffer.from(buffer)
268
+ }
269
+
270
+ exports.setAttr = function setAttr(fd, name, value, encoding) {
271
+ if (typeof value === 'string') value = Buffer.from(value, encoding)
272
+
273
+ const req = {
274
+ value,
275
+ handle: null,
276
+ resolve: null,
277
+ reject: null
278
+ }
279
+
280
+ const promise = new Promise((resolve, reject) => {
281
+ req.resolve = resolve
282
+ req.reject = reject
283
+ })
284
+
285
+ try {
286
+ req.handle = binding.setAttr(
287
+ fd,
288
+ name,
289
+ value.buffer,
290
+ value.byteOffset,
291
+ value.byteLength,
292
+ req,
293
+ onwork
294
+ )
295
+ } catch (err) {
296
+ return Promise.reject(err)
297
+ }
298
+
299
+ return promise
300
+ }
301
+
302
+ exports.setAttrSync = function setAttrSync(fd, name, value, encoding) {
303
+ if (typeof value === 'string') value = Buffer.from(value, encoding)
304
+
305
+ binding.setAttrSync(fd, name, value.buffer, value.byteOffset, value.byteLength)
306
+ }
307
+
308
+ exports.removeAttr = function removeAttr(fd, name) {
309
+ const req = {
310
+ handle: null,
311
+ resolve: null,
312
+ reject: null
313
+ }
314
+
315
+ const promise = new Promise((resolve, reject) => {
316
+ req.resolve = resolve
317
+ req.reject = reject
318
+ })
319
+
320
+ try {
321
+ req.handle = binding.removeAttr(fd, name, req, onwork)
322
+ } catch (err) {
323
+ return Promise.reject(err)
324
+ }
325
+
326
+ return promise
327
+ }
328
+
329
+ exports.removeAttrSync = function removeAttrSync(fd, name) {
330
+ binding.removeAttrSync(fd, name)
331
+ }
332
+
333
+ exports.listAttrs = function listAttrs(fd) {
334
+ const req = {
335
+ handle: null,
336
+ resolve: null,
337
+ reject: null
338
+ }
339
+
340
+ const promise = new Promise((resolve, reject) => {
341
+ req.resolve = resolve
342
+ req.reject = reject
343
+ })
344
+
345
+ try {
346
+ req.handle = binding.listAttrs(fd, req, onwork)
347
+ } catch (err) {
348
+ return Promise.reject(err)
349
+ }
350
+
351
+ return promise
352
+ }
353
+
354
+ exports.listAttrsSync = function listAttrsSync(fd) {
355
+ return binding.listAttrsSync(fd)
356
+ }
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "fs-native-extensions",
3
+ "version": "1.5.2",
4
+ "description": "Native file system extensions for advanced file operations",
5
+ "main": "index.js",
6
+ "files": [
7
+ "index.js",
8
+ "macros.h",
9
+ "binding.c",
10
+ "binding.js",
11
+ "CMakeLists.txt",
12
+ "include",
13
+ "src",
14
+ "prebuilds"
15
+ ],
16
+ "imports": {
17
+ "child_process": {
18
+ "bare": "bare-subprocess",
19
+ "default": "child_process"
20
+ },
21
+ "fs": {
22
+ "bare": "bare-fs",
23
+ "default": "fs"
24
+ },
25
+ "fs/*": {
26
+ "bare": "bare-fs/*",
27
+ "default": "fs/*"
28
+ },
29
+ "path": {
30
+ "bare": "bare-path",
31
+ "default": "path"
32
+ }
33
+ },
34
+ "addon": true,
35
+ "scripts": {
36
+ "format": "prettier --write .",
37
+ "lint": "prettier --check . && lunte",
38
+ "test": "npm run test:node && npm run test:bare",
39
+ "test:bare": "brittle-bare --coverage test.js",
40
+ "test:node": "brittle-node --coverage test.js"
41
+ },
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "git+https://github.com/holepunchto/fs-native-extensions.git"
45
+ },
46
+ "author": "Kasper Isager Dalsgarð <kasper@funktionel.co>",
47
+ "license": "Apache-2.0",
48
+ "bugs": {
49
+ "url": "https://github.com/holepunchto/fs-native-extensions/issues"
50
+ },
51
+ "homepage": "https://github.com/holepunchto/fs-native-extensions#readme",
52
+ "dependencies": {
53
+ "require-addon": "^1.1.0",
54
+ "which-runtime": "^1.2.0"
55
+ },
56
+ "devDependencies": {
57
+ "bare-compat-napi": "^1.3.8",
58
+ "bare-fs": "^4.4.4",
59
+ "bare-path": "^3.0.0",
60
+ "bare-subprocess": "^4.0.5",
61
+ "brittle": "^3.1.1",
62
+ "cmake-bare": "^1.1.10",
63
+ "cmake-fetch": "^1.4.7",
64
+ "cmake-napi": "^1.0.5",
65
+ "cmake-npm": "^1.1.0",
66
+ "lunte": "^1.6.0",
67
+ "minimist": "^1.2.6",
68
+ "prettier": "^3.5.3",
69
+ "prettier-config-holepunch": "^2.0.0",
70
+ "test-tmp": "^1.2.1"
71
+ }
72
+ }