Skip to content

Commit e188fc2

Browse files
committed
feat: sync to 4.6.0
1 parent a46c12e commit e188fc2

18 files changed

Lines changed: 3227 additions & 333 deletions

packages/cbjs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"node": ">=18.20.4"
2626
},
2727
"scripts": {
28-
"install": "node ./scripts/install.mjs 4.4.5",
28+
"install": "node ./scripts/install.mjs 4.5.0",
2929
"reinstall": "rm -f src/couchbase-native.node && rm -f dist/src/couchbase-native.node && pnpm install",
3030
"build": "tsc -p tsconfig.build.json",
3131
"dev": "tsc -p tsconfig.build.json --watch",
@@ -62,7 +62,7 @@
6262
"tar": "^6.2.0"
6363
},
6464
"devDependencies": {
65-
"@types/node": "^20.14.5",
65+
"@types/node": "^22.14.1",
6666
"typescript": "5.4.5",
6767
"vitest": "3.0.5"
6868
},

packages/cbjs/src/binarycollection.ts

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17+
import { CasInput } from '@cbjsdev/shared';
18+
19+
import { CppCasInput } from './binding.js';
1720
import type { AnyCollection } from './clusterTypes/index.js';
1821
import type { Collection } from './collection.js';
1922
import { CounterResult, MutationResult } from './crudoptypes.js';
@@ -32,9 +35,15 @@ export interface IncrementOptions {
3235
initial?: number;
3336

3437
/**
35-
* The expiry time that should be set for the document, expressed in seconds.
38+
* Specifies the expiry time for the document.
39+
*
40+
* The expiry can be provided as:
41+
* - A `number` of seconds relative to the current time.
42+
* - A `Date` object for an absolute expiry time.
43+
*
44+
* **IMPORTANT:** To use a Unix timestamp for expiry, construct a Date from it ( new Date(UNIX_TIMESTAMP * 1000) ).
3645
*/
37-
expiry?: number;
46+
expiry?: number | Date;
3847

3948
/**
4049
* Specifies the level of synchronous durability for this operation.
@@ -73,9 +82,15 @@ export interface DecrementOptions {
7382
initial?: number;
7483

7584
/**
76-
* The expiry time that should be set for the document, expressed in seconds.
85+
* Specifies the expiry time for the document.
86+
*
87+
* The expiry can be provided as:
88+
* - A `number` of seconds relative to the current time.
89+
* - A `Date` object for an absolute expiry time.
90+
*
91+
* **IMPORTANT:** To use a Unix timestamp for expiry, construct a Date from it ( new Date(UNIX_TIMESTAMP * 1000) ).
7792
*/
78-
expiry?: number;
93+
expiry?: number | Date;
7994

8095
/**
8196
* Specifies the level of synchronous durability for this operation.
@@ -129,6 +144,12 @@ export interface AppendOptions {
129144
* The timeout for this operation, represented in milliseconds.
130145
*/
131146
timeout?: number;
147+
148+
/**
149+
* If specified, indicates that operation should be failed if the CAS
150+
* has changed from this value, indicating that the document has changed.
151+
*/
152+
cas?: CasInput;
132153
}
133154

134155
/**
@@ -158,6 +179,12 @@ export interface PrependOptions {
158179
* The timeout for this operation, represented in milliseconds.
159180
*/
160181
timeout?: number;
182+
183+
/**
184+
* If specified, indicates that operation should be failed if the CAS
185+
* has changed from this value, indicating that the document has changed.
186+
*/
187+
cas?: CasInput;
161188
}
162189

163190
/**

0 commit comments

Comments
 (0)