@dbos-inc/dbos-sdk 1.3.9-preview → 1.3.11-preview

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,5 +7,10 @@ export interface DBOSCLIStartOptions {
7
7
  configfile?: string;
8
8
  entrypoint?: string;
9
9
  }
10
+ export interface DBOSConfigureOptions {
11
+ host?: string;
12
+ port?: number;
13
+ username?: string;
14
+ }
10
15
  export declare function runAndLog(action: (configFile: ConfigFile, logger: GlobalLogger) => Promise<number>): Promise<void>;
11
16
  //# sourceMappingURL=cli.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../src/dbos-runtime/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAuD,MAAM,UAAU,CAAC;AAK3F,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAUjD,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAoED,wBAAsB,SAAS,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,KAAK,OAAO,CAAC,MAAM,CAAC,iBA2BxG"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../src/dbos-runtime/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAuD,MAAM,UAAU,CAAC;AAK3F,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAWjD,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAgFD,wBAAsB,SAAS,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,KAAK,OAAO,CAAC,MAAM,CAAC,iBA2BxG"}
@@ -10,6 +10,7 @@ const migrate_1 = require("./migrate");
10
10
  const logs_1 = require("../telemetry/logs");
11
11
  const collector_1 = require("../telemetry/collector");
12
12
  const exporters_1 = require("../telemetry/exporters");
13
+ const configure_1 = require("./configure");
13
14
  const program = new commander_1.Command();
14
15
  // eslint-disable-next-line @typescript-eslint/no-var-requires
15
16
  const packageJson = require('../../../package.json');
@@ -45,6 +46,15 @@ program
45
46
  .action((_options) => {
46
47
  console.log("NOTE: This command has been removed in favor of `npx @dbos-inc/create` or `npm create @dbos-inc`");
47
48
  });
49
+ program
50
+ .command('configure')
51
+ .alias('config')
52
+ .option('-h, --host <string>', 'Specify your Postgres server hostname')
53
+ .option('-p, --port <number>', 'Specify your Postgres server port')
54
+ .option('-U, --username <number>', 'Specify your Postgres username')
55
+ .action(async (options) => {
56
+ await (0, configure_1.configure)(options.host, options.port, options.username);
57
+ });
48
58
  program
49
59
  .command('migrate')
50
60
  .description("Perform a database migration")
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/dbos-runtime/cli.ts"],"names":[],"mappings":";;;;AACA,uCAA2D;AAC3D,qCAA2F;AAC3F,yCAAoC;AAEpC,mCAAwC;AACxC,uCAAuD;AACvD,4CAAiD;AACjD,sDAA4D;AAC5D,sDAA2D;AAE3D,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAqB9B,8DAA8D;AAC9D,MAAM,WAAW,GAAG,OAAO,CAAC,uBAAuB,CAAwB,CAAC;AAC5E,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;AAErC,OAAO;KACJ,OAAO,CAA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,uBAAc,EAAC,2BAAkB,CAAC,CAAC;IAC9E,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,CAAC,KAAK,CAAC,mBAAmB,2BAAkB,EAAE,CAAC,CAAC;QACtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,IAAI,SAAS,GAAG,SAAS,CAAC;IAC1B,IAAI,UAAU,CAAC,SAAS,EAAE,YAAY,EAAE,CAAC;QACvC,MAAM,GAAG,IAAI,mBAAY,CAAC,IAAI,8BAAkB,CAAC,IAAI,6BAAiB,CAAC,UAAU,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QACxI,SAAS,GAAG,CAAC,IAAY,EAAE,EAAE;YAC3B,KAAK,MAAM,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE;gBACjC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACrB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,SAAS,GAAG,CAAC,IAAY,EAAE,EAAE;YAC3B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC,CAAC;IACJ,CAAC;IACD,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,IAAI,CAAC;QACH,UAAU,GAAG,MAAM,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,SAAS,CAAC,UAAU,CAAC,CAAC;AACxB,CAAC;AA3BD,8BA2BC"}
@@ -24,7 +24,9 @@ export interface ConfigFile {
24
24
  runtimeConfig?: DBOSRuntimeConfig;
25
25
  dbClientMetadata?: any;
26
26
  }
