1 | const { SquidexClientManager } = require('squidex-client-manager');
|
2 | require('dotenv').config();
|
3 |
|
4 | const main = async () => {
|
5 | const clientSecret = process.env.SQUIDEX_CLIENT_SECRET;
|
6 | const clientId = process.env.SQUIDEX_CLIENT_ID;
|
7 | const url = process.env.SQUIDEX_CONNECT_URL;
|
8 | const appName = process.env.APP_NAME;
|
9 |
|
10 | const client = new SquidexClientManager(url, appName, clientId, clientSecret);
|
11 | const createOrUpdate = await client.CreateOrUpdateAsync('Articles', {
|
12 | id: '4bb3a7bb-962d-4183-9ca6-35d170c34f3b',
|
13 | data: {
|
14 | title: { iv: 'title here is used as unique value for comparison' },
|
15 | text: { iv: 'y' },
|
16 | },
|
17 | }, 'title');
|
18 | console.log(JSON.stringify(createOrUpdate, null, 2));
|
19 | };
|
20 |
|
21 | main();
|