Skip to content

Commit 0c3c3a4

Browse files
authored
add users created time (#555)
1 parent 492f53e commit 0c3c3a4

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ typings/
7070
.env
7171
.env.test
7272

73+
# test folder
74+
.test/
75+
7376
# parcel-bundler cache (https://parceljs.org/)
7477
.cache
7578

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,6 @@ const runWithInputRes = await descopeClient.management.flow.run('management-flow
11161116
},
11171117
});
11181118
console.log('flow with input result', runWithInputRes.data); // The result data will contain the flow's output, which is configured in the 'End' step of the flow
1119-
```
11201119

11211120
// Export the current theme of the project
11221121
const res = descopeClient.management.theme.export();
@@ -1125,8 +1124,7 @@ console.log(res.data.theme);
11251124
// Import the given theme to the project
11261125
const updatedRes = descopeClient.management.theme.import(theme);
11271126
console.log(updatedRes.data.theme);
1128-
1129-
````
1127+
```
11301128

11311129
### Manage JWTs
11321130

@@ -1137,7 +1135,7 @@ const updatedJWTRes = await descopeClient.management.jwt.update('original-jwt',
11371135
customKey1: 'custom-value1',
11381136
customKey2: 'custom-value2',
11391137
});
1140-
````
1138+
```
11411139

11421140
Generate a JWT for a user, simulating a sign in request.
11431141

examples/managementCli/src/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,20 @@ program
262262
);
263263
});
264264

265+
// batch-user-create
266+
program
267+
.command('batch-user-create')
268+
.description('Create multiple users from a JSON file')
269+
.argument('<file>', 'Path to the JSON file containing user data')
270+
.action(async (file) => {
271+
try {
272+
const users = JSON.parse(readFileSync(file, 'utf-8'));
273+
handleSdkRes(await sdk.management.user.createBatch(users));
274+
} catch (error) {
275+
console.error('Error reading or parsing file:', error);
276+
}
277+
});
278+
265279
// *** Project commands ***
266280

267281
// project-update-name

lib/management/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ export type User = {
374374
hashedPassword?: UserPasswordHashed; // a prehashed password to set for the user
375375
seed?: string; // a TOTP seed to set for the user in case of batch invite
376376
status?: UserStatus; // the status of the user (enabled, disabled, invited)
377+
createdTime?: number; // the time the user was created in seconds since epoch
377378
};
378379

379380
// The kind of prehashed password to set for a user (only one should be set)

0 commit comments

Comments
 (0)