Skip to content

Commit ad65a46

Browse files
authored
Update examples to latest TSC version (#133)
1 parent ff55a40 commit ad65a46

14 files changed

Lines changed: 590 additions & 208 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
version: [20, 22]
15+
version: [ 20, 22, 24 ]
1616
steps:
1717
- uses: actions/checkout@v6
1818
- uses: actions/setup-node@v6
@@ -47,10 +47,10 @@ jobs:
4747
deterministic-roundtrip,
4848
]
4949
steps:
50-
- uses: actions/checkout@v5
50+
- uses: actions/checkout@v6
5151
- uses: actions/setup-node@v6
5252
with:
53-
node-version: 22
53+
node-version: 24
5454
- name: compilation check
5555
run: |
5656
yarn

examples/deterministic-roundtrip/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"typescript": "^4.0.2"
88
},
99
"dependencies": {
10-
"@ironcorelabs/tenant-security-nodejs": "^3.0.1",
10+
"@ironcorelabs/tenant-security-nodejs": "^4.1.2",
1111
"@types/node": "^14.6.0"
1212
},
1313
"scripts": {

examples/deterministic-roundtrip/yarn.lock

Lines changed: 77 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,50 @@
22
# yarn lockfile v1
33

44

5-
"@ironcorelabs/tenant-security-nodejs@^3.0.1":
6-
version "3.0.1"
7-
resolved "https://registry.yarnpkg.com/@ironcorelabs/tenant-security-nodejs/-/tenant-security-nodejs-3.0.1.tgz#619b2b0b751ee24fd818c05a5fcfb8c0d0ba5af4"
8-
integrity sha512-65Hr7Y1aM1EEgGnsxK0gGRusI3U2cDA7gkf6Mv/IjBt2r7wUOHpzOKTXruJLazrKvDoadEcZzzJl1f0+Ef2Q4Q==
5+
"@hapi/address@^5.1.1":
6+
version "5.1.1"
7+
resolved "https://registry.yarnpkg.com/@hapi/address/-/address-5.1.1.tgz#e9925fc1b65f5cc3fbea821f2b980e4652e84cb6"
8+
integrity sha512-A+po2d/dVoY7cYajycYI43ZbYMXukuopIsqCjh5QzsBCipDtdofHntljDlpccMjIfTy6UOkg+5KPriwYch2bXA==
9+
dependencies:
10+
"@hapi/hoek" "^11.0.2"
11+
12+
"@hapi/formula@^3.0.2":
13+
version "3.0.2"
14+
resolved "https://registry.yarnpkg.com/@hapi/formula/-/formula-3.0.2.tgz#81b538060ee079481c906f599906d163c4badeaf"
15+
integrity sha512-hY5YPNXzw1He7s0iqkRQi+uMGh383CGdyyIGYtB+W5N3KHPXoqychklvHhKCC9M3Xtv0OCs/IHw+r4dcHtBYWw==
16+
17+
"@hapi/hoek@^11.0.2", "@hapi/hoek@^11.0.7":
18+
version "11.0.7"
19+
resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-11.0.7.tgz#56a920793e0a42d10e530da9a64cc0d3919c4002"
20+
integrity sha512-HV5undWkKzcB4RZUusqOpcgxOaq6VOAH7zhhIr2g3G8NF/MlFO75SjOr2NfuSx0Mh40+1FqCkagKLJRykUWoFQ==
21+
22+
"@hapi/pinpoint@^2.0.1":
23+
version "2.0.1"
24+
resolved "https://registry.yarnpkg.com/@hapi/pinpoint/-/pinpoint-2.0.1.tgz#32077e715655fc00ab8df74b6b416114287d6513"
25+
integrity sha512-EKQmr16tM8s16vTT3cA5L0kZZcTMU5DUOZTuvpnY738m+jyP3JIUj+Mm1xc1rsLkGBQ/gVnfKYPwOmPg1tUR4Q==
26+
27+
"@hapi/tlds@^1.1.1":
28+
version "1.1.6"
29+
resolved "https://registry.yarnpkg.com/@hapi/tlds/-/tlds-1.1.6.tgz#c98ed89ca76aa030352d6d7102d0f250aed89cfb"
30+
integrity sha512-xdi7A/4NZokvV0ewovme3aUO5kQhW9pQ2YD1hRqZGhhSi5rBv4usHYidVocXSi9eihYsznZxLtAiEYYUL6VBGw==
31+
32+
"@hapi/topo@^6.0.2":
33+
version "6.0.2"
34+
resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-6.0.2.tgz#f219c1c60da8430228af4c1f2e40c32a0d84bbb4"
35+
integrity sha512-KR3rD5inZbGMrHmgPxsJ9dbi6zEK+C3ZwUwTa+eMwWLz7oijWUTWD2pMSNNYJAU6Qq+65NkxXjqHr/7LM2Xkqg==
36+
dependencies:
37+
"@hapi/hoek" "^11.0.2"
38+
39+
"@ironcorelabs/tenant-security-nodejs@^4.1.2":
40+
version "4.1.2"
41+
resolved "https://registry.yarnpkg.com/@ironcorelabs/tenant-security-nodejs/-/tenant-security-nodejs-4.1.2.tgz#0e2c607777dc4d0604a8d4e3cf8eada26afad637"
42+
integrity sha512-5j+dJPPJloVBkMMtecV9LE90XFifaH/OLngk/BvspNpyYiU275DudtisaAheTxHcbZ7hfCJGRMLiWlXVWO6zgQ==
943
dependencies:
1044
futurejs "2.2.0"
45+
joi "^18.0.2"
1146
miscreant "^0.3.2"
1247
node-fetch "2.6.12"
13-
protobufjs "^7.2.4"
48+
protobufjs "^7.2.5"
1449

1550
"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2":
1651
version "1.1.2"
@@ -22,10 +57,10 @@
2257
resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735"
2358
integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==
2459

25-
"@protobufjs/codegen@^2.0.4":
26-
version "2.0.4"
27-
resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb"
28-
integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==
60+
"@protobufjs/codegen@^2.0.5":
61+
version "2.0.5"
62+
resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.5.tgz#d9315ad7cf3f30aac70bda3c068443dc6f143659"
63+
integrity sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g==
2964

3065
"@protobufjs/eventemitter@^1.1.0":
3166
version "1.1.0"
@@ -50,6 +85,11 @@
5085
resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089"
5186
integrity sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==
5287

88+
"@protobufjs/inquire@^1.1.1":
89+
version "1.1.1"
90+
resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.1.tgz#6cb936f4ac50965230af1e9d0bbfd57ea3675aa4"
91+
integrity sha512-mnzgDV26ueAvk7rsbt9L7bE0SuAoqyuys/sMMrmVcN5x9VsxpcG3rqAUSgDyLp0UZlmNfIbQ4fHfCtreVBk8Ew==
92+
5393
"@protobufjs/path@^1.1.2":
5494
version "1.1.2"
5595
resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d"
@@ -60,10 +100,15 @@
60100
resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54"
61101
integrity sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==
62102

63-
"@protobufjs/utf8@^1.1.0":
103+
"@protobufjs/utf8@^1.1.1":
104+
version "1.1.1"
105+
resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.1.tgz#eaee5900122c110a3dbcb728c0597014a2621774"
106+
integrity sha512-oOAWABowe8EAbMyWKM0tYDKi8Yaox52D+HWZhAIJqQXbqe0xI/GV7FhLWqlEKreMkfDjshR5FKgi3mnle0h6Eg==
107+
108+
"@standard-schema/spec@^1.1.0":
64109
version "1.1.0"
65-
resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570"
66-
integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==
110+
resolved "https://registry.yarnpkg.com/@standard-schema/spec/-/spec-1.1.0.tgz#a79b55dbaf8604812f52d140b2c9ab41bc150bb8"
111+
integrity sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==
67112

68113
"@types/node@>=13.7.0":
69114
version "17.0.39"
@@ -80,6 +125,19 @@ futurejs@2.2.0:
80125
resolved "https://registry.yarnpkg.com/futurejs/-/futurejs-2.2.0.tgz#d267fd8cabef653899aa1413e27e3563b2441012"
81126
integrity sha512-JgWDGfaDquVmSNvWAKulJXb/cMvxTAcPw2kW9UI2GsVw8iXuvaGh6hZHp08BkzPh2xFMYgvcwF4lK7qpbDP2HQ==
82127

128+
joi@^18.0.2:
129+
version "18.1.2"
130+
resolved "https://registry.yarnpkg.com/joi/-/joi-18.1.2.tgz#4735a384d7721fcda7a551d128862cf816541924"
131+
integrity sha512-rF5MAmps5esSlhCA+N1b6IYHDw9j/btzGaqfgie522jS02Ju/HXBxamlXVlKEHAxoMKQL77HWI8jlqWsFuekZA==
132+
dependencies:
133+
"@hapi/address" "^5.1.1"
134+
"@hapi/formula" "^3.0.2"
135+
"@hapi/hoek" "^11.0.7"
136+
"@hapi/pinpoint" "^2.0.1"
137+
"@hapi/tlds" "^1.1.1"
138+
"@hapi/topo" "^6.0.2"
139+
"@standard-schema/spec" "^1.1.0"
140+
83141
long@^5.0.0:
84142
version "5.2.3"
85143
resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1"
@@ -97,21 +155,21 @@ node-fetch@2.6.12:
97155
dependencies:
98156
whatwg-url "^5.0.0"
99157

100-
protobufjs@^7.2.4:
101-
version "7.5.5"
102-
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.5.5.tgz#b7089ca4410374c75150baf277353ef76db69f96"
103-
integrity sha512-3wY1AxV+VBNW8Yypfd1yQY9pXnqTAN+KwQxL8iYm3/BjKYMNg4i0owhEe26PWDOMaIrzeeF98Lqd5NGz4omiIg==
158+
protobufjs@^7.2.5:
159+
version "7.5.6"
160+
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.5.6.tgz#11af832ebc4b4326f658a5b1308e6141eb57edfd"
161+
integrity sha512-M71sTMB146U3u0di3yup8iM+zv8yPRNQVr1KK4tyBitl3qFvEGucq/rGDRShD2rsJhtN02RJaJ7j5X5hmy8SJg==
104162
dependencies:
105163
"@protobufjs/aspromise" "^1.1.2"
106164
"@protobufjs/base64" "^1.1.2"
107-
"@protobufjs/codegen" "^2.0.4"
165+
"@protobufjs/codegen" "^2.0.5"
108166
"@protobufjs/eventemitter" "^1.1.0"
109167
"@protobufjs/fetch" "^1.1.0"
110168
"@protobufjs/float" "^1.0.2"
111-
"@protobufjs/inquire" "^1.1.0"
169+
"@protobufjs/inquire" "^1.1.1"
112170
"@protobufjs/path" "^1.1.2"
113171
"@protobufjs/pool" "^1.1.0"
114-
"@protobufjs/utf8" "^1.1.0"
172+
"@protobufjs/utf8" "^1.1.1"
115173
"@types/node" ">=13.7.0"
116174
long "^5.0.0"
117175

examples/large-documents/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"typescript": "^4.0.2"
88
},
99
"dependencies": {
10-
"@ironcorelabs/tenant-security-nodejs": "^2.0.2",
10+
"@ironcorelabs/tenant-security-nodejs": "^4.1.2",
1111
"@types/node": "^14.6.0"
1212
},
1313
"scripts": {

examples/large-documents/src/index.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ performance.mark("encryptAllSubdocsS");
6363
const writeP = client.encryptDocument(docToEncrypt, metadata).then((encryptResult) => {
6464
performance.mark("encryptAllSubdocsE");
6565
// write the encrypted subdocs and the encrypted key to the filesystem
66-
fs.rmdirSync(subfolder, {recursive: true});
66+
try {
67+
fs.rmSync(subfolder, {recursive: true});
68+
// eslint-disable-next-line no-empty
69+
} catch (_) {}
6770
fs.mkdirSync(subfolder);
6871
Object.entries(encryptResult.encryptedDocument).forEach(([subDocId, encDocBuffer]) => fs.writeFileSync(`${subfolder}/${subDocId}.enc`, encDocBuffer));
6972
fs.writeFileSync(`${subfolder}/${filename}.edek`, encryptResult.edek);
@@ -181,7 +184,10 @@ finishAllP
181184

182185
// Helper to map over an object, types are whack here, don't use in prod
183186
const objectMap = <T1, T2>(obj: Record<string, T1>, f: (v: T1) => T2): Record<string, T2> =>
184-
Object.keys(obj).reduce((result, key) => {
185-
result[key] = f(obj[key]);
186-
return result;
187-
}, {} as Record<string, T2>);
187+
Object.keys(obj).reduce(
188+
(result, key) => {
189+
result[key] = f(obj[key]);
190+
return result;
191+
},
192+
{} as Record<string, T2>
193+
);

0 commit comments

Comments
 (0)