From 29884695a17d2141050fa007ab657aef586ffed8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 May 2024 00:58:09 -0400 Subject: [PATCH 01/14] Bump @typescript-eslint/eslint-plugin from 7.8.0 to 7.9.0 (#257) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 90 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 55 insertions(+), 35 deletions(-) diff --git a/yarn.lock b/yarn.lock index 32332f5..cf480c6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1545,11 +1545,6 @@ expect "^29.0.0" pretty-format "^29.0.0" -"@types/json-schema@^7.0.15": - version "7.0.15" - resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz" - integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== - "@types/json5@^0.0.29": version "0.0.29" resolved "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz" @@ -1575,11 +1570,6 @@ dependencies: undici-types "~5.26.4" -"@types/semver@^7.5.8": - version "7.5.8" - resolved "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz" - integrity sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ== - "@types/stack-utils@^2.0.0": version "2.0.3" resolved "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz" @@ -1598,20 +1588,18 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^7.5.0": - version "7.8.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.8.0.tgz#c78e309fe967cb4de05b85cdc876fb95f8e01b6f" - integrity sha512-gFTT+ezJmkwutUPmB0skOj3GZJtlEGnlssems4AjkVweUPGj7jRwwqg0Hhg7++kPGJqKtTYx+R05Ftww372aIg== + version "7.9.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.9.0.tgz#093b96fc4e342226e65d5f18f9c87081e0b04a31" + integrity sha512-6e+X0X3sFe/G/54aC3jt0txuMTURqLyekmEHViqyA2VnxhLMpvA6nqmcjIy+Cr9tLDHPssA74BP5Mx9HQIxBEA== dependencies: "@eslint-community/regexpp" "^4.10.0" - "@typescript-eslint/scope-manager" "7.8.0" - "@typescript-eslint/type-utils" "7.8.0" - "@typescript-eslint/utils" "7.8.0" - "@typescript-eslint/visitor-keys" "7.8.0" - debug "^4.3.4" + "@typescript-eslint/scope-manager" "7.9.0" + "@typescript-eslint/type-utils" "7.9.0" + "@typescript-eslint/utils" "7.9.0" + "@typescript-eslint/visitor-keys" "7.9.0" graphemer "^1.4.0" ignore "^5.3.1" natural-compare "^1.4.0" - semver "^7.6.0" ts-api-utils "^1.3.0" "@typescript-eslint/parser@^7.5.0": @@ -1633,13 +1621,21 @@ "@typescript-eslint/types" "7.8.0" "@typescript-eslint/visitor-keys" "7.8.0" -"@typescript-eslint/type-utils@7.8.0": - version "7.8.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.8.0.tgz#9de166f182a6e4d1c5da76e94880e91831e3e26f" - integrity sha512-H70R3AefQDQpz9mGv13Uhi121FNMh+WEaRqcXTX09YEDky21km4dV1ZXJIp8QjXc4ZaVkXVdohvWDzbnbHDS+A== +"@typescript-eslint/scope-manager@7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.9.0.tgz#1dd3e63a4411db356a9d040e75864851b5f2619b" + integrity sha512-ZwPK4DeCDxr3GJltRz5iZejPFAAr4Wk3+2WIBaj1L5PYK5RgxExu/Y68FFVclN0y6GGwH8q+KgKRCvaTmFBbgQ== dependencies: - "@typescript-eslint/typescript-estree" "7.8.0" - "@typescript-eslint/utils" "7.8.0" + "@typescript-eslint/types" "7.9.0" + "@typescript-eslint/visitor-keys" "7.9.0" + +"@typescript-eslint/type-utils@7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.9.0.tgz#f523262e1b66ca65540b7a65a1222db52e0a90c9" + integrity sha512-6Qy8dfut0PFrFRAZsGzuLoM4hre4gjzWJB6sUvdunCYZsYemTkzZNwF1rnGea326PHPT3zn5Lmg32M/xfJfByA== + dependencies: + "@typescript-eslint/typescript-estree" "7.9.0" + "@typescript-eslint/utils" "7.9.0" debug "^4.3.4" ts-api-utils "^1.3.0" @@ -1648,6 +1644,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.8.0.tgz#1fd2577b3ad883b769546e2d1ef379f929a7091d" integrity sha512-wf0peJ+ZGlcH+2ZS23aJbOv+ztjeeP8uQ9GgwMJGVLx/Nj9CJt17GWgWWoSmoRVKAX2X+7fzEnAjxdvK2gqCLw== +"@typescript-eslint/types@7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.9.0.tgz#b58e485e4bfba055659c7e683ad4f5f0821ae2ec" + integrity sha512-oZQD9HEWQanl9UfsbGVcZ2cGaR0YT5476xfWE0oE5kQa2sNK2frxOlkeacLOTh9po4AlUT5rtkGyYM5kew0z5w== + "@typescript-eslint/typescript-estree@7.8.0": version "7.8.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.8.0.tgz#b028a9226860b66e623c1ee55cc2464b95d2987c" @@ -1662,18 +1663,29 @@ semver "^7.6.0" ts-api-utils "^1.3.0" -"@typescript-eslint/utils@7.8.0", "@typescript-eslint/utils@^6.13.0 || ^7.0.0": - version "7.8.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.8.0.tgz#57a79f9c0c0740ead2f622e444cfaeeb9fd047cd" - integrity sha512-L0yFqOCflVqXxiZyXrDr80lnahQfSOfc9ELAAZ75sqicqp2i36kEZZGuUymHNFoYOqxRT05up760b4iGsl02nQ== +"@typescript-eslint/typescript-estree@7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.9.0.tgz#3395e27656060dc313a6b406c3a298b729685e07" + integrity sha512-zBCMCkrb2YjpKV3LA0ZJubtKCDxLttxfdGmwZvTqqWevUPN0FZvSI26FalGFFUZU/9YQK/A4xcQF9o/VVaCKAg== dependencies: - "@eslint-community/eslint-utils" "^4.4.0" - "@types/json-schema" "^7.0.15" - "@types/semver" "^7.5.8" - "@typescript-eslint/scope-manager" "7.8.0" - "@typescript-eslint/types" "7.8.0" - "@typescript-eslint/typescript-estree" "7.8.0" + "@typescript-eslint/types" "7.9.0" + "@typescript-eslint/visitor-keys" "7.9.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + minimatch "^9.0.4" semver "^7.6.0" + ts-api-utils "^1.3.0" + +"@typescript-eslint/utils@7.9.0", "@typescript-eslint/utils@^6.13.0 || ^7.0.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.9.0.tgz#1b96a34eefdca1c820cb1bbc2751d848b4540899" + integrity sha512-5KVRQCzZajmT4Ep+NEgjXCvjuypVvYHUW7RHlXzNPuak2oWpVoD1jf5xCP0dPAuNIchjC7uQyvbdaSTFaLqSdA== + dependencies: + "@eslint-community/eslint-utils" "^4.4.0" + "@typescript-eslint/scope-manager" "7.9.0" + "@typescript-eslint/types" "7.9.0" + "@typescript-eslint/typescript-estree" "7.9.0" "@typescript-eslint/visitor-keys@7.8.0": version "7.8.0" @@ -1683,6 +1695,14 @@ "@typescript-eslint/types" "7.8.0" eslint-visitor-keys "^3.4.3" +"@typescript-eslint/visitor-keys@7.9.0": + version "7.9.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.9.0.tgz#82162656e339c3def02895f5c8546f6888d9b9ea" + integrity sha512-iESPx2TNLDNGQLyjKhUvIKprlP49XNEK+MvIf9nIO7ZZaZdbnfWKHnXAgufpxqfA0YryH8XToi4+CjBgVnFTSQ== + dependencies: + "@typescript-eslint/types" "7.9.0" + eslint-visitor-keys "^3.4.3" + "@ungap/structured-clone@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" From ea91e984572f3190ce6895e802c7d7e916866f29 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 May 2024 00:58:19 -0400 Subject: [PATCH 02/14] Bump @types/node from 20.12.10 to 20.12.11 (#256) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index cf480c6..e7861dd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1564,9 +1564,9 @@ form-data "^4.0.0" "@types/node@*", "@types/node@^20.11.27": - version "20.12.10" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.10.tgz#8f0c3f12b0f075eee1fe20c1afb417e9765bef76" - integrity sha512-Eem5pH9pmWBHoGAT8Dr5fdc5rYA+4NAovdM4EktRPVAAiJhmWWfQrA0cFhAbOsQdSfIHjAud6YdkbL69+zSKjw== + version "20.12.11" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.11.tgz#c4ef00d3507000d17690643278a60dc55a9dc9be" + integrity sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw== dependencies: undici-types "~5.26.4" From 62d18b5f9652be84c33cd7ca165c61dfaf248d49 Mon Sep 17 00:00:00 2001 From: Jens Astrup Date: Tue, 14 May 2024 01:11:26 -0400 Subject: [PATCH 03/14] 236: Improve StoryCustomField relationship to CustomField (#258) --- .../custom-fields/story-custom-field.ts | 17 +++++++++++-- .../custom-fields/story-custom-field.test.ts | 25 +++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/stories/custom-fields/story-custom-field.ts b/src/stories/custom-fields/story-custom-field.ts index 4c45666..11406cc 100644 --- a/src/stories/custom-fields/story-custom-field.ts +++ b/src/stories/custom-fields/story-custom-field.ts @@ -10,6 +10,7 @@ import UUID from '@sx/utils/uuid' export default class StoryCustomField extends BaseResource implements StoryCustomFieldInterface { public baseUrl = 'https://api.app.shortcut.com/api/v3/stories' public availableOperations = [] + private customField: CustomField | null = null constructor(init: StoryCustomFieldInterface) { super() @@ -23,8 +24,20 @@ export default class StoryCustomField extends BaseResource imple * without making a separate request. */ get field(): Promise { - const service = new CustomFieldsService({headers: getHeaders()}) - return service.get(this.fieldId) + if (this.customField) { + return Promise.resolve(this.customField) + } + const service: CustomFieldsService = new CustomFieldsService({headers: getHeaders()}) + const field: Promise = service.get(this.fieldId) + field.then((field: CustomField) => this.customField = field) + return field + } + + /** + * Get the name of the custom field that this story custom field is associated with. + */ + get name(): Promise { + return this.field.then((field) => field.name) } fieldId: UUID diff --git a/tests/stories/custom-fields/story-custom-field.test.ts b/tests/stories/custom-fields/story-custom-field.test.ts index a22eeca..2bd1bbd 100644 --- a/tests/stories/custom-fields/story-custom-field.test.ts +++ b/tests/stories/custom-fields/story-custom-field.test.ts @@ -16,6 +16,17 @@ describe('Story Custom Field', () => { expect(customField).toBeInstanceOf(StoryCustomField) }) + it('should return saved custom field', async () => { + const storyCustomField = new StoryCustomField({fieldId: '1'} as StoryCustomFieldInterface) + const customField: CustomField = new CustomField({id: '1'} as CustomFieldInterface) + const customFieldGet = jest.spyOn(CustomFieldsService.prototype, 'get').mockResolvedValue(customField) + const savedCustomField: CustomField = await storyCustomField.field + expect(savedCustomField).toBeInstanceOf(CustomField) + await expect(storyCustomField.field).resolves.toBeInstanceOf(CustomField) + expect(customFieldGet).toHaveBeenCalledTimes(1) + + }) + it('should return a field', async () => { jest.spyOn(CustomFieldsService.prototype, 'get').mockResolvedValue(new CustomField({ id: '1', @@ -26,4 +37,18 @@ describe('Story Custom Field', () => { expect(customField.values).toEqual([{fieldId: '1', value: 'value'}]) expect(customField).toBeInstanceOf(CustomField) }) + + it('should return a field name', async () => { + jest.spyOn(CustomFieldsService.prototype, 'get').mockResolvedValue(new CustomField({ + id: '1', + name: 'field', + canonicalName: 'fieldName', + createdAt: new Date(), + description: 'description', + values: [{fieldId: '1', value: 'value'}] + } as unknown as CustomFieldInterface)) + const customStoryField: StoryCustomField = new StoryCustomField({fieldId: '1'} as StoryCustomFieldInterface) + const customFieldName: string = await customStoryField.name + expect(customFieldName).toEqual('field') + }) }) From 888eb12b231e14b1de63457df48cbaca4bc49e36 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 May 2024 01:13:58 -0400 Subject: [PATCH 04/14] Bump @typescript-eslint/parser from 7.8.0 to 7.9.0 (#255) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 51 ++++++++------------------------------------------- 1 file changed, 8 insertions(+), 43 deletions(-) diff --git a/yarn.lock b/yarn.lock index e7861dd..a9f39e5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1603,23 +1603,15 @@ ts-api-utils "^1.3.0" "@typescript-eslint/parser@^7.5.0": - version "7.8.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.8.0.tgz#1e1db30c8ab832caffee5f37e677dbcb9357ddc8" - integrity sha512-KgKQly1pv0l4ltcftP59uQZCi4HUYswCLbTqVZEJu7uLX8CTLyswqMLqLN+2QFz4jCptqWVV4SB7vdxcH2+0kQ== - dependencies: - "@typescript-eslint/scope-manager" "7.8.0" - "@typescript-eslint/types" "7.8.0" - "@typescript-eslint/typescript-estree" "7.8.0" - "@typescript-eslint/visitor-keys" "7.8.0" - debug "^4.3.4" - -"@typescript-eslint/scope-manager@7.8.0": - version "7.8.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.8.0.tgz#bb19096d11ec6b87fb6640d921df19b813e02047" - integrity sha512-viEmZ1LmwsGcnr85gIq+FCYI7nO90DVbE37/ll51hjv9aG+YZMb4WDE2fyWpUR4O/UrhGRpYXK/XajcGTk2B8g== + version "7.9.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.9.0.tgz#fb3ba01b75e0e65cb78037a360961b00301f6c70" + integrity sha512-qHMJfkL5qvgQB2aLvhUSXxbK7OLnDkwPzFalg458pxQgfxKDfT1ZDbHQM/I6mDIf/svlMkj21kzKuQ2ixJlatQ== dependencies: - "@typescript-eslint/types" "7.8.0" - "@typescript-eslint/visitor-keys" "7.8.0" + "@typescript-eslint/scope-manager" "7.9.0" + "@typescript-eslint/types" "7.9.0" + "@typescript-eslint/typescript-estree" "7.9.0" + "@typescript-eslint/visitor-keys" "7.9.0" + debug "^4.3.4" "@typescript-eslint/scope-manager@7.9.0": version "7.9.0" @@ -1639,30 +1631,11 @@ debug "^4.3.4" ts-api-utils "^1.3.0" -"@typescript-eslint/types@7.8.0": - version "7.8.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.8.0.tgz#1fd2577b3ad883b769546e2d1ef379f929a7091d" - integrity sha512-wf0peJ+ZGlcH+2ZS23aJbOv+ztjeeP8uQ9GgwMJGVLx/Nj9CJt17GWgWWoSmoRVKAX2X+7fzEnAjxdvK2gqCLw== - "@typescript-eslint/types@7.9.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.9.0.tgz#b58e485e4bfba055659c7e683ad4f5f0821ae2ec" integrity sha512-oZQD9HEWQanl9UfsbGVcZ2cGaR0YT5476xfWE0oE5kQa2sNK2frxOlkeacLOTh9po4AlUT5rtkGyYM5kew0z5w== -"@typescript-eslint/typescript-estree@7.8.0": - version "7.8.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.8.0.tgz#b028a9226860b66e623c1ee55cc2464b95d2987c" - integrity sha512-5pfUCOwK5yjPaJQNy44prjCwtr981dO8Qo9J9PwYXZ0MosgAbfEMB008dJ5sNo3+/BN6ytBPuSvXUg9SAqB0dg== - dependencies: - "@typescript-eslint/types" "7.8.0" - "@typescript-eslint/visitor-keys" "7.8.0" - debug "^4.3.4" - globby "^11.1.0" - is-glob "^4.0.3" - minimatch "^9.0.4" - semver "^7.6.0" - ts-api-utils "^1.3.0" - "@typescript-eslint/typescript-estree@7.9.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.9.0.tgz#3395e27656060dc313a6b406c3a298b729685e07" @@ -1687,14 +1660,6 @@ "@typescript-eslint/types" "7.9.0" "@typescript-eslint/typescript-estree" "7.9.0" -"@typescript-eslint/visitor-keys@7.8.0": - version "7.8.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.8.0.tgz#7285aab991da8bee411a42edbd5db760d22fdd91" - integrity sha512-q4/gibTNBQNA0lGyYQCmWRS5D15n8rXh4QjK3KV+MBPlTYHpfBUT3D3PaPR/HeNiI9W6R7FvlkcGhNyAoP+caA== - dependencies: - "@typescript-eslint/types" "7.8.0" - eslint-visitor-keys "^3.4.3" - "@typescript-eslint/visitor-keys@7.9.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.9.0.tgz#82162656e339c3def02895f5c8546f6888d9b9ea" From 9983449815d69008f03d129ce27ef74c8ac6a2ef Mon Sep 17 00:00:00 2001 From: Jens Astrup Date: Sat, 25 May 2024 00:55:27 -0400 Subject: [PATCH 05/14] 263: Update custom eslint base config (#265) --- .eslintrc.cjs | 3 +- .github/workflows/lint.yml | 6 +- package.json | 6 +- yarn.lock | 226 +++++++++++++++++++++++++++++++++++-- 4 files changed, 227 insertions(+), 14 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 1234414..c2af7c6 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -15,7 +15,8 @@ module.exports = { "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaVersion": "latest", - "sourceType": "module" + "sourceType": "module", + "project": "./tsconfig.json" }, "plugins": [ "@typescript-eslint", diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 73f8b7d..73df5c1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,5 +22,7 @@ jobs: run: npm install -g yarn - name: Install dependencies run: yarn install --immutable - - name: Run linter - run: npm run lint + - name: Run ESLint on changed files + uses: tj-actions/eslint-changed-files@v25 + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json index fe69115..13c1bca 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,8 @@ "prepublishOnly": "npm run build", "test": "jest", "docs": "npx typedoc", - "lint": "eslint --ext ts src tests", - "lint:fix": "eslint . --ext .ts --fix" + "lint": "eslint --ext ts src", + "lint:fix": "eslint src --ext .ts --fix" }, "keywords": [], "author": "", @@ -46,7 +46,7 @@ "@typescript-eslint/parser": "^7.5.0", "axios-mock-adapter": "^1.22.0", "eslint": "^8.57.0", - "eslint-config-yenz": "^2.0.1", + "eslint-config-yenz": "^5.1.0", "eslint-plugin-import": "^2.29.1", "eslint-plugin-perfectionist": "^2.7.0", "jest": "^29.7.0", diff --git a/yarn.lock b/yarn.lock index a9f39e5..f2895b9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1121,6 +1121,11 @@ resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.0.tgz#a5417ae8427873f1dd08b70b3574b453e67b5f7f" integrity sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g== +"@eslint/js@^9.3.0": + version "9.3.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.3.0.tgz#2e8f65c9c55227abc4845b1513c69c32c679d8fe" + integrity sha512-niBqk8iwv96+yuTwjM6bWg8ovzAPF9qkICsGtcoa5/dmqcEMfdwNAX7+/OHcJHc7wj7XqPxH98oAHytFYlw6Sw== + "@humanwhocodes/config-array@^0.11.14": version "0.11.14" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.14.tgz#d78e481a039f7566ecc9660b4ea7fe6b1fec442b" @@ -1450,6 +1455,54 @@ dependencies: "@sinonjs/commons" "^3.0.0" +"@stylistic/eslint-plugin-js@2.1.0", "@stylistic/eslint-plugin-js@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@stylistic/eslint-plugin-js/-/eslint-plugin-js-2.1.0.tgz#3c4053c12bc6cc344f8ca979bb4399cda386e7a5" + integrity sha512-gdXUjGNSsnY6nPyqxu6lmDTtVrwCOjun4x8PUn0x04d5ucLI74N3MT1Q0UhdcOR9No3bo5PGDyBgXK+KmD787A== + dependencies: + "@types/eslint" "^8.56.10" + acorn "^8.11.3" + eslint-visitor-keys "^4.0.0" + espree "^10.0.1" + +"@stylistic/eslint-plugin-jsx@2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@stylistic/eslint-plugin-jsx/-/eslint-plugin-jsx-2.1.0.tgz#ce59d90bc47bc7ecc43574440b19b69d3b0dc5f1" + integrity sha512-mMD7S+IndZo2vxmwpHVTCwx2O1VdtE5tmpeNwgaEcXODzWV1WTWpnsc/PECQKIr/mkLPFWiSIqcuYNhQ/3l6AQ== + dependencies: + "@stylistic/eslint-plugin-js" "^2.1.0" + "@types/eslint" "^8.56.10" + estraverse "^5.3.0" + picomatch "^4.0.2" + +"@stylistic/eslint-plugin-plus@2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@stylistic/eslint-plugin-plus/-/eslint-plugin-plus-2.1.0.tgz#c02890685df3a4e5b9ff9ee113377bb237401695" + integrity sha512-S5QAlgYXESJaSBFhBSBLZy9o36gXrXQwWSt6QkO+F0SrT9vpV5JF/VKoh+ojO7tHzd8Ckmyouq02TT9Sv2B0zQ== + dependencies: + "@types/eslint" "^8.56.10" + "@typescript-eslint/utils" "^7.8.0" + +"@stylistic/eslint-plugin-ts@2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@stylistic/eslint-plugin-ts/-/eslint-plugin-ts-2.1.0.tgz#74083f74aacea19e7bc4509dafc56da7c4c40667" + integrity sha512-2ioFibufHYBALx2TBrU4KXovCkN8qCqcb9yIHc0fyOfTaO5jw4d56WW7YRcF3Zgde6qFyXwAN6z/+w4pnmos1g== + dependencies: + "@stylistic/eslint-plugin-js" "2.1.0" + "@types/eslint" "^8.56.10" + "@typescript-eslint/utils" "^7.8.0" + +"@stylistic/eslint-plugin@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@stylistic/eslint-plugin/-/eslint-plugin-2.1.0.tgz#61b73f7d4f6786517224aa3dee78c9ace5ca7d76" + integrity sha512-cBBowKP2u/+uE5CzgH5w8pE9VKqcM7BXdIDPIbGt2rmLJGnA6MJPr9vYGaqgMoJFs7R/FzsMQerMvvEP40g2uw== + dependencies: + "@stylistic/eslint-plugin-js" "2.1.0" + "@stylistic/eslint-plugin-jsx" "2.1.0" + "@stylistic/eslint-plugin-plus" "2.1.0" + "@stylistic/eslint-plugin-ts" "2.1.0" + "@types/eslint" "^8.56.10" + "@tsconfig/node10@^1.0.7": version "1.0.11" resolved "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz" @@ -1503,6 +1556,19 @@ dependencies: "@babel/types" "^7.20.7" +"@types/eslint@^8.56.10": + version "8.56.10" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.56.10.tgz#eb2370a73bf04a901eeba8f22595c7ee0f7eb58d" + integrity sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ== + dependencies: + "@types/estree" "*" + "@types/json-schema" "*" + +"@types/estree@*": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" + integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== + "@types/glob@^7.1.1": version "7.2.0" resolved "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz" @@ -1545,6 +1611,11 @@ expect "^29.0.0" pretty-format "^29.0.0" +"@types/json-schema@*": + version "7.0.15" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" + integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== + "@types/json5@^0.0.29": version "0.0.29" resolved "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz" @@ -1587,6 +1658,21 @@ dependencies: "@types/yargs-parser" "*" +"@typescript-eslint/eslint-plugin@7.10.0", "@typescript-eslint/eslint-plugin@^7.7.0": + version "7.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.10.0.tgz#07854a236f107bb45cbf4f62b89474cbea617f50" + integrity sha512-PzCr+a/KAef5ZawX7nbyNwBDtM1HdLIT53aSA2DDlxmxMngZ43O8SIePOeX8H5S+FHXeI6t97mTt/dDdzY4Fyw== + dependencies: + "@eslint-community/regexpp" "^4.10.0" + "@typescript-eslint/scope-manager" "7.10.0" + "@typescript-eslint/type-utils" "7.10.0" + "@typescript-eslint/utils" "7.10.0" + "@typescript-eslint/visitor-keys" "7.10.0" + graphemer "^1.4.0" + ignore "^5.3.1" + natural-compare "^1.4.0" + ts-api-utils "^1.3.0" + "@typescript-eslint/eslint-plugin@^7.5.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.9.0.tgz#093b96fc4e342226e65d5f18f9c87081e0b04a31" @@ -1602,6 +1688,17 @@ natural-compare "^1.4.0" ts-api-utils "^1.3.0" +"@typescript-eslint/parser@7.10.0", "@typescript-eslint/parser@^7.7.0": + version "7.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.10.0.tgz#e6ac1cba7bc0400a4459e7eb5b23115bd71accfb" + integrity sha512-2EjZMA0LUW5V5tGQiaa2Gys+nKdfrn2xiTIBLR4fxmPmVSvgPcKNW+AE/ln9k0A4zDUti0J/GZXMDupQoI+e1w== + dependencies: + "@typescript-eslint/scope-manager" "7.10.0" + "@typescript-eslint/types" "7.10.0" + "@typescript-eslint/typescript-estree" "7.10.0" + "@typescript-eslint/visitor-keys" "7.10.0" + debug "^4.3.4" + "@typescript-eslint/parser@^7.5.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.9.0.tgz#fb3ba01b75e0e65cb78037a360961b00301f6c70" @@ -1613,6 +1710,14 @@ "@typescript-eslint/visitor-keys" "7.9.0" debug "^4.3.4" +"@typescript-eslint/scope-manager@7.10.0": + version "7.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.10.0.tgz#054a27b1090199337a39cf755f83d9f2ce26546b" + integrity sha512-7L01/K8W/VGl7noe2mgH0K7BE29Sq6KAbVmxurj8GGaPDZXPr8EEQ2seOeAS+mEV9DnzxBQB6ax6qQQ5C6P4xg== + dependencies: + "@typescript-eslint/types" "7.10.0" + "@typescript-eslint/visitor-keys" "7.10.0" + "@typescript-eslint/scope-manager@7.9.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.9.0.tgz#1dd3e63a4411db356a9d040e75864851b5f2619b" @@ -1621,6 +1726,16 @@ "@typescript-eslint/types" "7.9.0" "@typescript-eslint/visitor-keys" "7.9.0" +"@typescript-eslint/type-utils@7.10.0": + version "7.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.10.0.tgz#8a75accce851d0a331aa9331268ef64e9b300270" + integrity sha512-D7tS4WDkJWrVkuzgm90qYw9RdgBcrWmbbRkrLA4d7Pg3w0ttVGDsvYGV19SH8gPR5L7OtcN5J1hTtyenO9xE9g== + dependencies: + "@typescript-eslint/typescript-estree" "7.10.0" + "@typescript-eslint/utils" "7.10.0" + debug "^4.3.4" + ts-api-utils "^1.3.0" + "@typescript-eslint/type-utils@7.9.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.9.0.tgz#f523262e1b66ca65540b7a65a1222db52e0a90c9" @@ -1631,11 +1746,30 @@ debug "^4.3.4" ts-api-utils "^1.3.0" +"@typescript-eslint/types@7.10.0": + version "7.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.10.0.tgz#da92309c97932a3a033762fd5faa8b067de84e3b" + integrity sha512-7fNj+Ya35aNyhuqrA1E/VayQX9Elwr8NKZ4WueClR3KwJ7Xx9jcCdOrLW04h51de/+gNbyFMs+IDxh5xIwfbNg== + "@typescript-eslint/types@7.9.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.9.0.tgz#b58e485e4bfba055659c7e683ad4f5f0821ae2ec" integrity sha512-oZQD9HEWQanl9UfsbGVcZ2cGaR0YT5476xfWE0oE5kQa2sNK2frxOlkeacLOTh9po4AlUT5rtkGyYM5kew0z5w== +"@typescript-eslint/typescript-estree@7.10.0": + version "7.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.10.0.tgz#6dcdc5de3149916a6a599fa89dde5c471b88b8bb" + integrity sha512-LXFnQJjL9XIcxeVfqmNj60YhatpRLt6UhdlFwAkjNc6jSUlK8zQOl1oktAP8PlWFzPQC1jny/8Bai3/HPuvN5g== + dependencies: + "@typescript-eslint/types" "7.10.0" + "@typescript-eslint/visitor-keys" "7.10.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + minimatch "^9.0.4" + semver "^7.6.0" + ts-api-utils "^1.3.0" + "@typescript-eslint/typescript-estree@7.9.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.9.0.tgz#3395e27656060dc313a6b406c3a298b729685e07" @@ -1650,6 +1784,16 @@ semver "^7.6.0" ts-api-utils "^1.3.0" +"@typescript-eslint/utils@7.10.0", "@typescript-eslint/utils@^6.0.0 || ^7.0.0", "@typescript-eslint/utils@^7.8.0": + version "7.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.10.0.tgz#8ee43e5608c9f439524eaaea8de5b358b15c51b3" + integrity sha512-olzif1Fuo8R8m/qKkzJqT7qwy16CzPRWBvERS0uvyc+DHd8AKbO4Jb7kpAvVzMmZm8TrHnI7hvjN4I05zow+tg== + dependencies: + "@eslint-community/eslint-utils" "^4.4.0" + "@typescript-eslint/scope-manager" "7.10.0" + "@typescript-eslint/types" "7.10.0" + "@typescript-eslint/typescript-estree" "7.10.0" + "@typescript-eslint/utils@7.9.0", "@typescript-eslint/utils@^6.13.0 || ^7.0.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.9.0.tgz#1b96a34eefdca1c820cb1bbc2751d848b4540899" @@ -1660,6 +1804,14 @@ "@typescript-eslint/types" "7.9.0" "@typescript-eslint/typescript-estree" "7.9.0" +"@typescript-eslint/visitor-keys@7.10.0": + version "7.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.10.0.tgz#2af2e91e73a75dd6b70b4486c48ae9d38a485a78" + integrity sha512-9ntIVgsi6gg6FIq9xjEO4VQJvwOqA3jaBFQJ/6TK5AvEup2+cECI6Fh7QiBxmfMHXU0V0J4RyPeOU1VDNzl9cg== + dependencies: + "@typescript-eslint/types" "7.10.0" + eslint-visitor-keys "^3.4.3" + "@typescript-eslint/visitor-keys@7.9.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.9.0.tgz#82162656e339c3def02895f5c8546f6888d9b9ea" @@ -1683,7 +1835,7 @@ acorn-walk@^8.1.1: resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz" integrity sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A== -acorn@^8.4.1, acorn@^8.9.0: +acorn@^8.11.3, acorn@^8.4.1, acorn@^8.9.0: version "8.11.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== @@ -2616,10 +2768,23 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-config-yenz@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/eslint-config-yenz/-/eslint-config-yenz-2.0.1.tgz#e296254e99ce96363635b88411ac4ce8a8e7bfa6" - integrity sha512-F6z3mWPOMW34qGUEhPuyMW5z8pLbQhj7S1RUn986NvuTeMwcleJKg8VY1Ao/N8KYn7eM1uA7deYNykD/0Q3+JA== +eslint-config-yenz@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/eslint-config-yenz/-/eslint-config-yenz-5.1.0.tgz#6074154f1dd6417a0dea42c647e7d5dd7e5db36c" + integrity sha512-cBSUnmcQNqYc0xlvM0D/CSwui4fUsgipIb3oXvbRicps0IHyE62tGhMOVLe0KdMmMFQ+M8H66vZ3VRe73wk77A== + dependencies: + "@eslint/js" "^9.3.0" + "@stylistic/eslint-plugin" "^2.1.0" + "@typescript-eslint/eslint-plugin" "^7.7.0" + "@typescript-eslint/parser" "^7.7.0" + eslint "^8.49.0" + eslint-plugin-import "^2.29.1" + eslint-plugin-jest "^28.5.0" + eslint-plugin-no-loops "^0.3.0" + eslint-plugin-perfectionist "^2.9.0" + eslint-plugin-yenz "^1.0.0" + typescript "^5.4.5" + typescript-eslint "^7.10.0" eslint-import-resolver-node@^0.3.9: version "0.3.9" @@ -2660,7 +2825,19 @@ eslint-plugin-import@^2.29.1: semver "^6.3.1" tsconfig-paths "^3.15.0" -eslint-plugin-perfectionist@^2.7.0: +eslint-plugin-jest@^28.5.0: + version "28.5.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-28.5.0.tgz#b497b795de37f671eaccd38bd83030186ff5dc8d" + integrity sha512-6np6DGdmNq/eBbA7HOUNV8fkfL86PYwBfwyb8n23FXgJNTR8+ot3smRHjza9LGsBBZRypK3qyF79vMjohIL8eQ== + dependencies: + "@typescript-eslint/utils" "^6.0.0 || ^7.0.0" + +eslint-plugin-no-loops@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-no-loops/-/eslint-plugin-no-loops-0.3.0.tgz#e81fecb4eaaf494a926d9caba9a7cd84d1fede7d" + integrity sha512-qI0oMgD0mA2Kpad2P/WncEqeVzvJKpHs/6+PA1SW4E6gXSXRmeV2cPv6+fnEgFwC7i+QtFRay2jUQ8DCH02nZg== + +eslint-plugin-perfectionist@^2.7.0, eslint-plugin-perfectionist@^2.9.0: version "2.10.0" resolved "https://registry.yarnpkg.com/eslint-plugin-perfectionist/-/eslint-plugin-perfectionist-2.10.0.tgz#15cf9f5545ce2db24d1ccdf3226645a097480faf" integrity sha512-P+tdrkHeMWBc55+DZsoDOAftV1WCsEoHaKm6JC7zajFus/syfT4vUPBFb3atGFSuyaVnGQGHlcKpP9X3Q0gH/w== @@ -2669,6 +2846,11 @@ eslint-plugin-perfectionist@^2.7.0: minimatch "^9.0.3" natural-compare-lite "^1.4.0" +eslint-plugin-yenz@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-yenz/-/eslint-plugin-yenz-1.0.0.tgz#e6f7268584f2d7ae8fc6092502cfb77d8c6ea005" + integrity sha512-+DbHy7NMyeUfxbO9SGZNxh7A3+i3Rx1Hk1iLL9yT9Esal5p/sJIOSDQxkxyoWacYyKRnWDGER3yjY6M2OTXAbg== + eslint-scope@^7.2.2: version "7.2.2" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.2.tgz#deb4f92563390f32006894af62a22dba1c46423f" @@ -2682,7 +2864,12 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4 resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== -eslint@^8.57.0: +eslint-visitor-keys@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz#e3adc021aa038a2a8e0b2f8b0ce8f66b9483b1fb" + integrity sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw== + +eslint@^8.49.0, eslint@^8.57.0: version "8.57.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.57.0.tgz#c786a6fd0e0b68941aaf624596fb987089195668" integrity sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ== @@ -2726,6 +2913,15 @@ eslint@^8.57.0: strip-ansi "^6.0.1" text-table "^0.2.0" +espree@^10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-10.0.1.tgz#600e60404157412751ba4a6f3a2ee1a42433139f" + integrity sha512-MWkrWZbJsL2UwnjxTX3gG8FneachS/Mwg7tdGXce011sJd5b0JG54vat5KHnfSBODZ3Wvzd2WnjxyzsRoVv+ww== + dependencies: + acorn "^8.11.3" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^4.0.0" + espree@^9.6.0, espree@^9.6.1: version "9.6.1" resolved "https://registry.yarnpkg.com/espree/-/espree-9.6.1.tgz#a2a17b8e434690a5432f2f8018ce71d331a48c6f" @@ -2754,7 +2950,7 @@ esrecurse@^4.3.0: dependencies: estraverse "^5.2.0" -estraverse@^5.1.0, estraverse@^5.2.0: +estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== @@ -4532,6 +4728,11 @@ picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1: resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== +picomatch@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.2.tgz#77c742931e8f3b8820946c76cd0c1f13730d1dab" + integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg== + pify@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz" @@ -5282,6 +5483,15 @@ typedoc-plugin-coverage@^3.1.0: resolved "https://registry.yarnpkg.com/typedoc-plugin-coverage/-/typedoc-plugin-coverage-3.1.1.tgz#dda6f4d12a870ffd231b24d53be859e2e44d9c31" integrity sha512-PAMYQ4fX7wJo6Y8mMzrISDNRurl5+xSNWEojrt6Yxofb/m7vWrgiP3bid2KXloMlPcSfCoBiJA6F2g3rmu8XTQ== +typescript-eslint@^7.10.0: + version "7.10.0" + resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-7.10.0.tgz#18637c414fcbf6ff1defac05b5c898c303a0ffed" + integrity sha512-thO8nyqptXdfWHQrMJJiJyftpW8aLmwRNs11xA8pSrXneoclFPstQZqXvDWuH1WNL4CHffqHvYUeCHTit6yfhQ== + dependencies: + "@typescript-eslint/eslint-plugin" "7.10.0" + "@typescript-eslint/parser" "7.10.0" + "@typescript-eslint/utils" "7.10.0" + typescript@^5.4.4, typescript@^5.4.5: version "5.4.5" resolved "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz" From 79969620638d1628e62b355314537292f46c1a34 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 23:04:17 -0400 Subject: [PATCH 06/14] Bump @typescript-eslint/parser from 7.9.0 to 7.12.0 (#273) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 53 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/yarn.lock b/yarn.lock index f2895b9..83aa63f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1688,7 +1688,7 @@ natural-compare "^1.4.0" ts-api-utils "^1.3.0" -"@typescript-eslint/parser@7.10.0", "@typescript-eslint/parser@^7.7.0": +"@typescript-eslint/parser@7.10.0": version "7.10.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.10.0.tgz#e6ac1cba7bc0400a4459e7eb5b23115bd71accfb" integrity sha512-2EjZMA0LUW5V5tGQiaa2Gys+nKdfrn2xiTIBLR4fxmPmVSvgPcKNW+AE/ln9k0A4zDUti0J/GZXMDupQoI+e1w== @@ -1699,15 +1699,15 @@ "@typescript-eslint/visitor-keys" "7.10.0" debug "^4.3.4" -"@typescript-eslint/parser@^7.5.0": - version "7.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.9.0.tgz#fb3ba01b75e0e65cb78037a360961b00301f6c70" - integrity sha512-qHMJfkL5qvgQB2aLvhUSXxbK7OLnDkwPzFalg458pxQgfxKDfT1ZDbHQM/I6mDIf/svlMkj21kzKuQ2ixJlatQ== +"@typescript-eslint/parser@^7.5.0", "@typescript-eslint/parser@^7.7.0": + version "7.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.12.0.tgz#8761df3345528b35049353db80010b385719b1c3" + integrity sha512-dm/J2UDY3oV3TKius2OUZIFHsomQmpHtsV0FTh1WO8EKgHLQ1QCADUqscPgTpU+ih1e21FQSRjXckHn3txn6kQ== dependencies: - "@typescript-eslint/scope-manager" "7.9.0" - "@typescript-eslint/types" "7.9.0" - "@typescript-eslint/typescript-estree" "7.9.0" - "@typescript-eslint/visitor-keys" "7.9.0" + "@typescript-eslint/scope-manager" "7.12.0" + "@typescript-eslint/types" "7.12.0" + "@typescript-eslint/typescript-estree" "7.12.0" + "@typescript-eslint/visitor-keys" "7.12.0" debug "^4.3.4" "@typescript-eslint/scope-manager@7.10.0": @@ -1718,6 +1718,14 @@ "@typescript-eslint/types" "7.10.0" "@typescript-eslint/visitor-keys" "7.10.0" +"@typescript-eslint/scope-manager@7.12.0": + version "7.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.12.0.tgz#259c014362de72dd34f995efe6bd8dda486adf58" + integrity sha512-itF1pTnN6F3unPak+kutH9raIkL3lhH1YRPGgt7QQOh43DQKVJXmWkpb+vpc/TiDHs6RSd9CTbDsc/Y+Ygq7kg== + dependencies: + "@typescript-eslint/types" "7.12.0" + "@typescript-eslint/visitor-keys" "7.12.0" + "@typescript-eslint/scope-manager@7.9.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.9.0.tgz#1dd3e63a4411db356a9d040e75864851b5f2619b" @@ -1751,6 +1759,11 @@ resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.10.0.tgz#da92309c97932a3a033762fd5faa8b067de84e3b" integrity sha512-7fNj+Ya35aNyhuqrA1E/VayQX9Elwr8NKZ4WueClR3KwJ7Xx9jcCdOrLW04h51de/+gNbyFMs+IDxh5xIwfbNg== +"@typescript-eslint/types@7.12.0": + version "7.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.12.0.tgz#bf208f971a8da1e7524a5d9ae2b5f15192a37981" + integrity sha512-o+0Te6eWp2ppKY3mLCU+YA9pVJxhUJE15FV7kxuD9jgwIAa+w/ycGJBMrYDTpVGUM/tgpa9SeMOugSabWFq7bg== + "@typescript-eslint/types@7.9.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.9.0.tgz#b58e485e4bfba055659c7e683ad4f5f0821ae2ec" @@ -1770,6 +1783,20 @@ semver "^7.6.0" ts-api-utils "^1.3.0" +"@typescript-eslint/typescript-estree@7.12.0": + version "7.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.12.0.tgz#e6c1074f248b3db6573ab6a7c47a39c4cd498ff9" + integrity sha512-5bwqLsWBULv1h6pn7cMW5dXX/Y2amRqLaKqsASVwbBHMZSnHqE/HN4vT4fE0aFsiwxYvr98kqOWh1a8ZKXalCQ== + dependencies: + "@typescript-eslint/types" "7.12.0" + "@typescript-eslint/visitor-keys" "7.12.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + minimatch "^9.0.4" + semver "^7.6.0" + ts-api-utils "^1.3.0" + "@typescript-eslint/typescript-estree@7.9.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.9.0.tgz#3395e27656060dc313a6b406c3a298b729685e07" @@ -1812,6 +1839,14 @@ "@typescript-eslint/types" "7.10.0" eslint-visitor-keys "^3.4.3" +"@typescript-eslint/visitor-keys@7.12.0": + version "7.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.12.0.tgz#c053b55a996679528beeedd8e565710ce1ae1ad3" + integrity sha512-uZk7DevrQLL3vSnfFl5bj4sL75qC9D6EdjemIdbtkuUmIheWpuiiylSY01JxJE7+zGrOWDZrp1WxOuDntvKrHQ== + dependencies: + "@typescript-eslint/types" "7.12.0" + eslint-visitor-keys "^3.4.3" + "@typescript-eslint/visitor-keys@7.9.0": version "7.9.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.9.0.tgz#82162656e339c3def02895f5c8546f6888d9b9ea" From 762ebfc8fd2b691adfcbb643561838805c90d0e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 23:04:29 -0400 Subject: [PATCH 07/14] Bump @types/node from 20.12.11 to 20.14.0 (#272) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 83aa63f..c12bf73 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1635,9 +1635,9 @@ form-data "^4.0.0" "@types/node@*", "@types/node@^20.11.27": - version "20.12.11" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.12.11.tgz#c4ef00d3507000d17690643278a60dc55a9dc9be" - integrity sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw== + version "20.14.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.0.tgz#49ceec7b34f8621470cff44677fa9d461a477f17" + integrity sha512-5cHBxFGJx6L4s56Bubp4fglrEpmyJypsqI6RgzMfBHWUJQGWAAi8cWcgetEbZXHYXo9C2Fa4EEds/uSyS4cxmA== dependencies: undici-types "~5.26.4" From 22273409a799c11a339b584c62a38b434386f401 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 23:04:48 -0400 Subject: [PATCH 08/14] Bump @typescript-eslint/eslint-plugin from 7.9.0 to 7.12.0 (#270) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/yarn.lock b/yarn.lock index c12bf73..fffe3d0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1658,7 +1658,7 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@7.10.0", "@typescript-eslint/eslint-plugin@^7.7.0": +"@typescript-eslint/eslint-plugin@7.10.0": version "7.10.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.10.0.tgz#07854a236f107bb45cbf4f62b89474cbea617f50" integrity sha512-PzCr+a/KAef5ZawX7nbyNwBDtM1HdLIT53aSA2DDlxmxMngZ43O8SIePOeX8H5S+FHXeI6t97mTt/dDdzY4Fyw== @@ -1673,16 +1673,16 @@ natural-compare "^1.4.0" ts-api-utils "^1.3.0" -"@typescript-eslint/eslint-plugin@^7.5.0": - version "7.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.9.0.tgz#093b96fc4e342226e65d5f18f9c87081e0b04a31" - integrity sha512-6e+X0X3sFe/G/54aC3jt0txuMTURqLyekmEHViqyA2VnxhLMpvA6nqmcjIy+Cr9tLDHPssA74BP5Mx9HQIxBEA== +"@typescript-eslint/eslint-plugin@^7.5.0", "@typescript-eslint/eslint-plugin@^7.7.0": + version "7.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.12.0.tgz#f87a32e8972b8a60024f2f8f12205e7c8108bc41" + integrity sha512-7F91fcbuDf/d3S8o21+r3ZncGIke/+eWk0EpO21LXhDfLahriZF9CGj4fbAetEjlaBdjdSm9a6VeXbpbT6Z40Q== dependencies: "@eslint-community/regexpp" "^4.10.0" - "@typescript-eslint/scope-manager" "7.9.0" - "@typescript-eslint/type-utils" "7.9.0" - "@typescript-eslint/utils" "7.9.0" - "@typescript-eslint/visitor-keys" "7.9.0" + "@typescript-eslint/scope-manager" "7.12.0" + "@typescript-eslint/type-utils" "7.12.0" + "@typescript-eslint/utils" "7.12.0" + "@typescript-eslint/visitor-keys" "7.12.0" graphemer "^1.4.0" ignore "^5.3.1" natural-compare "^1.4.0" @@ -1744,13 +1744,13 @@ debug "^4.3.4" ts-api-utils "^1.3.0" -"@typescript-eslint/type-utils@7.9.0": - version "7.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.9.0.tgz#f523262e1b66ca65540b7a65a1222db52e0a90c9" - integrity sha512-6Qy8dfut0PFrFRAZsGzuLoM4hre4gjzWJB6sUvdunCYZsYemTkzZNwF1rnGea326PHPT3zn5Lmg32M/xfJfByA== +"@typescript-eslint/type-utils@7.12.0": + version "7.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.12.0.tgz#9dfaaa1972952f395ec5be4f5bbfc4d3cdc63908" + integrity sha512-lib96tyRtMhLxwauDWUp/uW3FMhLA6D0rJ8T7HmH7x23Gk1Gwwu8UZ94NMXBvOELn6flSPiBrCKlehkiXyaqwA== dependencies: - "@typescript-eslint/typescript-estree" "7.9.0" - "@typescript-eslint/utils" "7.9.0" + "@typescript-eslint/typescript-estree" "7.12.0" + "@typescript-eslint/utils" "7.12.0" debug "^4.3.4" ts-api-utils "^1.3.0" @@ -1811,7 +1811,7 @@ semver "^7.6.0" ts-api-utils "^1.3.0" -"@typescript-eslint/utils@7.10.0", "@typescript-eslint/utils@^6.0.0 || ^7.0.0", "@typescript-eslint/utils@^7.8.0": +"@typescript-eslint/utils@7.10.0": version "7.10.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.10.0.tgz#8ee43e5608c9f439524eaaea8de5b358b15c51b3" integrity sha512-olzif1Fuo8R8m/qKkzJqT7qwy16CzPRWBvERS0uvyc+DHd8AKbO4Jb7kpAvVzMmZm8TrHnI7hvjN4I05zow+tg== @@ -1821,15 +1821,15 @@ "@typescript-eslint/types" "7.10.0" "@typescript-eslint/typescript-estree" "7.10.0" -"@typescript-eslint/utils@7.9.0", "@typescript-eslint/utils@^6.13.0 || ^7.0.0": - version "7.9.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.9.0.tgz#1b96a34eefdca1c820cb1bbc2751d848b4540899" - integrity sha512-5KVRQCzZajmT4Ep+NEgjXCvjuypVvYHUW7RHlXzNPuak2oWpVoD1jf5xCP0dPAuNIchjC7uQyvbdaSTFaLqSdA== +"@typescript-eslint/utils@7.12.0", "@typescript-eslint/utils@^6.0.0 || ^7.0.0", "@typescript-eslint/utils@^6.13.0 || ^7.0.0", "@typescript-eslint/utils@^7.8.0": + version "7.12.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.12.0.tgz#c6e58fd7f724cdccc848f71e388ad80cbdb95dd0" + integrity sha512-Y6hhwxwDx41HNpjuYswYp6gDbkiZ8Hin9Bf5aJQn1bpTs3afYY4GX+MPYxma8jtoIV2GRwTM/UJm/2uGCVv+DQ== dependencies: "@eslint-community/eslint-utils" "^4.4.0" - "@typescript-eslint/scope-manager" "7.9.0" - "@typescript-eslint/types" "7.9.0" - "@typescript-eslint/typescript-estree" "7.9.0" + "@typescript-eslint/scope-manager" "7.12.0" + "@typescript-eslint/types" "7.12.0" + "@typescript-eslint/typescript-estree" "7.12.0" "@typescript-eslint/visitor-keys@7.10.0": version "7.10.0" From 9f1e9f569a8332a2f2c1e011813fbc96f8b3e884 Mon Sep 17 00:00:00 2001 From: Jens Astrup Date: Mon, 3 Jun 2024 23:58:02 -0400 Subject: [PATCH 09/14] 269: Allow for directly accessing epic owners (#274) --- .eslintrc.cjs | 3 +- package.json | 5 +-- src/epics/epic.ts | 36 ++++++++++++------- tests/epics/epic.test.ts | 74 ++++++++++++++++++++++++++-------------- tsconfig.base.json | 3 +- tsconfig.cjs.json | 3 +- tsconfig.esm.json | 3 +- tsconfig.json | 3 +- yarn.lock | 24 +++++-------- 9 files changed, 90 insertions(+), 64 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index c2af7c6..4e86cfe 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -14,11 +14,12 @@ module.exports = { ], "parser": "@typescript-eslint/parser", "parserOptions": { + ...baseConfig.parserOptions, "ecmaVersion": "latest", "sourceType": "module", - "project": "./tsconfig.json" }, "plugins": [ + ...baseConfig.plugins, "@typescript-eslint", "perfectionist", "@typescript-eslint", diff --git a/package.json b/package.json index 13c1bca..473c8ab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "shortcut-api", - "version": "4.0.1", + "version": "4.1.1-alpha.0", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", "types": "dist/esm/index.d.ts", @@ -46,8 +46,9 @@ "@typescript-eslint/parser": "^7.5.0", "axios-mock-adapter": "^1.22.0", "eslint": "^8.57.0", - "eslint-config-yenz": "^5.1.0", + "eslint-config-yenz": "^5.2.1", "eslint-plugin-import": "^2.29.1", + "eslint-plugin-jest": "^28.5.0", "eslint-plugin-perfectionist": "^2.7.0", "jest": "^29.7.0", "renamer": "^5.0.0", diff --git a/src/epics/epic.ts b/src/epics/epic.ts index c230155..20fa007 100644 --- a/src/epics/epic.ts +++ b/src/epics/epic.ts @@ -1,4 +1,4 @@ -import axios from 'axios' +import axios, { AxiosError, AxiosResponse } from 'axios' import BaseData from '@sx/base-data' import BaseResource from '@sx/base-resource' @@ -12,9 +12,9 @@ import TeamsService from '@sx/teams/teams-service' import CreateThreadedCommentData from '@sx/threaded-comments/contracts/create-threaded-comment-data' import ThreadedCommentApiData from '@sx/threaded-comments/contracts/threaded-comment-api-data' import ThreadedCommentInterface from '@sx/threaded-comments/contracts/threaded-comment-interface' -import {convertApiFields, convertToApiFields} from '@sx/utils/convert-fields' -import {handleResponseFailure} from '@sx/utils/handle-response-failure' -import {getHeaders} from '@sx/utils/headers' +import { convertApiFields, convertToApiFields } from '@sx/utils/convert-fields' +import { handleResponseFailure } from '@sx/utils/handle-response-failure' +import { getHeaders } from '@sx/utils/headers' import UUID from '@sx/utils/uuid' @@ -36,7 +36,7 @@ export default class Epic extends BaseResource implements EpicInt * @returns {Promise} */ get objectives(): Promise { - const service = new ObjectivesService({headers: getHeaders()}) + const service = new ObjectivesService({ headers: getHeaders() }) return service.getMany(this.objectiveIds) } @@ -45,7 +45,7 @@ export default class Epic extends BaseResource implements EpicInt * @returns {Promise} */ get teams(): Promise { - const service = new TeamsService({headers: getHeaders()}) + const service = new TeamsService({ headers: getHeaders() }) return service.getMany(this.groupIds) } @@ -54,10 +54,19 @@ export default class Epic extends BaseResource implements EpicInt * @returns {Promise} */ get followers(): Promise { - const service: MembersService = new MembersService({headers: getHeaders()}) + const service: MembersService = new MembersService({ headers: getHeaders() }) return service.getMany(this.followerIds) } + /** + * Get the owners of the epic + * @returns {Promise} + */ + get owners(): Promise { + const service = new MembersService({ headers: getHeaders() }) + return service.getMany(this.ownerIds) + } + /** * Add a comment to the epic authored by the user associated with the API key currently in use * @@ -72,14 +81,14 @@ export default class Epic extends BaseResource implements EpicInt */ public async comment(comment: string): Promise { const url = `${Epic.baseUrl}/${this.id}/comments` - const response = await axios.post(url, {text: comment}, {headers: getHeaders()}).catch((error) => { - handleResponseFailure(error, {text: comment}) + const response: void | AxiosResponse = await axios.post(url, { text: comment }, { headers: getHeaders() }).catch((error: AxiosError) => { + handleResponseFailure(error, { text: comment }) }) if (!response) { throw new Error('Failed to add comment') } const data: ThreadedCommentApiData = response.data - return convertApiFields(data) as ThreadedCommentInterface + return convertApiFields(data) } /** @@ -94,17 +103,18 @@ export default class Epic extends BaseResource implements EpicInt public async addComment(comment: CreateThreadedCommentData): Promise { const url = `${Epic.baseUrl}/${this.id}/comments` const requestData: BaseData = convertToApiFields(comment) - const response = await axios.post(url, requestData, {headers: getHeaders()}).catch((error) => { + const response: void | AxiosResponse = await axios.post(url, requestData, { headers: getHeaders() }).catch((error: AxiosError) => { handleResponseFailure(error, requestData) }) - if (!response){ + if (!response) { throw new Error('Failed to add comment') } const data: ThreadedCommentApiData = response.data - return convertApiFields(data) as ThreadedCommentInterface + return convertApiFields(data) } + appUrl: string archived: boolean associatedGroups: [] diff --git a/tests/epics/epic.test.ts b/tests/epics/epic.test.ts index 978e58b..facdb70 100644 --- a/tests/epics/epic.test.ts +++ b/tests/epics/epic.test.ts @@ -1,12 +1,15 @@ import axios from 'axios' -import Epic from '../../src/epics/epic' -import Objective from '../../src/objectives/objective' -import ObjectivesService from '../../src/objectives/objectives-service' -import Team from '../../src/teams/team' -import TeamsService from '../../src/teams/teams-service' -import {convertApiFields} from '../../src/utils/convert-fields' -import {getHeaders} from '../../src/utils/headers' +import Epic from '@sx/epics/epic' +import Objective from '@sx/objectives/objective' +import ObjectivesService from '@sx/objectives/objectives-service' +import Team from '@sx/teams/team' +import TeamsService from '@sx/teams/teams-service' +import { convertApiFields } from '@sx/utils/convert-fields' +import { getHeaders } from '@sx/utils/headers' + +import Member from '../../src/members/member' +import MembersService from '../../src/members/members-service' jest.mock('axios', () => ({ @@ -25,41 +28,61 @@ describe('Epic', () => { }) describe('objectives getter', () => { - it('returns an array of objectives', () => { - const objectives = [{id: 1}, {id: 2}] + it('returns an array of objectives', async () => { + const objectives = [{ id: 1 }, { id: 2 }] jest.spyOn(ObjectivesService.prototype, 'getMany').mockResolvedValue(objectives as unknown as Objective[]) - const epic = new Epic({id: 1, objectiveIds: [1, 2]}) - expect(epic.objectives).resolves.toEqual([{id: 1}, {id: 2}]) + const epic = new Epic({ id: 1, objectiveIds: [1, 2] }) + await expect(epic.objectives).resolves.toEqual([{ id: 1 }, { id: 2 }]) expect(ObjectivesService.prototype.getMany).toHaveBeenCalledWith([1, 2]) }) }) describe('teams getter', () => { - it('returns the team object', () => { - const teams = [{id: 1}] + it('returns the team object', async () => { + const teams = [{ id: 1 }] jest.spyOn(TeamsService.prototype, 'getMany').mockResolvedValue(teams as unknown as Team[]) - const epic = new Epic({groupIds: [1]}) - expect(epic.teams).resolves.toEqual([{id: 1}]) + const epic = new Epic({ groupIds: [1] }) + await expect(epic.teams).resolves.toEqual([{ id: 1 }]) expect(TeamsService.prototype.getMany).toHaveBeenCalledWith([1]) }) }) + describe('followers getter', () => { + it('returns the followers', async () => { + const members = [{ id: 1 }] + jest.spyOn(MembersService.prototype, 'getMany').mockResolvedValue(members as unknown as Member[]) + const epic = new Epic({ followerIds: [1] }) + await expect(epic.followers).resolves.toEqual([{ id: 1 }]) + expect(MembersService.prototype.getMany).toHaveBeenCalledWith([1]) + }) + }) + + describe('owners getter', () => { + it('returns the owner object', async () => { + const owners = [{ id: 1 }] + jest.spyOn(MembersService.prototype, 'getMany').mockResolvedValue(owners as unknown as Member[]) + const epic = new Epic({ ownerIds: [1] }) + await expect(epic.owners).resolves.toEqual([{ id: 1 }]) + expect(MembersService.prototype.getMany).toHaveBeenCalledWith([1]) + }) + }) + describe('comment method', () => { it('successfully posts a comment and returns the epic comment object', async () => { - const commentData = {text: 'Test comment'} - const expectedResponse = {data: commentData} + const commentData = { text: 'Test comment' } + const expectedResponse = { data: commentData } mockedAxios.post.mockResolvedValue(expectedResponse) - const epic = new Epic({id: 1}) + const epic = new Epic({ id: 1 }) const result = await epic.comment('Test comment') expect(result).toEqual(convertApiFields(commentData)) - expect(mockedAxios.post).toHaveBeenCalledWith(`${Epic.baseUrl}/${epic.id}/comments`, {text: 'Test comment'}, {headers: getHeaders()}) + expect(mockedAxios.post).toHaveBeenCalledWith(`${Epic.baseUrl}/${epic.id}/comments`, { text: 'Test comment' }, { headers: getHeaders() }) }) it('throws an error if the mockedAxios request fails', async () => { mockedAxios.post.mockRejectedValue(new Error('Network error')) - const epic = new Epic({id: 1}) + const epic = new Epic({ id: 1 }) await expect(epic.comment('Test comment')).rejects.toThrow('Failed to add comment') }) @@ -67,11 +90,11 @@ describe('Epic', () => { describe('addComment method', () => { it('successfully posts a comment and returns the epic comment object', async () => { - const commentData = {text: 'Test comment'} - const expectedResponse = {data: commentData} + const commentData = { text: 'Test comment' } + const expectedResponse = { data: commentData } mockedAxios.post.mockResolvedValue(expectedResponse) - const epic = new Epic({id: 1}) + const epic = new Epic({ id: 1 }) const comment = { text: 'Test comment', authorId: '123', @@ -88,13 +111,12 @@ describe('Epic', () => { created_at: null, external_id: null, updated_at: null - }, {headers: getHeaders()}) - + }, { headers: getHeaders() }) }) it('throws an error if the mockedAxios request fails', async () => { mockedAxios.post.mockRejectedValue(new Error('Network error')) - const epic = new Epic({id: 1}) + const epic = new Epic({ id: 1 }) const comment = { text: 'Test comment', authorId: '123', diff --git a/tsconfig.base.json b/tsconfig.base.json index a707cb5..a53b54f 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -28,7 +28,8 @@ "esm": true }, "include": [ - "./src/**/*.ts" + "./src/**/*.ts", + "./tests/**/*.ts" ], "exclude": [ "node_modules", diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json index f57a4ab..99d16d0 100644 --- a/tsconfig.cjs.json +++ b/tsconfig.cjs.json @@ -3,6 +3,5 @@ "compilerOptions": { "module": "CommonJS", "outDir": "./dist/cjs" - }, - "include": ["src/**/*"] + } } diff --git a/tsconfig.esm.json b/tsconfig.esm.json index f6755ae..c3caec7 100644 --- a/tsconfig.esm.json +++ b/tsconfig.esm.json @@ -3,6 +3,5 @@ "compilerOptions": { "module": "ESNext", "outDir": "./dist/esm" - }, - "include": ["src/**/*"] + } } diff --git a/tsconfig.json b/tsconfig.json index c5e4942..b4694c0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,6 +4,5 @@ "module": "ESNext", "outDir": "./dist/esm", "types": ["node", "jest"], - }, - "include": ["src/**/*"] + } } diff --git a/yarn.lock b/yarn.lock index fffe3d0..9eac4c5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2803,10 +2803,10 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-config-yenz@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/eslint-config-yenz/-/eslint-config-yenz-5.1.0.tgz#6074154f1dd6417a0dea42c647e7d5dd7e5db36c" - integrity sha512-cBSUnmcQNqYc0xlvM0D/CSwui4fUsgipIb3oXvbRicps0IHyE62tGhMOVLe0KdMmMFQ+M8H66vZ3VRe73wk77A== +eslint-config-yenz@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/eslint-config-yenz/-/eslint-config-yenz-5.2.1.tgz#99b710b331eccf178a03d7b65c11d29b309a1293" + integrity sha512-IxC7fgHZ6NmHU3OFyEJkjkAfrhUmYUma+6pBQrMLs1N0R42IiqvMPLoMQtdoHhlTVE9n5AKoAcvRQ/RF+pbMjw== dependencies: "@eslint/js" "^9.3.0" "@stylistic/eslint-plugin" "^2.1.0" @@ -2815,9 +2815,8 @@ eslint-config-yenz@^5.1.0: eslint "^8.49.0" eslint-plugin-import "^2.29.1" eslint-plugin-jest "^28.5.0" - eslint-plugin-no-loops "^0.3.0" eslint-plugin-perfectionist "^2.9.0" - eslint-plugin-yenz "^1.0.0" + eslint-plugin-yenz "^1.1.0" typescript "^5.4.5" typescript-eslint "^7.10.0" @@ -2867,11 +2866,6 @@ eslint-plugin-jest@^28.5.0: dependencies: "@typescript-eslint/utils" "^6.0.0 || ^7.0.0" -eslint-plugin-no-loops@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-no-loops/-/eslint-plugin-no-loops-0.3.0.tgz#e81fecb4eaaf494a926d9caba9a7cd84d1fede7d" - integrity sha512-qI0oMgD0mA2Kpad2P/WncEqeVzvJKpHs/6+PA1SW4E6gXSXRmeV2cPv6+fnEgFwC7i+QtFRay2jUQ8DCH02nZg== - eslint-plugin-perfectionist@^2.7.0, eslint-plugin-perfectionist@^2.9.0: version "2.10.0" resolved "https://registry.yarnpkg.com/eslint-plugin-perfectionist/-/eslint-plugin-perfectionist-2.10.0.tgz#15cf9f5545ce2db24d1ccdf3226645a097480faf" @@ -2881,10 +2875,10 @@ eslint-plugin-perfectionist@^2.7.0, eslint-plugin-perfectionist@^2.9.0: minimatch "^9.0.3" natural-compare-lite "^1.4.0" -eslint-plugin-yenz@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-yenz/-/eslint-plugin-yenz-1.0.0.tgz#e6f7268584f2d7ae8fc6092502cfb77d8c6ea005" - integrity sha512-+DbHy7NMyeUfxbO9SGZNxh7A3+i3Rx1Hk1iLL9yT9Esal5p/sJIOSDQxkxyoWacYyKRnWDGER3yjY6M2OTXAbg== +eslint-plugin-yenz@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-yenz/-/eslint-plugin-yenz-1.1.0.tgz#81b691d4eb396f3528c1f57fb7167420fa8ed208" + integrity sha512-EBRVOnamSNSozBdRz5ZP9A1dDRQ6xNMXR0BsDrUUBHCBwdYwQu1kYYLcvTxRYtH++lBoKTUb8P/YyqwOXabBXw== eslint-scope@^7.2.2: version "7.2.2" From 3a12e0e427e851ddd3508a46435f1ef4e0c3da25 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 23:58:34 -0400 Subject: [PATCH 10/14] Bump ts-jest from 29.1.2 to 29.1.4 (#271) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 9eac4c5..63a4bf9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5386,9 +5386,9 @@ ts-api-utils@^1.3.0: integrity sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ== ts-jest@^29.1.2: - version "29.1.2" - resolved "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.2.tgz" - integrity sha512-br6GJoH/WUX4pu7FbZXuWGKGNDuU7b8Uj77g/Sp7puZV6EXzuByl6JrECvm0MzVzSTkSHWTihsXt+5XYER5b+g== + version "29.1.4" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.1.4.tgz#26f8a55ce31e4d2ef7a1fd47dc7fa127e92793ef" + integrity sha512-YiHwDhSvCiItoAgsKtoLFCuakDzDsJ1DLDnSouTaTmdOcOwIkSzbLXduaQ6M5DRVhuZC/NYaaZ/mtHbWMv/S6Q== dependencies: bs-logger "0.x" fast-json-stable-stringify "2.x" From c3d2756f53e90a840a136f55ec661754b8720705 Mon Sep 17 00:00:00 2001 From: Jens Astrup Date: Tue, 4 Jun 2024 00:04:43 -0400 Subject: [PATCH 11/14] 268: Add MemberProfile to docs (#275) --- src/index.ts | 8 +++++--- src/members/contracts/member-profile.ts | 19 ++++++++++--------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/index.ts b/src/index.ts index 8054d52..24650c3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -50,6 +50,7 @@ import ObjectiveInterface from '@sx/objectives/contracts/objective-interface' import LabelInterface from '@sx/labels/contracts/label-interface' import KeyResultInterface from '@sx/key-results/contracts/key-result-interface' import LinkedFileInterface from '@sx/linked-files/contracts/linked-file-interface' +import MemberProfile from '@sx/members/contracts/member-profile' // Utils @@ -71,6 +72,8 @@ export { LinkedFilesService, CustomFieldsService, UploadedFilesService, +} +export { IterationInterface, MemberInterface, StoryInterface, @@ -79,9 +82,8 @@ export { EpicInterface, ObjectiveInterface, LabelInterface, - KeyResultInterface -} -export { + KeyResultInterface, + MemberProfile, ThreadedCommentInterface, CreateThreadedCommentData, StoryCommentInterface, diff --git a/src/members/contracts/member-profile.ts b/src/members/contracts/member-profile.ts index 76c80dd..e795403 100644 --- a/src/members/contracts/member-profile.ts +++ b/src/members/contracts/member-profile.ts @@ -4,16 +4,17 @@ import Workspace from '@sx/workspace/contracts/workspace' interface MemberProfile extends BaseInterface { - deactivated: boolean, - displayIcon: string, - emailAddress: string, - gravatarHash: string, - id: UUID, - isOwner: boolean, - mentionName: string, - name: string, + deactivated: boolean + displayIcon: string + emailAddress: string + gravatarHash: string + id: UUID + isOwner: boolean + mentionName: string + name: string twoFactorAuthEnabled: boolean workspace: Workspace } -export {MemberProfile} +export { MemberProfile } +export default MemberProfile From 6a947272ba37d41c8f6fa5da14f64d8cd04ddb45 Mon Sep 17 00:00:00 2001 From: Jens Astrup Date: Tue, 4 Jun 2024 00:24:29 -0400 Subject: [PATCH 12/14] Increment version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 473c8ab..ec08f2e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "shortcut-api", - "version": "4.1.1-alpha.0", + "version": "4.1.0", "main": "dist/cjs/index.js", "module": "dist/esm/index.js", "types": "dist/esm/index.d.ts", From 3cff7e30b7f1ca447f1bef8da90345fb9bbf283b Mon Sep 17 00:00:00 2001 From: Jens Astrup Date: Tue, 4 Jun 2024 03:32:00 -0400 Subject: [PATCH 13/14] Lint story-custom-field.ts (#277) --- src/stories/custom-fields/story-custom-field.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/stories/custom-fields/story-custom-field.ts b/src/stories/custom-fields/story-custom-field.ts index 11406cc..84a1644 100644 --- a/src/stories/custom-fields/story-custom-field.ts +++ b/src/stories/custom-fields/story-custom-field.ts @@ -3,7 +3,7 @@ import CustomField from '@sx/custom-fields/custom-field' import CustomFieldsService from '@sx/custom-fields/custom-fields-service' import StoryInterface from '@sx/stories/contracts/story-interface' import StoryCustomFieldInterface from '@sx/stories/custom-fields/contracts/story-custom-field-interface' -import {getHeaders} from '@sx/utils/headers' +import { getHeaders } from '@sx/utils/headers' import UUID from '@sx/utils/uuid' @@ -27,7 +27,7 @@ export default class StoryCustomField extends BaseResource imple if (this.customField) { return Promise.resolve(this.customField) } - const service: CustomFieldsService = new CustomFieldsService({headers: getHeaders()}) + const service: CustomFieldsService = new CustomFieldsService({ headers: getHeaders() }) const field: Promise = service.get(this.fieldId) field.then((field: CustomField) => this.customField = field) return field @@ -37,7 +37,7 @@ export default class StoryCustomField extends BaseResource imple * Get the name of the custom field that this story custom field is associated with. */ get name(): Promise { - return this.field.then((field) => field.name) + return this.field.then(field => field.name) } fieldId: UUID From 16fae7ee7853a55a12364ce20d43d97fd0b97ddc Mon Sep 17 00:00:00 2001 From: Jens Astrup Date: Tue, 4 Jun 2024 03:35:06 -0400 Subject: [PATCH 14/14] Lint story-custom-field.test.ts (#278) --- .../custom-fields/story-custom-field.test.ts | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/stories/custom-fields/story-custom-field.test.ts b/tests/stories/custom-fields/story-custom-field.test.ts index 2bd1bbd..03c4853 100644 --- a/tests/stories/custom-fields/story-custom-field.test.ts +++ b/tests/stories/custom-fields/story-custom-field.test.ts @@ -5,36 +5,35 @@ import StoryCustomFieldInterface from '@sx/stories/custom-fields/contracts/story import StoryCustomField from '@sx/stories/custom-fields/story-custom-field' -jest.mock('../../../src/utils/headers', () => ({ - getHeaders: jest.fn().mockReturnValue({Authorization: 'Bearer token'}) +jest.mock('@sx/utils/headers', () => ({ + getHeaders: jest.fn().mockReturnValue({ Authorization: 'Bearer token' }) })) describe('Story Custom Field', () => { it('should instantiate a new custom field', () => { - const customField = new StoryCustomField({fieldId: '1'} as StoryCustomFieldInterface) + const customField = new StoryCustomField({ fieldId: '1' } as StoryCustomFieldInterface) expect(customField).toBeInstanceOf(StoryCustomField) }) it('should return saved custom field', async () => { - const storyCustomField = new StoryCustomField({fieldId: '1'} as StoryCustomFieldInterface) - const customField: CustomField = new CustomField({id: '1'} as CustomFieldInterface) + const storyCustomField = new StoryCustomField({ fieldId: '1' } as StoryCustomFieldInterface) + const customField: CustomField = new CustomField({ id: '1' } as CustomFieldInterface) const customFieldGet = jest.spyOn(CustomFieldsService.prototype, 'get').mockResolvedValue(customField) const savedCustomField: CustomField = await storyCustomField.field expect(savedCustomField).toBeInstanceOf(CustomField) await expect(storyCustomField.field).resolves.toBeInstanceOf(CustomField) expect(customFieldGet).toHaveBeenCalledTimes(1) - }) it('should return a field', async () => { jest.spyOn(CustomFieldsService.prototype, 'get').mockResolvedValue(new CustomField({ id: '1', - values: [{fieldId: '1', value: 'value'} as unknown as CustomFieldInterface] + values: [{ fieldId: '1', value: 'value' } as unknown as CustomFieldInterface] } as unknown as CustomFieldInterface)) - const customStoryField: StoryCustomField = new StoryCustomField({fieldId: '1'} as StoryCustomFieldInterface) + const customStoryField: StoryCustomField = new StoryCustomField({ fieldId: '1' } as StoryCustomFieldInterface) const customField: CustomField = await customStoryField.field - expect(customField.values).toEqual([{fieldId: '1', value: 'value'}]) + expect(customField.values).toEqual([{ fieldId: '1', value: 'value' }]) expect(customField).toBeInstanceOf(CustomField) }) @@ -45,9 +44,9 @@ describe('Story Custom Field', () => { canonicalName: 'fieldName', createdAt: new Date(), description: 'description', - values: [{fieldId: '1', value: 'value'}] + values: [{ fieldId: '1', value: 'value' }] } as unknown as CustomFieldInterface)) - const customStoryField: StoryCustomField = new StoryCustomField({fieldId: '1'} as StoryCustomFieldInterface) + const customStoryField: StoryCustomField = new StoryCustomField({ fieldId: '1' } as StoryCustomFieldInterface) const customFieldName: string = await customStoryField.name expect(customFieldName).toEqual('field') })