27
- export declare function loadConfigFile(configFilePath: string): ConfigFile | undefined;
27
+ export declare function substituteEnvVars(content: string): string;
28
+ export declare function loadConfigFile(configFilePath: string): ConfigFile;
29
+ export declare function writeConfigFile(configFile: ConfigFile, configFilePath: string): void;
28
30
  export declare function constructPoolConfig(configFile: ConfigFile, debugMode?: boolean): PoolConfig;
29
31
  export declare function parseConfigFile(cliOptions?: DBOSCLIStartOptions, debugMode?: boolean): [DBOSConfig, DBOSRuntimeConfig];
30
32
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/dbos-runtime/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAEhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,eAAO,MAAM,kBAAkB,qBAAqB,CAAC;AAErD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE;QACR,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,uBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,WAAW,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,aAAa,CAAC,EAAE,gBAAgB,CAAC;QACjC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;KACrB,CAAC;IACF,SAAS,CAAC,EAAE,eAAe,CAAC;IAE5B,WAAW,EAAE,GAAG,CAAC;IACjB,aAAa,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C,EAAE,eAAe,CAAC;IAE5B,WAAW,EAAE,GAAG,CAAC;IACjB,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAElC,gBAAgB,CAAC,EAAE,GAAG,CAAC;CACxB;AAOD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAKzD;AAED,wBAAgB,cAAc,CAAC,cAAc,EAAE,MAAM,GAAG,UAAU,CAajE;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,QAW7E;AAED,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,UAAU,EAAE,SAAS,GAAE,OAAe,cA2CrF;AAMD,wBAAgB,eAAe,CAAC,UAAU,CAAC,EAAE,mBAAmB,EAAE,SAAS,GAAE,OAAe,GAAG,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAuD7H"}
@@ -3,12 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.parseConfigFile = exports.constructPoolConfig = exports.loadConfigFile = exports.dbosConfigFilePath = void 0;
6
+ exports.parseConfigFile = exports.constructPoolConfig = exports.writeConfigFile = exports.loadConfigFile = exports.substituteEnvVars = exports.dbosConfigFilePath = void 0;
7
7
  const error_1 = require("../error");
8
8
  const utils_1 = require("../utils");
9
9
  const yaml_1 = __importDefault(require("yaml"));
10
10
  const user_database_1 = require("../user_database");
11
11
  const applicationVersion_1 = require("./applicationVersion");
12
+ const fs_1 = require("fs");
12
13
  exports.dbosConfigFilePath = "dbos-config.yaml";
