Skip to content

Commit

Permalink
Merge pull request #1045 from Chia-Network/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
TheLastCicada authored Apr 5, 2024
2 parents 51e3a16 + d2d8f06 commit ca5483a
Show file tree
Hide file tree
Showing 8 changed files with 613 additions and 550 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,12 @@ jobs:
productsign --sign "Developer ID Installer: Chia Network Inc." ${{ github.workspace }}/build-scripts/macos/target/pkg/CADT-macos-installer-x64.pkg ${{ github.workspace }}/build-scripts/macos/target/pkg-signed/CADT-macos-installer-x64.pkg
echo "Notarizing the .pkg"
npm install -g notarize-cli
notarize-cli \
--file=${{ github.workspace }}/build-scripts/macos/target/pkg-signed/CADT-macos-installer-x64.pkg \
--bundle-id net.chia.cadt \
--username "${{ secrets.APPLE_NOTARIZE_USERNAME }}" \
--password "${{ secrets.APPLE_NOTARIZE_PASSWORD }}"
xcrun notarytool submit \
--wait \
--apple-id "${{ secrets.APPLE_NOTARIZE_USERNAME }}" \
--password "${{ secrets.APPLE_NOTARIZE_PASSWORD }}" \
--team-id "${{ secrets.APPLE_TEAM_ID }}" \
"${{ github.workspace }}/build-scripts/macos/target/pkg-signed/CADT-macos-installer-x64.pkg"
- name: Upload Mac Installer
if: matrix.runs-on == 'macos-latest'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ In the `CHIA_ROOT` directory (usually `~/.chia/mainnet` on Linux), CADT will add
* **GOVERNANCE_SYNC_TASK_INTERVAL**: Syncs new organizations from the governance node. Default 86400.
* **ORGANIZATION_META_SYNC_TASK_INTERVAL**: Syncs organization data from the blockchain. Default 300.
* **PICKLIST_SYNC_TASK_INTERVAL**: Syncs picklist from the governance node. Default 30.
* **MIRROR_CHECK_TASK_INTERVAL**: Checks if our DataLayer is advertising our `DATALAYER_FILE_SERVER_URL` as a mirror for all subscriptions when `AUTO_MIRROR_EXTERNAL_STORES` is true. Default 300.
* **MIRROR_CHECK_TASK_INTERVAL**: Checks if our DataLayer is advertising our `DATALAYER_FILE_SERVER_URL` as a mirror for all subscriptions when `AUTO_MIRROR_EXTERNAL_STORES` is true. Default 86460.
* **GOVERNANCE**: Section on settings for the Governance body to connect to.
* **GOVERNANCE_BODY_ID**: This determines the governance body your CADT network will be connected to. While there could be multiple governance body IDs, the default of `23f6498e015ebcd7190c97df30c032de8deb5c8934fc1caa928bc310e2b8a57e` is the right ID for most people on mainnet.

Expand Down
1,060 changes: 546 additions & 514 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cadt",
"version": "1.7.12",
"version": "1.7.13",
"_comment": "DONT CHANGE MAJOR UNLESS DATAMODEL CHANGES: The major version corresponds to the datamodel version your using, so 2.0.0 means it'll use datamodel v2",
"private": true,
"bin": "build/server.js",
Expand Down Expand Up @@ -45,7 +45,7 @@
"lodash": "^4.17.21",
"log-update": "^4.0.0",
"multer": "^1.4.5-lts.1",
"mysql2": "^2.3.3",
"mysql2": "^3.9.3",
"node-xlsx": "^0.23.0",
"regenerator-runtime": "^0.13.11",
"rxjs": "^7.8.1",
Expand All @@ -64,19 +64,19 @@
"@babel/plugin-syntax-import-attributes": "^7.23.3",
"@babel/preset-env": "^7.24.0",
"@babel/register": "^7.23.7",
"@commitlint/cli": "^19.0.3",
"@commitlint/cli": "^19.2.1",
"@commitlint/config-conventional": "^19.0.3",
"babel-plugin-module-resolver": "^5.0.0",
"chai": "^5.1.0",
"chai-http": "^4.4.0",
"eslint": "^8.57.0",
"eslint-plugin-es": "^4.1.0",
"eslint-plugin-mocha": "^10.3.0",
"eslint-plugin-mocha": "^10.4.1",
"husky": "^9.0.11",
"mocha": "^10.3.0",
"semver": "^7.6.0",
"sinon": "^17.0.1",
"socket.io-client": "^4.7.4",
"socket.io-client": "^4.7.5",
"standard-version": "^9.5.0",
"supertest": "^6.3.4"
},
Expand Down
26 changes: 26 additions & 0 deletions src/controllers/units.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export const findAll = async (req, res) => {
hasMarketplaceIdentifier,
includeProjectInfoInSearch = false,
filter,
onlyTokenizedUnits,
} = req.query;

