Compare commits

...

19 commits

Author SHA1 Message Date
RenovateBot edf6c99bad Update dependency minimatch to v9.0.5 (#283)
All checks were successful
Deploy To Stage / build (push) Successful in 9s
Deploy To Stage / deploy (push) Successful in 15s
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [minimatch](https://github.com/isaacs/minimatch) | dependencies | patch | [`9.0.4` -> `9.0.5`](https://renovatebot.com/diffs/npm/minimatch/9.0.4/9.0.5) |

---

### Release Notes

<details>
<summary>isaacs/minimatch (minimatch)</summary>

### [`v9.0.5`](https://github.com/isaacs/minimatch/compare/v9.0.4...v9.0.5)

[Compare Source](https://github.com/isaacs/minimatch/compare/v9.0.4...v9.0.5)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjAiLCJ0YXJnZXRCcmFuY2giOiJkZXZlbG9wIn0=-->

Reviewed-on: #283
Co-authored-by: Renovate Bot <renovate@vylpes.com>
Co-committed-by: Renovate Bot <renovate@vylpes.com>
2024-07-01 15:11:42 +01:00
RenovateBot f888f9dd37 Update dependency ts-jest to v29.1.5 (#275)
All checks were successful
Deploy To Stage / build (push) Successful in 12s
Deploy To Stage / deploy (push) Successful in 15s
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [ts-jest](https://kulshekhar.github.io/ts-jest) ([source](https://github.com/kulshekhar/ts-jest)) | dependencies | patch | [`29.1.4` -> `29.1.5`](https://renovatebot.com/diffs/npm/ts-jest/29.1.4/29.1.5) |

---

### Release Notes

<details>
<summary>kulshekhar/ts-jest (ts-jest)</summary>

### [`v29.1.5`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#2915-2024-06-16)

[Compare Source](https://github.com/kulshekhar/ts-jest/compare/v29.1.4...v29.1.5)

##### Bug Fixes

-   build(deps-dev): bump braces ([5560334](https://github.com/kulshekhar/ts-jest/commit/5560334)), ([59026b4](https://github.com/kulshekhar/ts-jest/commit/59026b4)), ([0d9e359](https://github.com/kulshekhar/ts-jest/commit/0d9e359))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjAiLCJ0YXJnZXRCcmFuY2giOiJkZXZlbG9wIn0=-->

Reviewed-on: #275
Co-authored-by: Renovate Bot <renovate@vylpes.com>
Co-committed-by: Renovate Bot <renovate@vylpes.com>
2024-07-01 15:09:27 +01:00
Ethan Lane 2945638b16 Update inventory to have 9 cards per page
All checks were successful
Deploy To Stage / build (push) Successful in 10s
Deploy To Stage / deploy (push) Successful in 16s
2024-06-30 15:22:41 +01:00
Ethan Lane 5751694018 Add rotating log files (#280)
All checks were successful
Deploy To Stage / build (push) Successful in 9s
Deploy To Stage / deploy (push) Successful in 16s
- Adding rotating log files to the app.
- This uses the `winston-daily-rotate-file` package to rotate the log files before they get too big.
- The log files will also now be saved into the `$DATA_DIR/logs` folder

#247

Reviewed-on: #280
Reviewed-by: VylpesTester <tester@vylpes.com>
Co-authored-by: Ethan Lane <ethan@vylpes.com>
Co-committed-by: Ethan Lane <ethan@vylpes.com>
2024-06-29 18:28:28 +01:00
Ethan Lane 1a4993b091 Update inventory to 12 per page
All checks were successful
Deploy To Stage / build (push) Successful in 9s
Deploy To Stage / deploy (push) Successful in 16s
2024-06-28 18:55:27 +01:00
Ethan Lane 5d44c46222 Defer reply on inventory
All checks were successful
Deploy To Stage / build (push) Successful in 9s
Deploy To Stage / deploy (push) Successful in 15s
2024-06-28 18:53:15 +01:00
Ethan Lane a0a864ef44 Update inventory helper to generate image height dynamically based on card amount
All checks were successful
Deploy To Stage / build (push) Successful in 9s
Deploy To Stage / deploy (push) Successful in 16s
2024-06-28 18:47:41 +01:00
Ethan Lane 9ce4d49b6a Add image grid to inventory command (#277)
All checks were successful
Deploy To Stage / build (push) Successful in 10s
Deploy To Stage / deploy (push) Successful in 16s
# Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

#79

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

# How Has This Been Tested?

Please describe the tests that you ran to verify the changes. Provide instructions so we can reproduce. Please also list any relevant details to your test configuration.

# Checklist

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that provde my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules

Reviewed-on: #277
Co-authored-by: Ethan Lane <ethan@vylpes.com>
Co-committed-by: Ethan Lane <ethan@vylpes.com>
2024-06-28 18:37:58 +01:00
RenovateBot d7b56a72b9 Update dependency glob to v10.4.2 (#274)
All checks were successful
Deploy To Stage / build (push) Successful in 8s
Deploy To Stage / deploy (push) Successful in 16s
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [glob](https://github.com/isaacs/node-glob) | dependencies | patch | [`10.4.1` -> `10.4.2`](https://renovatebot.com/diffs/npm/glob/10.4.1/10.4.2) |

---

### Release Notes

<details>
<summary>isaacs/node-glob (glob)</summary>

### [`v10.4.2`](https://github.com/isaacs/node-glob/compare/v10.4.1...v10.4.2)

[Compare Source](https://github.com/isaacs/node-glob/compare/v10.4.1...v10.4.2)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjAiLCJ0YXJnZXRCcmFuY2giOiJkZXZlbG9wIn0=-->

Reviewed-on: #274
Reviewed-by: Vylpes <ethan@vylpes.com>
Co-authored-by: Renovate Bot <renovate@vylpes.com>
Co-committed-by: Renovate Bot <renovate@vylpes.com>
2024-06-25 17:48:35 +01:00
RenovateBot 1841b49da6 Update dependency @typescript-eslint/eslint-plugin to v7 (#267)
All checks were successful
Deploy To Stage / build (push) Successful in 8s
Deploy To Stage / deploy (push) Successful in 16s
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@typescript-eslint/eslint-plugin](https://typescript-eslint.io/packages/eslint-plugin) ([source](https://github.com/typescript-eslint/typescript-eslint)) | devDependencies | major | [`^6.16.0` -> `^7.0.0`](https://renovatebot.com/diffs/npm/@typescript-eslint%2feslint-plugin/6.21.0/7.13.1) |

---

### Release Notes

<details>
<summary>typescript-eslint/typescript-eslint (@&#8203;typescript-eslint/eslint-plugin)</summary>

### [`v7.13.1`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#7131-2024-06-17)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v7.13.0...v7.13.1)

##### 🩹 Fixes

-   **eslint-plugin:** \[prefer-readonly] refine report locations

-   **eslint-plugin:** \[return-await] support explicit resource management

-   **eslint-plugin:** \[no-unsafe-member-access] differentiate a types-error any from a true any

##### ❤️  Thank You

-   Kirk Waiblinger
-   Yukihiro Hasegawa

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v7.13.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#7130-2024-06-10)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v7.12.0...v7.13.0)

##### 🚀 Features

-   **typescript-estree:** require `import = require()` argument to be a string literal

-   **typescript-estree:** forbid `.body`, `.async`, `.generator` on `declare function`

-   **eslint-plugin:** \[no-dynamic-delete] allow all string literals as index

##### 🩹 Fixes

-   **ast-spec:** function-call-like callee should be Expression not LeftHandSideExpression

-   **scope-manager:** handle index signature in class

-   **eslint-plugin:** \[init-declarations] refine report locations

-   **eslint-plugin:** \[no-base-to-string] make error message more nuanced

-   **eslint-plugin:** \[no-unsafe-assignment] be more specific about error types

-   **eslint-plugin:** \[no-magic-numbers] fix implementation of the `ignore` option

##### ❤️  Thank You

-   Fotis Papadogeorgopoulos
-   Joshua Chen
-   Kirk Waiblinger
-   Tobiloba Adedeji
-   Vinccool96
-   YeonJuan

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v7.12.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#7120-2024-06-03)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v7.11.0...v7.12.0)

##### 🚀 Features

-   **eslint-plugin:** \[no-useless-template-literals] rename to `no-useless-template-expression` (deprecate `no-useless-template-literals`)

-   **rule-tester:** check for parsing errors in suggestion fixes

-   **rule-tester:** port `checkDuplicateTestCases` from ESLint

-   **eslint-plugin:** \[no-floating-promises] add option 'allowForKnownSafePromises'

##### 🩹 Fixes

-   no-useless-template-expression -> no-unnecessary-template-expression

-   **eslint-plugin:** \[no-unnecessary-type-assertion] combine template literal check with `const` variable check

-   **eslint-plugin:** \[dot-notation] fix false positive when accessing private/protected property with optional chaining

-   **eslint-plugin:** \[explicit-member-accessibility] refine report locations

-   **eslint-plugin:** \[no-unnecessary-type-assertion] declares are always defined, so always check `declare`s

-   **eslint-plugin:** \[prefer-literal-enum-member] allow using member it self on allowBitwiseExpressions

-   **eslint-plugin:** \[return-await] clean up in-try-catch detection and make autofixes safe

-   **eslint-plugin:** \[member-ordering] also TSMethodSignature can be get/set

##### ❤️  Thank You

-   Abraham Guo
-   Han Yeong-woo
-   Joshua Chen
-   Kim Sang Du
-   Kirk Waiblinger
-   YeonJuan

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v7.11.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#7110-2024-05-27)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v7.10.0...v7.11.0)

##### 🚀 Features

-   **eslint-plugin:** deprecate prefer-ts-expect-error in favor of ban-ts-comment

##### 🩹 Fixes

-   **eslint-plugin:** \[consistent-type-assertions] prevent syntax errors on arrow functions

##### ❤️  Thank You

-   Abraham Guo
-   auvred
-   Dom Armstrong
-   Kirk Waiblinger

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v7.10.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#7100-2024-05-20)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v7.9.0...v7.10.0)

##### 🚀 Features

-   **eslint-plugin:** \[sort-type-constituents] support case sensitive sorting

##### 🩹 Fixes

-   **eslint-plugin:** \[prefer-regexp-exec] fix heuristic to check whether regex may contain global flag

##### ❤️  Thank You

-   auvred
-   Emanuel Hoogeveen
-   jsfm01
-   Kirk Waiblinger

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v7.9.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#790-2024-05-13)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v7.8.0...v7.9.0)

##### 🩹 Fixes

-   **eslint-plugin:** \[explicit-function-return-types] fix false positive on default parameters

##### ❤️  Thank You

-   Kirk Waiblinger
-   Sheetal Nandi
-   Vinccool96

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v7.8.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#780-2024-04-29)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v7.7.1...v7.8.0)

##### 🩹 Fixes

-   **eslint-plugin:** \[no-unsafe-argument] handle  tagged templates

-   **eslint-plugin:** \[prefer-optional-chain] suggests optional chaining during strict null equality check

-   **eslint-plugin:** \[consistent-type-assertions] handle tagged templates

-   **eslint-plugin:** \[no-unsafe-return] handle union types

-   **eslint-plugin:** \[no-unused-vars] clear error report range

##### ❤️  Thank You

-   auvred
-   Josh Goldberg 
-   jsfm01
-   Kim Sang Du
-   YeonJuan

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v7.7.1`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#771-2024-04-22)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v7.7.0...v7.7.1)

##### 🩹 Fixes

-   **eslint-plugin:** \[no-unsafe-assignment] handle shorthand property assignment

-   **eslint-plugin:** \[explicit-function-return-type] fix checking wrong ancestor's return type

-   **eslint-plugin:** \[prefer-optional-chain] only look at left operand for `requireNullish`

-   **eslint-plugin:** \[no-for-in-array] refine report location

-   **eslint-plugin:** \[no-unnecessary-type-assertion] allow non-null assertion for void type

##### ❤️  Thank You

-   Abraham Guo
-   Kirk Waiblinger
-   YeonJuan

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v7.7.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#770-2024-04-15)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v7.6.0...v7.7.0)

##### 🚀 Features

-   **eslint-plugin:** replace `no-new-symbol` with `no-new-native-nonconstructor`

##### ❤️  Thank You

-   Dave
-   Josh Goldberg 

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v7.6.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#760-2024-04-08)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v7.5.0...v7.6.0)

##### 🚀 Features

-   bump npm dependency ranges

##### ❤️  Thank You

-   Abraham Guo
-   auvred
-   Brad Zacher

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v7.5.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#750-2024-04-01)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v7.4.0...v7.5.0)

##### 🩹 Fixes

-   **eslint-plugin:** \[no-floating-promises] handle TaggedTemplateExpression

-   **eslint-plugin:** \[no-unnecessary-type-assertion] handle exactOptionalPropertyTypes compiler option

##### ❤️  Thank You

-   Brad Zacher
-   Kim Sang Du
-   Mark de Dios
-   Naru
-   YeonJuan

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v7.4.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#740-2024-03-25)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v7.3.1...v7.4.0)

##### 🚀 Features

-   **eslint-plugin:** \[consistent-type-imports] ignore files with decorators, experimentalDecorators, and emitDecoratorMetadata

-   **eslint-plugin:** \[no-unnecessary-type-arguments] handle tagged templates

-   **eslint-plugin:** deprecate no-throw-literal and add a renamed only-throw-error

##### 🩹 Fixes

-   **eslint-plugin:** \[prefer-optional-chain] address multipart nullish checks false positive

-   **eslint-plugin:** \[prefer-optional-chain] properly disambiguate between `boolean` and `false`

-   **eslint-plugin:** \[no-unnecessary-type-assertion] avoid remove const casting on template literals with expressions inside

##### ❤️  Thank You

-   Abraham Guo
-   Brad Zacher
-   Josh Goldberg 
-   Kim Sang Du
-   Kirk Waiblinger
-   Marco Pasqualetti
-   YeonJuan

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v7.3.1`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#731-2024-03-18)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v7.3.0...v7.3.1)

##### 🩹 Fixes

-   **eslint-plugin:** \[no-floating-promises] revert disable of ignoreVoid in strict config

##### ❤️  Thank You

-   Josh Goldberg 

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v7.3.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#730-2024-03-18)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v7.2.0...v7.3.0)

##### 🚀 Features

-   **eslint-plugin:** \[restrict-template-expressions] add `allowArray` option

-   **eslint-plugin:** add meta.docs.recommended setting for strict config options

-   **eslint-plugin:** add rule `use-unknown-in-catch-callback-variables`

-   **eslint-plugin:** \[prefer-reduce-type-parameter] supports tuple, union, intersection

##### 🩹 Fixes

-   correct `engines.node` constraints in `package.json`

-   **eslint-plugin:** \[unbound-method] check method definition in object literal using longhand form

-   **eslint-plugin:** \[consistent-type-imports] handle imports without specifiers

-   **eslint-plugin:** \[no-redundant-type-constituents] incorrectly marks & string as redundant

-   **eslint-plugin:** \[no-unnecessary-qualifier] handle merge namespace with enum

-   **eslint-plugin:** \[no-unused-expressions] false negatives when using assertions

-   **eslint-plugin:** \[ban-ts-comment] more accurate handling of multiline comments

-   **eslint-plugin:** \[explicit-function-return-type, explicit-module-boundary-types] improved checking for allowHigherOrderFunctions option

-   **eslint-plugin:** \[class-literal-property-style] ignore property assigned in constructor

-   **eslint-plugin:** \[no-unnecessary-type-assertion] fix false negative for const variable declarations

##### ❤️  Thank You

-   Abraham Guo
-   Alexu
-   Arka Pratim Chaudhuri
-   auvred
-   Derrick Isaacson
-   fnx
-   Josh Goldberg 
-   Kirk Waiblinger
-   Marta Cardoso
-   Michaël De Boey
-   Tristan Rasmussen
-   YeonJuan

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v7.2.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#720-2024-03-11)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v7.1.1...v7.2.0)

##### 🚀 Features

-   support TS 5.4

-   **eslint-plugin:** \[prefer-string-starts-ends-with] add allowSingleElementEquality option

##### 🩹 Fixes

-   **eslint-plugin:** expose \*-type-checked-only configs for extension

-   **eslint-plugin:** \[member-ordering] report alphabetical sorting for all groups instead of just the first failing group

-   **eslint-plugin:** \[no-var-requires, no-require-imports] support template literal

-   **eslint-plugin:** \[no-useless-template-literals] detect TemplateLiteral

-   **eslint-plugin:** \[no-unnecessary-condition] handle union array and tuple type

-   **eslint-plugin:** \[prefer-find] support ternary branches in prefer-find

##### ❤️  Thank You

-   Arka Pratim Chaudhuri
-   auvred
-   Chris Plummer
-   Fotis Papadogeorgopoulos
-   Josh Goldberg 
-   Kirk Waiblinger
-   Wayne Zhang
-   YeonJuan

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v7.1.1`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#711-2024-03-04)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v7.1.0...v7.1.1)

This was a version bump only for eslint-plugin to align it with other projects, there were no code changes.

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v7.1.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#710-2024-02-26)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v7.0.2...v7.1.0)

##### 🚀 Features

-   **eslint-plugin:** add \*-type-checked-only configs

-   **eslint-plugin:** \[naming-convention] support the auto-accessor syntax

-   **eslint-plugin:** \[consistent-return] add new rule

##### 🩹 Fixes

-   **eslint-plugin:** \[prefer-optional-chan] allow typeof for avoiding reference error

-   **eslint-plugin:** \[no-misused-promises] improve check union types

-   **eslint-plugin:** \[no-use-before-define] fix false positive type reference in as, satisfies

##### ❤️  Thank You

-   Arka Pratim Chaudhuri
-   Josh Goldberg 
-   YeonJuan

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v7.0.2`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#702-2024-02-19)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v7.0.1...v7.0.2)

##### 🩹 Fixes

-   fix tsconfig-less check errors, fix `@types/eslint` incompatibilities, add tests

##### ❤️  Thank You

-   Brad Zacher
-   Gareth Jones

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v7.0.1`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#701-2024-02-12)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v7.0.0...v7.0.1)

##### 🩹 Fixes

-   **eslint-plugin:** update peer dep for parser

##### ❤️  Thank You

-   Tim Dorr

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

### [`v7.0.0`](https://github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#700-2024-02-12)

[Compare Source](https://github.com/typescript-eslint/typescript-eslint/compare/v6.21.0...v7.0.0)

##### 🚀 Features

-   ⚠️  bump ESLint, NodeJS, and TS minimum version requirements

-   add support for flat configs

##### 🩹 Fixes

-   **eslint-plugin:** \[prefer-find] stop throwing type errors when converting symbols to numbers

##### ⚠️  Breaking Changes

-   ⚠️  bump ESLint, NodeJS, and TS minimum version requirements

##### ❤️  Thank You

-   Brad Zacher
-   Kirk Waiblinger
-   StyleShit
-   YeonJuan

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

#### 6.21.0 (2024-02-05)

##### 🚀 Features

-   export plugin metadata

-   allow `parserOptions.project: false`

-   **eslint-plugin:** add rule prefer-find

##### 🩹 Fixes

-   **eslint-plugin:** \[no-unused-vars] don't report on types referenced in export assignment expression

-   **eslint-plugin:** \[switch-exhaustiveness-check] better support for intersections, infinite types, non-union values

-   **eslint-plugin:** \[consistent-type-imports] dont report on types used in export assignment expressions

-   **eslint-plugin:** \[no-unnecessary-condition] handle left-hand optional with exactOptionalPropertyTypes option

-   **eslint-plugin:** \[class-literal-property-style] allow getter when same key setter exists

-   **eslint-plugin:** \[no-unnecessary-type-assertion] provide valid fixes for assertions with extra tokens before `as` keyword

##### ❤️  Thank You

-   auvred
-   Brad Zacher
-   Kirk Waiblinger
-   Pete Gonzalez
-   YeonJuan

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

#### 6.20.0 (2024-01-29)

##### 🚀 Features

-   **eslint-plugin:** \[member-ordering] allow easy reuse of the default ordering

##### 🩹 Fixes

-   **eslint-plugin:** \[no-useless-template-literals] incorrect bigint autofix result

-   **eslint-plugin:** \[prefer-nullish-coalescing] treat any/unknown as non-nullable

-   **eslint-plugin:** \[no-useless-template-literals] report Infinity & NaN

-   **eslint-plugin:** \[prefer-readonly] disable checking accessors

##### ❤️  Thank You

-   Alex Parloti
-   auvred
-   James Browning
-   StyleShit
-   YeonJuan

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

#### 6.19.1 (2024-01-22)

##### 🩹 Fixes

-   **type-utils:** preventing isUnsafeAssignment infinite recursive calls

-   **eslint-plugin:** \[no-unnecessary-condition] fix false positive for type variable

##### ❤️  Thank You

-   YeonJuan

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

#### 6.19.0 (2024-01-15)

##### 🚀 Features

-   **eslint-plugin:** \[prefer-promise-reject-errors] add rule

-   **eslint-plugin:** \[no-array-delete] add new rule

-   **eslint-plugin:** \[no-useless-template-literals] add fix suggestions

##### 🩹 Fixes

-   **eslint-plugin:** \[no-unnecessary-type-assertion] detect unnecessary non-null-assertion on a call expression

-   **eslint-plugin:** \[no-unnecesary-type-assertion] treat unknown/any as nullable

##### ❤️  Thank You

-   auvred
-   Brad Zacher
-   Josh Goldberg 
-   Joshua Chen
-   LJX
-   Steven
-   StyleShit

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

#### 6.18.1 (2024-01-08)

##### 🩹 Fixes

-   **eslint-plugin:** \[no-non-null-assertion] provide valid fix when member access is on next line

-   **eslint-plugin:** \[no-unnecessary-condition] improve checking optional callee

-   **eslint-plugin:** \[prefer-readonly] support modifiers of unions and intersections

-   **eslint-plugin:** \[switch-exhaustiveness-check] fix new allowDefaultCaseForExhaustiveSwitch option

##### ❤️  Thank You

-   auvred
-   James
-   Josh Goldberg 
-   YeonJuan

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

#### 6.18.0 (2024-01-06)

##### 🚀 Features

-   **typescript-estree:** throw on invalid update expressions

-   **eslint-plugin:** \[no-var-requires, no-require-imports] allow option

##### ❤️  Thank You

-   auvred
-   Joshua Chen

You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjAiLCJ0YXJnZXRCcmFuY2giOiJkZXZlbG9wIn0=-->

Reviewed-on: #267
Reviewed-by: Vylpes <ethan@vylpes.com>
Co-authored-by: Renovate Bot <renovate@vylpes.com>
Co-committed-by: Renovate Bot <renovate@vylpes.com>
2024-06-25 17:47:51 +01:00
RenovateBot 146f0dbf5a Update dependency @types/node to v20.14.8 (#266)
All checks were successful
Deploy To Stage / build (push) Successful in 8s
Deploy To Stage / deploy (push) Successful in 16s
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node) ([source](https://github.com/DefinitelyTyped/DefinitelyTyped)) | devDependencies | patch | [`20.14.0` -> `20.14.8`](https://renovatebot.com/diffs/npm/@types%2fnode/20.14.0/20.14.8) |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjAiLCJ0YXJnZXRCcmFuY2giOiJkZXZlbG9wIn0=-->

Reviewed-on: #266
Reviewed-by: Vylpes <ethan@vylpes.com>
Co-authored-by: Renovate Bot <renovate@vylpes.com>
Co-committed-by: Renovate Bot <renovate@vylpes.com>
2024-06-25 17:46:26 +01:00
Ethan Lane 599328a3c1 Add to logger the ability to log to a discord webhook (#270)
All checks were successful
Deploy To Stage / build (push) Successful in 10s
Deploy To Stage / deploy (push) Successful in 16s
# Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

- Add to the logger a discord webhook transport
- Add to the deployment script the ability to setup the webhook

#235

## Type of change

Please delete options that are not relevant.

- [x] New feature (non-breaking change which adds functionality)

# How Has This Been Tested?

Please describe the tests that you ran to verify the changes. Provide instructions so we can reproduce. Please also list any relevant details to your test configuration.

# Checklist

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that provde my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules

Reviewed-on: #270
Reviewed-by: VylpesTester <tester@vylpes.com>
Co-authored-by: Ethan Lane <ethan@vylpes.com>
Co-committed-by: Ethan Lane <ethan@vylpes.com>
2024-06-22 10:16:17 +01:00
Ethan Lane 90a7dbee39 Merge branch 'main' into develop
All checks were successful
Deploy To Stage / build (push) Successful in 7s
Deploy To Stage / deploy (push) Successful in 14s
2024-06-15 21:02:07 +01:00
Ethan Lane 9e366eab5d Create timer to automatically purge expired claims (#268)
All checks were successful
Deploy To Stage / build (push) Successful in 8s
Deploy To Stage / deploy (push) Successful in 17s
# Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

- Create a timer which will purge expired claims automatically
- Update claiming so it can only be done within 5 minutes of being dropped

#215

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

# How Has This Been Tested?

Please describe the tests that you ran to verify the changes. Provide instructions so we can reproduce. Please also list any relevant details to your test configuration.

# Checklist

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that provde my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules

Reviewed-on: #268
Co-authored-by: Ethan Lane <ethan@vylpes.com>
Co-committed-by: Ethan Lane <ethan@vylpes.com>
2024-06-15 20:56:43 +01:00
Ethan Lane 7385a1bdb4 Update discord.js to v14.15.3 (#264)
All checks were successful
Deploy To Stage / build (push) Successful in 8s
Deploy To Stage / deploy (push) Successful in 14s
# Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

#243

## Type of change

Please delete options that are not relevant.

- [x] New feature (non-breaking change which adds functionality)

# How Has This Been Tested?

Please describe the tests that you ran to verify the changes. Provide instructions so we can reproduce. Please also list any relevant details to your test configuration.

# Checklist

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that provde my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules

Reviewed-on: #264
Reviewed-by: VylpesTester <tester@vylpes.com>
Co-authored-by: Ethan Lane <ethan@vylpes.com>
Co-committed-by: Ethan Lane <ethan@vylpes.com>
2024-06-09 10:39:41 +01:00
Ethan Lane 9d8107d318 Merge branch 'main' into develop
All checks were successful
Deploy To Stage / build (push) Successful in 8s
Deploy To Stage / deploy (push) Successful in 16s
2024-06-07 18:13:12 +01:00
Ethan Lane c0ac18515f Merge branch 'main' into develop
All checks were successful
Deploy To Stage / build (push) Successful in 7s
Deploy To Stage / deploy (push) Successful in 16s
2024-06-03 18:45:42 +01:00
RenovateBot 6561a1c998 Update dependency @types/node to v20.14.0 (#256)
All checks were successful
Deploy To Stage / build (push) Successful in 10s
Deploy To Stage / deploy (push) Successful in 16s
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node) ([source](https://github.com/DefinitelyTyped/DefinitelyTyped)) | devDependencies | minor | [`20.12.12` -> `20.14.0`](https://renovatebot.com/diffs/npm/@types%2fnode/20.12.12/20.14.0) |

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjAiLCJ0YXJnZXRCcmFuY2giOiJkZXZlbG9wIn0=-->

Reviewed-on: #256
Co-authored-by: Renovate Bot <renovate@vylpes.com>
Co-committed-by: Renovate Bot <renovate@vylpes.com>
2024-06-03 18:17:04 +01:00
RenovateBot e9876570d2 Update dependency ts-jest to v29.1.4 (#255)
All checks were successful
Deploy To Stage / build (push) Successful in 2m28s
Deploy To Stage / deploy (push) Successful in 16s
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [ts-jest](https://kulshekhar.github.io/ts-jest) ([source](https://github.com/kulshekhar/ts-jest)) | dependencies | patch | [`29.1.3` -> `29.1.4`](https://renovatebot.com/diffs/npm/ts-jest/29.1.3/29.1.4) |

---

### Release Notes

<details>
<summary>kulshekhar/ts-jest (ts-jest)</summary>

### [`v29.1.4`](https://github.com/kulshekhar/ts-jest/blob/HEAD/CHANGELOG.md#2914-2024-05-28)

[Compare Source](https://github.com/kulshekhar/ts-jest/compare/v29.1.3...v29.1.4)

##### Bug Fixes

-   fix(transformer): allow transforming of .cts/.mts extensions. ([#&#8203;3996](https://github.com/kulshekhar/ts-jest/issues/3996)) ([b8f6eaa](https://github.com/kulshekhar/ts-jest/commit/b8f6eaa)), closes [#&#8203;3996](https://github.com/kulshekhar/ts-jest/issues/3996)

##### Features

-   feat: make cli generate esm config based on `type: "module"` ([#&#8203;4210](https://github.com/kulshekhar/ts-jest/issues/4210)) ([81a5f64](https://github.com/kulshekhar/ts-jest/commit/81a5f64)), closes [#&#8203;4210](https://github.com/kulshekhar/ts-jest/issues/4210) [#&#8203;4012](https://github.com/kulshekhar/ts-jest/issues/4012)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjAiLCJ0YXJnZXRCcmFuY2giOiJkZXZlbG9wIn0=-->

Reviewed-on: #255
Co-authored-by: Renovate Bot <renovate@vylpes.com>
Co-committed-by: Renovate Bot <renovate@vylpes.com>
2024-06-03 18:13:48 +01:00
14 changed files with 669 additions and 107 deletions

View file

@ -14,6 +14,10 @@ BOT_CLIENTID=682942374040961060
BOT_ENV=4
BOT_ADMINS=147392775707426816,887272961504071690
BOT_LOGLEVEL=info
BOT_LOG_DISCORD_ENABLE=false
BOT_LOG_DISCORD_LEVEL=warn
BOT_LOG_DISCORD_WEBHOOK=
BOT_LOG_DISCORD_SERVICE=
ABOUT_FUNDING=
ABOUT_REPO=

View file

@ -55,12 +55,16 @@ jobs:
GDRIVESYNC_AUTO: ${{ vars.PROD_GDRIVESYNC_AUTO }}
EXPRESS_PORT: ${{ secrets.PROD_EXPRESS_PORT }}
BOT_LOGLEVEL: ${{ vars.PROD_BOT_LOGLEVEL }}
BOT_LOG_DISCORD_ENABLE: ${{ vars.PROD_BOT_LOG_DISCORD_ENABLE }}
BOT_LOG_DISCORD_LEVEL: ${{ vars.PROD_BOT_LOG_DISCORD_LEVEL }}
BOT_LOG_DISCORD_WEBHOOK: ${{ secrets.PROD_BOT_LOG_DISCORD_WEBHOOK }}
BOT_LOG_DISCORD_SERVICE: ${{ vars.PROD_BOT_LOG_DISCORD_SERVICE }}
with:
host: ${{ secrets.PROD_SSH_HOST }}
username: ${{ secrets.PROD_SSH_USER }}
key: ${{ secrets.PROD_SSH_KEY }}
port: ${{ secrets.PROD_SSH_PORT }}
envs: DB_NAME,DB_AUTH_USER,DB_AUTH_PASS,DB_HOST,DB_PORT,DB_ROOT_HOST,DB_SYNC,DB_LOGGING,DB_DATA_LOCATION,BOT_TOKEN,BOT_VER,BOT_AUTHOR,BOT_OWNERID,BOT_CLIENTID,ABOUT_FUNDING,ABOUT_REPO,BOT_ENV,BOT_ADMINS,DATA_DIR,GDRIVESYNC_AUTO,SERVER_PATH,EXPRESS_PORT,BOT_LOGLEVEL
envs: DB_NAME,DB_AUTH_USER,DB_AUTH_PASS,DB_HOST,DB_PORT,DB_ROOT_HOST,DB_SYNC,DB_LOGGING,DB_DATA_LOCATION,BOT_TOKEN,BOT_VER,BOT_AUTHOR,BOT_OWNERID,BOT_CLIENTID,ABOUT_FUNDING,ABOUT_REPO,BOT_ENV,BOT_ADMINS,DATA_DIR,GDRIVESYNC_AUTO,SERVER_PATH,EXPRESS_PORT,BOT_LOGLEVEL,BOT_LOG_DISCORD_ENABLE,BOT_LOG_DISCORD_LEVEL,BOT_LOG_DISCORD_WEBHOOK,BOT_LOG_DISCORD_SERVICE
script: |
source .sshrc \
&& cd /home/vylpes/apps/card-drop/card-drop_prod \

View file

@ -55,12 +55,16 @@ jobs:
GDRIVESYNC_AUTO: ${{ vars.STAGE_GDRIVESYNC_AUTO }}
EXPRESS_PORT: ${{ secrets.STAGE_EXPRESS_PORT }}
BOT_LOGLEVEL: ${{ vars.STAGE_BOT_LOGLEVEL }}
BOT_LOG_DISCORD_ENABLE: ${{ vars.STAGE_BOT_LOG_DISCORD_ENABLE }}
BOT_LOG_DISCORD_LEVEL: ${{ vars.STAGE_BOT_LOG_DISCORD_LEVEL }}
BOT_LOG_DISCORD_WEBHOOK: ${{ secrets.STAGE_BOT_LOG_DISCORD_WEBHOOK }}
BOT_LOG_DISCORD_SERVICE: ${{ vars.STAGE_BOT_LOG_DISCORD_SERVICE }}
with:
host: ${{ secrets.STAGE_SSH_HOST }}
username: ${{ secrets.STAGE_SSH_USER }}
key: ${{ secrets.STAGE_SSH_KEY }}
port: ${{ secrets.STAGE_SSH_PORT }}
envs: DB_NAME,DB_AUTH_USER,DB_AUTH_PASS,DB_HOST,DB_PORT,DB_ROOT_HOST,DB_SYNC,DB_LOGGING,DB_DATA_LOCATION,BOT_TOKEN,BOT_VER,BOT_AUTHOR,BOT_OWNERID,BOT_CLIENTID,ABOUT_FUNDING,ABOUT_REPO,BOT_ENV,BOT_ADMINS,DATA_DIR,GDRIVESYNC_AUTO,SERVER_PATH,EXPRESS_PORT,BOT_LOGLEVEL
envs: DB_NAME,DB_AUTH_USER,DB_AUTH_PASS,DB_HOST,DB_PORT,DB_ROOT_HOST,DB_SYNC,DB_LOGGING,DB_DATA_LOCATION,BOT_TOKEN,BOT_VER,BOT_AUTHOR,BOT_OWNERID,BOT_CLIENTID,ABOUT_FUNDING,ABOUT_REPO,BOT_ENV,BOT_ADMINS,DATA_DIR,GDRIVESYNC_AUTO,SERVER_PATH,EXPRESS_PORT,BOT_LOGLEVEL,BOT_LOG_DISCORD_ENABLE,BOT_LOG_DISCORD_LEVEL,BOT_LOG_DISCORD_WEBHOOK,BOT_LOG_DISCORD_SERVICE
script: |
source .sshrc \
&& cd /home/vylpes/apps/card-drop/card-drop_stage \

View file

@ -31,26 +31,29 @@
"@types/jest": "^29.0.0",
"@types/uuid": "^9.0.0",
"body-parser": "^1.20.2",
"canvas": "^2.11.2",
"clone-deep": "^4.0.1",
"cron": "^3.1.7",
"discord.js": "^14.3.0",
"discord.js": "^14.15.3",
"dotenv": "^16.0.0",
"express": "^4.18.2",
"glob": "^10.3.10",
"jest": "^29.0.0",
"jest-mock-extended": "^3.0.0",
"minimatch": "9.0.4",
"minimatch": "9.0.5",
"mysql": "^2.18.1",
"ts-jest": "^29.0.0",
"typeorm": "0.3.20",
"winston": "^3.11.0"
"winston": "^3.11.0",
"winston-daily-rotate-file": "^5.0.0",
"winston-discord-transport": "^1.3.0"
},
"overrides": {
"undici": "^5.28.3"
},
"devDependencies": {
"@types/node": "^20.0.0",
"@typescript-eslint/eslint-plugin": "^6.16.0",
"@typescript-eslint/eslint-plugin": "^7.0.0",
"@typescript-eslint/parser": "^6.16.0",
"eslint": "^8.56.0",
"np": "^9.0.0",

View file

@ -20,6 +20,14 @@ export default class Claim extends ButtonEvent {
const droppedBy = interaction.customId.split(" ")[3];
const userId = interaction.user.id;
const whenDropped = interaction.message.createdAt;
const lastClaimableDate = new Date(Date.now() - (1000 * 60 * 5)); // 5 minutes ago
if (whenDropped < lastClaimableDate) {
await interaction.channel.send(`${interaction.user}, Cards can only be claimed within 5 minutes of it being dropped!`);
return;
}
AppLogger.LogSilly("Button/Claim", `Parameters: cardNumber=${cardNumber}, claimId=${claimId}, droppedBy=${droppedBy}, userId=${userId}`);
const user = await User.FetchOneById(User, userId) || new User(userId, CardConstants.StartingCurrency);

View file

@ -11,6 +11,8 @@ export default class Inventory extends ButtonEvent {
const page = interaction.customId.split(" ")[2];
AppLogger.LogSilly("Button/Inventory", `Parameters: userid=${userid}, page=${page}`);
await interaction.deferUpdate();
const member = interaction.guild.members.cache.find(x => x.id == userid) || await interaction.guild.members.fetch(userid);
@ -24,7 +26,8 @@ export default class Inventory extends ButtonEvent {
const embed = await InventoryHelper.GenerateInventoryPage(member.user.username, member.user.id, Number(page));
await interaction.update({
await interaction.followUp({
files: [ embed.image ],
embeds: [ embed.embed ],
components: [ embed.row ],
});
@ -34,4 +37,4 @@ export default class Inventory extends ButtonEvent {
await interaction.reply("No page for user found.");
}
}
}
}

View file

@ -1,4 +1,7 @@
import path from "path";
import { Logger, createLogger, format, transports } from "winston";
import DailyRotateFile from "winston-daily-rotate-file";
import DiscordTransport from "winston-discord-transport";
export default class AppLogger {
public static Logger: Logger;
@ -19,12 +22,21 @@ export default class AppLogger {
customFormat,
),
defaultMeta: { service: "bot" },
transports: [
new transports.File({ filename: "error.log", level: "error" }),
new transports.File({ filename: "combined.log" }),
],
transports: [],
});
if (process.env.DATA_DIR) {
const logDir = path.join(process.env.DATA_DIR, "logs");
logger.add(new DailyRotateFile({
filename: "bot-%DATE%.log",
dirname: logDir,
datePattern: "YYYY-MM-DD-HH",
maxSize: "20m",
maxFiles: "14d",
}));
}
if (outputToConsole) {
logger.add(new transports.Console({
format: format.combine(
@ -34,6 +46,18 @@ export default class AppLogger {
)}));
}
if (process.env.BOT_LOG_DISCORD_ENABLE == "true") {
if (process.env.BOT_LOG_DISCORD_WEBHOOK) {
logger.add(new DiscordTransport({
webhook: process.env.BOT_LOG_DISCORD_WEBHOOK.toString(),
defaultMeta: { service: process.env.BOT_LOG_DISCORD_SERVICE },
level: process.env.BOT_LOG_DISCORD_LEVEL,
}));
} else {
throw "BOT_LOG_DISCORD_WEBHOOK is required to enable discord logger support.";
}
}
AppLogger.Logger = logger;
AppLogger.LogInfo("AppLogger", `Log Level: ${logLevel}`);
@ -62,4 +86,4 @@ export default class AppLogger {
public static LogSilly(label: string, message: string) {
AppLogger.Logger.silly({ label, message });
}
}
}

View file

@ -16,6 +16,7 @@ import { SeriesMetadata } from "../contracts/SeriesMetadata";
import AppLogger from "./appLogger";
import TimerHelper from "../helpers/TimerHelper";
import GiveCurrency from "../timers/GiveCurrency";
import PurgeClaims from "../timers/PurgeClaims";
export class CoreClient extends Client {
private static _commandItems: ICommandItem[];
@ -79,8 +80,10 @@ export class CoreClient extends Client {
.then(() => {
AppLogger.LogInfo("Client", "App Data Source Initialised");
const timerId = this._timerHelper.AddTimer("*/20 * * * *", "Europe/London", GiveCurrency, false);
this._timerHelper.StartTimer(timerId);
this._timerHelper.AddTimer("*/20 * * * *", "Europe/London", GiveCurrency, false);
this._timerHelper.AddTimer("0 0 * * *", "Europe/London", PurgeClaims, false);
this._timerHelper.StartAllTimers();
})
.catch(err => {
AppLogger.LogError("Client", "App Data Source Initialisation Failed");

View file

@ -88,4 +88,4 @@ export default class Drop extends Command {
}
}
}
}

View file

@ -26,6 +26,8 @@ export default class Inventory extends Command {
const user = userOption ? userOption.user! : interaction.user;
await interaction.deferReply();
AppLogger.LogSilly("Commands/Inventory", `Parameters: page=${page?.value}, user=${user.id}`);
try {
@ -37,14 +39,15 @@ export default class Inventory extends Command {
const embed = await InventoryHelper.GenerateInventoryPage(user.username, user.id, pageNumber);
await interaction.reply({
await interaction.followUp({
files: [ embed.image ],
embeds: [ embed.embed ],
components: [ embed.row ],
});
} catch (e) {
AppLogger.LogError("Commands/Inventory", e as string);
await interaction.reply("No page for user found.");
await interaction.followUp("No page for user found.");
}
}
}
}

View file

@ -39,6 +39,12 @@ export default class AppBaseEntity {
await repository.remove(entity);
}
public static async RemoveMany<T extends AppBaseEntity>(target: EntityTarget<T>, entity: T[]): Promise<void> {
const repository = AppDataSource.getRepository<T>(target);
await repository.remove(entity);
}
public static async FetchAll<T extends AppBaseEntity>(target: EntityTarget<T>, relations?: string[]): Promise<T[]> {
const repository = AppDataSource.getRepository<T>(target);

View file

@ -1,10 +1,12 @@
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, EmbedBuilder } from "discord.js";
import { ActionRowBuilder, AttachmentBuilder, ButtonBuilder, ButtonStyle, EmbedBuilder } from "discord.js";
import Inventory from "../database/entities/app/Inventory";
import { CoreClient } from "../client/client";
import EmbedColours from "../constants/EmbedColours";
import { CardRarity, CardRarityToString } from "../constants/CardRarity";
import cloneDeep from "clone-deep";
import AppLogger from "../client/appLogger";
import { createCanvas, loadImage } from "canvas";
import path from "path";
interface InventoryPage {
id: number,
@ -18,13 +20,21 @@ interface InventoryPageCards {
name: string,
type: CardRarity,
quantity: number,
path: string,
}
interface ReturnedInventoryPage {
embed: EmbedBuilder,
row: ActionRowBuilder<ButtonBuilder>,
image: AttachmentBuilder,
}
export default class InventoryHelper {
public static async GenerateInventoryPage(username: string, userid: string, page: number): Promise<{ embed: EmbedBuilder, row: ActionRowBuilder<ButtonBuilder> }> {
public static async GenerateInventoryPage(username: string, userid: string, page: number): Promise<ReturnedInventoryPage> {
AppLogger.LogSilly("Helpers/InventoryHelper", `Parameters: username=${username}, userid=${userid}, page=${page}`);
const cardsPerPage = 15;
const cardsPerPage = 9;
const inventory = await Inventory.FetchAllByUserId(userid);
@ -62,6 +72,7 @@ export default class InventoryHelper {
name: card.name,
type: card.type,
quantity: item.Quantity,
path: card.path,
});
}
@ -85,7 +96,8 @@ export default class InventoryHelper {
.setTitle(username)
.setDescription(`**${currentPage.name} (${currentPage.seriesSubpage + 1})**\n${currentPage.cards.map(x => `[${x.id}] ${x.name} (${CardRarityToString(x.type)}) x${x.quantity}`).join("\n")}`)
.setFooter({ text: `Page ${page + 1} of ${pages.length}` })
.setColor(EmbedColours.Ok);
.setColor(EmbedColours.Ok)
.setImage("attachment://page.png");
const row = new ActionRowBuilder<ButtonBuilder>()
.addComponents(
@ -100,6 +112,44 @@ export default class InventoryHelper {
.setStyle(ButtonStyle.Primary)
.setDisabled(page + 1 == pages.length));
return { embed, row };
const buffer = await this.GenerateInventoryImage(currentPage);
const image = new AttachmentBuilder(buffer, { name: "page.png" });
return { embed, row, image };
}
}
private static async GenerateInventoryImage(page: InventoryPage): Promise<Buffer> {
const gridWidth = 3;
const gridHeight = Math.ceil(page.cards.length / gridWidth);
const imageWidth = 526;
const imageHeight = 712;
const canvasWidth = imageWidth * gridWidth;
const canvasHeight = imageHeight * gridHeight;
const canvas = createCanvas(canvasWidth, canvasHeight);
const ctx = canvas.getContext("2d");
for (let i = 0; i < page.cards.length; i++) {
const card = page.cards[i];
const image = await loadImage(path.join(process.env.DATA_DIR!, "cards", card.path));
if (!image) {
AppLogger.LogError("InventoryHelper/GenerateInventoryImage", `Failed to load image for card ${card.id}`);
continue;
}
const x = i % gridWidth;
const y = Math.floor(i / gridWidth);
const imageX = imageWidth * x;
const imageY = imageHeight * y;
ctx.drawImage(image, imageX, imageY);
}
return canvas.toBuffer();
}
}

14
src/timers/PurgeClaims.ts Normal file
View file

@ -0,0 +1,14 @@
import AppLogger from "../client/appLogger";
import Claim from "../database/entities/app/Claim";
export default async function PurgeClaims() {
const claims = await Claim.FetchAll(Claim);
const whenLastClaimable = new Date(Date.now() - (1000 * 60 * 5)); // 5 minutes ago
const expiredClaims = claims.filter(x => x.WhenCreated < whenLastClaimable);
await Claim.RemoveMany(Claim, expiredClaims);
AppLogger.LogInfo("Timers/PurgeClaims", `Purged ${expiredClaims.length} claims from the database`);
}

600
yarn.lock

File diff suppressed because it is too large Load diff