13
14
  /*
14
15
  * Substitute environment variables using a regex for matching.
@@ -21,21 +22,39 @@ function substituteEnvVars(content) {
21
22
  return process.env[g1] || ""; // If the env variable is not set, return an empty string.
22
23
  });
23
24
  }
25
+ exports.substituteEnvVars = substituteEnvVars;
24
26
  function loadConfigFile(configFilePath) {
25
- let configFile;
26
27
  try {
27
28
  const configFileContent = (0, utils_1.readFileSync)(configFilePath);
28
29
  const interpolatedConfig = substituteEnvVars(configFileContent);
29
- configFile = yaml_1.default.parse(interpolatedConfig);
30
+ const configFile = yaml_1.default.parse(interpolatedConfig);
31
+ return configFile;
30
32
  }
31
33
  catch (e) {
32
34
  if (e instanceof Error) {
33
35
  throw new error_1.DBOSInitializationError(`Failed to load config from ${configFilePath}: ${e.message}`);
34
36
  }
37
+ else {
38
+ throw e;
39
+ }
35
40
  }
36
- return configFile;
37
41
  }
38
42
  exports.loadConfigFile = loadConfigFile;
43
+ function writeConfigFile(configFile, configFilePath) {
44
+ try {
45
+ const configFileContent = yaml_1.default.stringify(configFile);
46
+ (0, fs_1.writeFileSync)(configFilePath, configFileContent);
47
+ }
48
+ catch (e) {
49
+ if (e instanceof Error) {
50
+ throw new error_1.DBOSInitializationError(`Failed to write config to ${configFilePath}: ${e.message}`);
51
+ }
52
+ else {
53
+ throw e;
54
+ }
55
+ }
56
+ }
57
+ exports.writeConfigFile = writeConfigFile;
39
58
  function constructPoolConfig(configFile, debugMode = false) {
40
59
  if (!configFile.database) {
41
60
  throw new error_1.DBOSInitializationError(`DBOS configuration (dbos-config.yaml) does not contain database config`);
@@ -56,7 +75,13 @@ function constructPoolConfig(configFile, debugMode = false) {
56
75
  poolConfig.password = "DEBUG-MODE"; // Assign a password if not set. We don't need password to authenticate with the local proxy.
57
76
  }
58
77
  else {
59
- throw new error_1.DBOSInitializationError(`DBOS configuration (dbos-config.yaml) does not contain database password`);
78
+ const pgPassword = process.env.PGPASSWORD;
79
+ if (pgPassword) {
80
+ poolConfig.password = pgPassword;
81
+ }
82
+ else {
83
+ throw new error_1.DBOSInitializationError(`DBOS configuration (dbos-config.yaml) does not contain database password`);
84
+ }
60
85
  }
61
86
  }
62
87
  // Details on Postgres SSL/TLS modes: https://www.postgresql.org/docs/current/libpq-ssl.html#LIBPQ-SSL-PROTECTION
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceR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,EAAE,GAAG,UAAU,CAAC,QAAQ,WAAW;QAClD,mEAAmE;QACnE,WAAW,EAAE,UAAU,CAAC,WAAW,IAAI,SAAS;QAChD,gBAAgB,EAAE;YAChB,+GAA+G;YAC/G,QAAQ,EAAE,UAAU,CAAC,gBAAgB,EAAE,QAAQ;SAChD;KACF,CAAC;IAEF,uCAAuC;IACvC,uCAAuC;IACvC,uCAAuC;IACvC,MAAM,aAAa,GAAsB;QACvC,UAAU,EAAE,UAAU,EAAE,UAAU,IAAI,UAAU,CAAC,aAAa,EAAE,UAAU,IAAI,oBAAoB;QAClG,IAAI,EAAE,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,IAAI,IAAI;KACjF,CAAC;IAEF,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;AACrC,CAAC;AAvDD,0CAuDC"}
@@ -0,0 +1,2 @@
1
+ export declare function configure(host: string | undefined, port: number | undefined, username: string | undefined): Promise<void>;
2
+ //# sourceMappingURL=configure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../../src/dbos-runtime/configure.ts"],"names":[],"mappings":"AAKA,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,iBAgD/G"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.configure = void 0;
7
+ const inquirer_1 = __importDefault(require("inquirer"));
8
+ const utils_1 = require("../utils");
9
+ const config_1 = require("./config");
10
+ const yaml_1 = __importDefault(require("yaml"));
11
+ async function configure(host, port, username) {
12
+ const configFileContent = (0, utils_1.readFileSync)(config_1.dbosConfigFilePath);
13
+ const config = yaml_1.default.parse(configFileContent);
14
+ if (!host) {
15
+ const output = await inquirer_1.default.prompt([
16
+ {
17
+ type: 'input',
18
+ name: 'host',
19
+ message: 'What is the hostname of your Postgres server?',
20
+ // Providing a default value
21
+ default: 'localhost',
22
+ },
23
+ ]);
24
+ host = output.host;
25
+ }
26
+ if (!port) {
27
+ const output = await inquirer_1.default.prompt([
28
+ {
29
+ type: 'input',
30
+ name: 'port',
31
+ message: 'What is the port of your Postgres server?',
32
+ // Providing a default value
33
+ default: 5432,
34
+ },
35
+ ]);
36
+ port = output.port;
37
+ }
38
+ if (!username) {
39
+ const output = await inquirer_1.default.prompt([
40
+ {
41
+ type: 'input',
42
+ name: 'username',
43
+ message: 'What is your Postgres username?',
44
+ // Providing a default value
45
+ default: 'postgres',
46
+ },
47
+ ]);
48
+ username = output.username;
49
+ }
50
+ config.database.hostname = host;
51
+ config.database.port = port;
52
+ config.database.username = username;
53
+ (0, config_1.writeConfigFile)(config, config_1.dbosConfigFilePath);
54
+ }
55
+ exports.configure = configure;
56
+ //# sourceMappingURL=configure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configure.js","sourceRoot":"","sources":["../../../src/dbos-runtime/configure.ts"],"names":[],"mappings":";;;;;;AAAA,wDAAgC;AAChC,oCAAwC;AACxC,qCAA2E;AAC3E,gDAAwB;AAEjB,KAAK,UAAU,SAAS,CAAC,IAAwB,EAAE,IAAwB,EAAE,QAA4B;IAC9G,MAAM,iBAAiB,GAAG,IAAA,oBAAY,EAAC,2BAAkB,CAAW,CAAC;IACrE,MAAM,MAAM,GAAG,cAAI,CAAC,KAAK,CAAC,iBAAiB,CAAe,CAAC;IAE3D,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,MAAM,GAAG,MAAM,kBAAQ,CAAC,MAAM,CAAC;YACnC;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE,+CAA+C;gBACxD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EzE;AAED,wBAAsB,mBAAmB,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,oBAcrF;AAGD,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,kBAoBnF"}
1
+ {"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../../src/dbos-runtime/migrate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAuB,MAAM,UAAU,CAAC;AAK3D,wBAAsB,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,kBA6EzE;AAED,wBAAsB,mBAAmB,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,oBAarF;AAGD,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,kBAoBnF"}
@@ -18,13 +18,20 @@ async function migrate(configFile, logger) {
18
18
  const postgresConfig = (0, config_1.constructPoolConfig)(configFile);
19
19
  postgresConfig.database = "postgres";
20
20
  const postgresClient = new pg_1.Client(postgresConfig);
21
+ let connection_failed = true;
21
22
  try {
22
23
  await postgresClient.connect();
24
+ connection_failed = false;
23
25
  await postgresClient.query(`CREATE DATABASE ${configFile.database.app_db_name}`);
24
26
  }
25
27
  catch (e) {
26
28
  if (e instanceof Error) {
27
- logger.error(`Error creating database ${configFile.database.app_db_name}: ${e.message}`);
29
+ if (connection_failed) {
30
+ logger.error(`Error connecting to database ${postgresConfig.host}:${postgresConfig.port} with user ${postgresConfig.user}: ${e.message}`);
31
+ }
32
+ else {
33
+ logger.error(`Error creating database ${configFile.database.app_db_name}: ${e.message}`);
34
+ }
28
35
  }
29
36
  else {
30
37
  logger.error(e);
@@ -87,6 +94,7 @@ async function checkDatabaseExists(configFile, logger) {
87
94
  const pgUserClient = new pg_1.Client(pgUserConfig);
88
95
  try {
89
96
  await pgUserClient.connect(); // Try to establish a connection
97
+ await pgUserClient.end();
90
98
  logger.info(`Database ${configFile.database.app_db_name} exists!`);
91
99
  return true; // If successful, return true
92
100
  }
@@ -94,9 +102,6 @@ async function checkDatabaseExists(configFile, logger) {
94
102
  logger.info(`Database ${configFile.database.app_db_name} does not exist, creating...`);
95
103
  return false; // If connection fails, return false
96
104
  }
97
- finally {
98
- await pgUserClient.end(); // Close pool regardless of the outcome
99
- }
100
105
  }
101
106
  exports.checkDatabaseExists = checkDatabaseExists;
102
107
  // eslint-disable-next-line @typescript-eslint/require-await
@@ -1 +1 @@
1
- {"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../../src/dbos-runtime/migrate.ts"],"names":[],"mappings":";;;AAAA,iDAAyC;AACzC,4CAAiD;AACjD,qCAA2D;AAC3D,2BAAwC;AACxC,iEAA6F;AAC7F,wDAA2E;AAEpE,KAAK,UAAU,OAAO,CAAC,UAAsB,EAAE,MAAoB;IACxE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;QAClC,MAAM,CAAC,KAAK,CAAC,iGAAiG,CAAC,CAAC;QAChH,OAAO,CAAC,CAAC;IACX,CAAC;IACD,MAAM,UAAU,GAAG,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC;IACnD,MAAM,CAAC,IAAI,CAAC,yCAAyC,UAAU,uBAAuB,CAAC,CAAC;IAExF,IAAI,CAAC,CAAC,MAAM,mBAAmB,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;QACrD,MAAM,cAAc,GAAe,IAAA,4BAAmB,EAAC,UAAU,CAAC,CAAA;QAClE,cAAc,CAAC,QAAQ,GAAG,UAAU,CAAA;QACpC,MAAM,cAAc,GAAG,IAAI,WAAM,CAAC,cAAc,CAAC,CAAC;QAClD,IAAI,CAAC;YACH,MAAM,cAAc,CAAC,OAAO,EAAE,CAAA;YAC9B,MAAM,cAAc,CAAC,KAAK,CAAC,mBAAmB,UAAU,CAAC,QAAQ,CAAC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