let where = orgUid != null && orgUid !== 'all' ? { orgUid } : undefined;
Expand Down Expand Up @@ -226,6 +227,31 @@ export const findAll = async (req, res) => {
where.marketplaceIdentifier = {
[Sequelize.Op.eq]: null,
};
} else if (
typeof onlyTokenizedUnits === 'boolean' &&
onlyTokenizedUnits === true
) {
if (!where) {
where = {};
}

where.marketplaceIdentifier = {
[Sequelize.Op.not]: true,
};
where.marketplace = {
[Sequelize.Op.eq]: 'Tokenized on Chia',
};
} else if (
typeof onlyTokenizedUnits === 'boolean' &&
onlyTokenizedUnits === false
) {
if (!where) {
where = {};
}

where.marketplace = {
[Sequelize.Op.not]: 'Tokenized on Chia',
};
}

// default to DESC
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/mirror-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const runMirrorCheck = async () => {
await Organization.addMirror(orgData.orgUid, mirrorUrl, true);
await Organization.addMirror(orgData.registryId, mirrorUrl, true);
} else {
logger.error(
logger.info(
'DATALAYER_FILE_SERVER_URL not set, skipping mirror announcement',
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/utils/defaultConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export const defaultConfig = {
TASKS: {
GOVERNANCE_SYNC_TASK_INTERVAL: 86400,
ORGANIZATION_META_SYNC_TASK_INTERVAL: 300,
PICKLIST_SYNC_TASK_INTERVAL: 30,
MIRROR_CHECK_TASK_INTERVAL: 300,
PICKLIST_SYNC_TASK_INTERVAL: 60,
MIRROR_CHECK_TASK_INTERVAL: 86460,
},
},
GOVERNANCE: {
Expand Down
47 changes: 26 additions & 21 deletions src/validations/units.validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,31 +54,36 @@ export const unitsPostSchema = Joi.object({
});

export const unitsGetQuerySchema = Joi.object({
page: Joi.number().min(1).optional(),
limit: Joi.number().max(100).min(1).optional(),
search: Joi.string().optional(),
warehouseUnitId: Joi.string().optional(),
columns: Joi.array().items(Joi.string()).single().optional(),
orgUid: Joi.string().optional(),
page: Joi.number().min(1).required(),
limit: Joi.number().max(100).min(1).required(),
search: Joi.string(),
warehouseUnitId: Joi.string(),
columns: Joi.array().items(Joi.string()).single(),
orgUid: Joi.string(),
order: Joi.alternatives().try(
Joi.string().valid('SERIALNUMBER', 'ASC', 'DESC').optional(),
Joi.string().regex(genericSortColumnRegex).min(1).max(100).optional(),
),
xls: Joi.boolean().optional(),
marketplaceIdentifiers: Joi.array().items(Joi.string()).single().optional(),
hasMarketplaceIdentifier: Joi.boolean().optional(),
includeProjectInfoInSearch: Joi.boolean().optional(),
filter: Joi.string().regex(genericFilterRegex).min(1).max(100).optional(),
}).when(Joi.object({ warehouseUnitId: Joi.string().required() }).unknown(), {
then: Joi.object({
page: Joi.number().optional(),
limit: Joi.number().optional(),
}),
otherwise: Joi.object({
page: Joi.number().min(1).required(),
limit: Joi.number().max(100).min(1).required(),
}),
});
xls: Joi.boolean(),
marketplaceIdentifiers: Joi.array().items(Joi.string()).single(),
hasMarketplaceIdentifier: Joi.boolean(),
onlyTokenizedUnits: Joi.boolean(),
includeProjectInfoInSearch: Joi.boolean(),
filter: Joi.string().regex(genericFilterRegex).min(1).max(100),
})
.when(Joi.object({ warehouseUnitId: Joi.exist() }).unknown(), {
then: Joi.object({
page: Joi.number().min(1).optional(),
limit: Joi.number().max(100).min(1).optional(),
}),
})
.when(Joi.object({ onlyTokenizedUnits: Joi.exist() }).unknown(), {
then: Joi.object({
page: Joi.number().min(1).optional(),
limit: Joi.number().max(100).min(1).optional(),
}),
})
.and('page', 'limit');

export const unitsUpdateSchema = Joi.object({
warehouseUnitId: Joi.string().required(),
Expand Down

0 comments on commit ca5483a

Please sign in to comment.