Commit d2d27f7c authored by nanahira's avatar nanahira

add api

parent a12f4540
Pipeline #19571 passed with stages
in 3 minutes and 7 seconds
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
"karma-coverage": "~2.1.0", "karma-coverage": "~2.1.0",
"karma-jasmine": "~4.0.0", "karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "~1.7.0", "karma-jasmine-html-reporter": "~1.7.0",
"ng-openapi-gen": "^0.23.0",
"typescript": "~4.6.2" "typescript": "~4.6.2"
} }
}, },
...@@ -697,6 +698,36 @@ ...@@ -697,6 +698,36 @@
"rxjs": "^6.5.3 || ^7.4.0" "rxjs": "^6.5.3 || ^7.4.0"
} }
}, },
"node_modules/@apidevtools/json-schema-ref-parser": {
"version": "9.1.0",
"resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.1.0.tgz",
"integrity": "sha512-teB30tFooE3iQs2HQIKJ02D8UZA1Xy1zaczzhUjJs0CymYxeC0g+y5rCY2p8NHBM6DBUVoR8rSM4kHLj1WE9mQ==",
"dev": true,
"dependencies": {
"@jsdevtools/ono": "^7.1.3",
"@types/json-schema": "^7.0.6",
"call-me-maybe": "^1.0.1",
"js-yaml": "^4.1.0"
}
},
"node_modules/@apidevtools/json-schema-ref-parser/node_modules/argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
"dev": true
},
"node_modules/@apidevtools/json-schema-ref-parser/node_modules/js-yaml": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
"dev": true,
"dependencies": {
"argparse": "^2.0.1"
},
"bin": {
"js-yaml": "bin/js-yaml.js"
}
},
"node_modules/@assemblyscript/loader": { "node_modules/@assemblyscript/loader": {
"version": "0.10.1", "version": "0.10.1",
"resolved": "https://registry.npmjs.org/@assemblyscript/loader/-/loader-0.10.1.tgz", "resolved": "https://registry.npmjs.org/@assemblyscript/loader/-/loader-0.10.1.tgz",
...@@ -2551,6 +2582,12 @@ ...@@ -2551,6 +2582,12 @@
"@jridgewell/sourcemap-codec": "^1.4.10" "@jridgewell/sourcemap-codec": "^1.4.10"
} }
}, },
"node_modules/@jsdevtools/ono": {
"version": "7.1.3",
"resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz",
"integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==",
"dev": true
},
"node_modules/@ng-bootstrap/ng-bootstrap": { "node_modules/@ng-bootstrap/ng-bootstrap": {
"version": "12.1.2", "version": "12.1.2",
"resolved": "https://registry.npmjs.org/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-12.1.2.tgz", "resolved": "https://registry.npmjs.org/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-12.1.2.tgz",
...@@ -4075,6 +4112,12 @@ ...@@ -4075,6 +4112,12 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/call-me-maybe": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz",
"integrity": "sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==",
"dev": true
},
"node_modules/callsites": { "node_modules/callsites": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
...@@ -5330,6 +5373,12 @@ ...@@ -5330,6 +5373,12 @@
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/eol": {
"version": "0.9.1",
"resolved": "https://registry.npmjs.org/eol/-/eol-0.9.1.tgz",
"integrity": "sha512-Ds/TEoZjwggRoz/Q2O7SE3i4Jm66mqTDfmdHdq/7DKVk3bro9Q8h6WdXKdPqFLMoqxrDK5SVRzHVPOS6uuGtrg==",
"dev": true
},
"node_modules/err-code": { "node_modules/err-code": {
"version": "2.0.3", "version": "2.0.3",
"resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz",
...@@ -6801,6 +6850,36 @@ ...@@ -6801,6 +6850,36 @@
"integrity": "sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==", "integrity": "sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==",
"dev": true "dev": true
}, },
"node_modules/handlebars": {
"version": "4.7.7",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz",
"integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==",
"dev": true,
"dependencies": {
"minimist": "^1.2.5",
"neo-async": "^2.6.0",
"source-map": "^0.6.1",
"wordwrap": "^1.0.0"
},
"bin": {
"handlebars": "bin/handlebars"
},
"engines": {
"node": ">=0.4.7"
},
"optionalDependencies": {
"uglify-js": "^3.1.4"
}
},
"node_modules/handlebars/node_modules/source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true,
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/has": { "node_modules/has": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
...@@ -7782,6 +7861,12 @@ ...@@ -7782,6 +7861,12 @@
"integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==",
"dev": true "dev": true
}, },
"node_modules/json-schema": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz",
"integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==",
"dev": true
},
"node_modules/json-schema-traverse": { "node_modules/json-schema-traverse": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
...@@ -8792,6 +8877,49 @@ ...@@ -8792,6 +8877,49 @@
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",
"dev": true "dev": true
}, },
"node_modules/ng-openapi-gen": {
"version": "0.23.0",
"resolved": "https://registry.npmjs.org/ng-openapi-gen/-/ng-openapi-gen-0.23.0.tgz",
"integrity": "sha512-l4deWdfjDBLOQaP84OSl1D4B8CvwptxyigGFMqyqWEb50SIfYaHKcFwcumLjjPtsjuP3IDv4J1IRlD6y4kFgpw==",
"dev": true,
"dependencies": {
"@apidevtools/json-schema-ref-parser": "^9.0.9",
"argparse": "^2.0.1",
"eol": "^0.9.1",
"fs-extra": "^10.0.1",
"handlebars": "^4.7.7",
"jsesc": "^3.0.2",
"json-schema": "^0.4.0",
"lodash": "^4.17.21",
"mkdirp": "^1.0.4",
"typescript": "^4.5.4"
},
"bin": {
"ng-openapi-gen": "lib/index.js"
},
"peerDependencies": {
"@angular/core": ">=12.0.0",
"rxjs": ">=6.0.0"
}
},
"node_modules/ng-openapi-gen/node_modules/argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
"dev": true
},
"node_modules/ng-openapi-gen/node_modules/jsesc": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz",
"integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==",
"dev": true,
"bin": {
"jsesc": "bin/jsesc"
},
"engines": {
"node": ">=6"
}
},
"node_modules/nice-napi": { "node_modules/nice-napi": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/nice-napi/-/nice-napi-1.0.2.tgz", "resolved": "https://registry.npmjs.org/nice-napi/-/nice-napi-1.0.2.tgz",
...@@ -12064,6 +12192,19 @@ ...@@ -12064,6 +12192,19 @@
"node": "*" "node": "*"
} }
}, },
"node_modules/uglify-js": {
"version": "3.17.4",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz",
"integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==",
"dev": true,
"optional": true,
"bin": {
"uglifyjs": "bin/uglifyjs"
},
"engines": {
"node": ">=0.8.0"
}
},
"node_modules/unicode-canonical-property-names-ecmascript": { "node_modules/unicode-canonical-property-names-ecmascript": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz",
...@@ -12574,6 +12715,12 @@ ...@@ -12574,6 +12715,12 @@
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/wordwrap": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
"integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==",
"dev": true
},
"node_modules/wrap-ansi": { "node_modules/wrap-ansi": {
"version": "7.0.0", "version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
...@@ -13156,6 +13303,35 @@ ...@@ -13156,6 +13303,35 @@
"tslib": "^2.3.0" "tslib": "^2.3.0"
} }
}, },
"@apidevtools/json-schema-ref-parser": {
"version": "9.1.0",
"resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.1.0.tgz",
"integrity": "sha512-teB30tFooE3iQs2HQIKJ02D8UZA1Xy1zaczzhUjJs0CymYxeC0g+y5rCY2p8NHBM6DBUVoR8rSM4kHLj1WE9mQ==",
"dev": true,
"requires": {
"@jsdevtools/ono": "^7.1.3",
"@types/json-schema": "^7.0.6",
"call-me-maybe": "^1.0.1",
"js-yaml": "^4.1.0"
},
"dependencies": {
"argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
"dev": true
},
"js-yaml": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
"dev": true,
"requires": {
"argparse": "^2.0.1"
}
}
}
},
"@assemblyscript/loader": { "@assemblyscript/loader": {
"version": "0.10.1", "version": "0.10.1",
"resolved": "https://registry.npmjs.org/@assemblyscript/loader/-/loader-0.10.1.tgz", "resolved": "https://registry.npmjs.org/@assemblyscript/loader/-/loader-0.10.1.tgz",
...@@ -14459,6 +14635,12 @@ ...@@ -14459,6 +14635,12 @@
"@jridgewell/sourcemap-codec": "^1.4.10" "@jridgewell/sourcemap-codec": "^1.4.10"
} }
}, },
"@jsdevtools/ono": {
"version": "7.1.3",
"resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz",
"integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==",
"dev": true
},
"@ng-bootstrap/ng-bootstrap": { "@ng-bootstrap/ng-bootstrap": {
"version": "12.1.2", "version": "12.1.2",
"resolved": "https://registry.npmjs.org/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-12.1.2.tgz", "resolved": "https://registry.npmjs.org/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-12.1.2.tgz",
...@@ -15639,6 +15821,12 @@ ...@@ -15639,6 +15821,12 @@
"get-intrinsic": "^1.0.2" "get-intrinsic": "^1.0.2"
} }
}, },
"call-me-maybe": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz",
"integrity": "sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==",
"dev": true
},
"callsites": { "callsites": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
...@@ -16578,6 +16766,12 @@ ...@@ -16578,6 +16766,12 @@
"integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==",
"dev": true "dev": true
}, },
"eol": {
"version": "0.9.1",
"resolved": "https://registry.npmjs.org/eol/-/eol-0.9.1.tgz",
"integrity": "sha512-Ds/TEoZjwggRoz/Q2O7SE3i4Jm66mqTDfmdHdq/7DKVk3bro9Q8h6WdXKdPqFLMoqxrDK5SVRzHVPOS6uuGtrg==",
"dev": true
},
"err-code": { "err-code": {
"version": "2.0.3", "version": "2.0.3",
"resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz",
...@@ -17578,6 +17772,27 @@ ...@@ -17578,6 +17772,27 @@
"integrity": "sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==", "integrity": "sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==",
"dev": true "dev": true
}, },
"handlebars": {
"version": "4.7.7",
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz",
"integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==",
"dev": true,
"requires": {
"minimist": "^1.2.5",
"neo-async": "^2.6.0",
"source-map": "^0.6.1",
"uglify-js": "^3.1.4",
"wordwrap": "^1.0.0"
},
"dependencies": {
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true
}
}
},
"has": { "has": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
...@@ -18308,6 +18523,12 @@ ...@@ -18308,6 +18523,12 @@
"integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==",
"dev": true "dev": true
}, },
"json-schema": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz",
"integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==",
"dev": true
},
"json-schema-traverse": { "json-schema-traverse": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
...@@ -19072,6 +19293,38 @@ ...@@ -19072,6 +19293,38 @@
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",
"dev": true "dev": true
}, },
"ng-openapi-gen": {
"version": "0.23.0",
"resolved": "https://registry.npmjs.org/ng-openapi-gen/-/ng-openapi-gen-0.23.0.tgz",
"integrity": "sha512-l4deWdfjDBLOQaP84OSl1D4B8CvwptxyigGFMqyqWEb50SIfYaHKcFwcumLjjPtsjuP3IDv4J1IRlD6y4kFgpw==",
"dev": true,
"requires": {
"@apidevtools/json-schema-ref-parser": "^9.0.9",
"argparse": "^2.0.1",
"eol": "^0.9.1",
"fs-extra": "^10.0.1",
"handlebars": "^4.7.7",
"jsesc": "^3.0.2",
"json-schema": "^0.4.0",
"lodash": "^4.17.21",
"mkdirp": "^1.0.4",
"typescript": "^4.5.4"
},
"dependencies": {
"argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
"dev": true
},
"jsesc": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz",
"integrity": "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==",
"dev": true
}
}
},
"nice-napi": { "nice-napi": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/nice-napi/-/nice-napi-1.0.2.tgz", "resolved": "https://registry.npmjs.org/nice-napi/-/nice-napi-1.0.2.tgz",
...@@ -21442,6 +21695,13 @@ ...@@ -21442,6 +21695,13 @@
"integrity": "sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ==", "integrity": "sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ==",
"dev": true "dev": true
}, },
"uglify-js": {
"version": "3.17.4",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz",
"integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==",
"dev": true,
"optional": true
},
"unicode-canonical-property-names-ecmascript": { "unicode-canonical-property-names-ecmascript": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz",
...@@ -21817,6 +22077,12 @@ ...@@ -21817,6 +22077,12 @@
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
"dev": true "dev": true
}, },
"wordwrap": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
"integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==",
"dev": true
},
"wrap-ansi": { "wrap-ansi": {
"version": "7.0.0", "version": "7.0.0",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
"start": "ng serve", "start": "ng serve",
"build": "ng build", "build": "ng build",
"watch": "ng build --watch --configuration development", "watch": "ng build --watch --configuration development",
"test": "ng test" "test": "ng test",
"gen": "ng-openapi-gen --input http://localhost:3000/docs-json --output src/app/api"
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
...@@ -43,6 +44,7 @@ ...@@ -43,6 +44,7 @@
"karma-coverage": "~2.1.0", "karma-coverage": "~2.1.0",
"karma-jasmine": "~4.0.0", "karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "~1.7.0", "karma-jasmine-html-reporter": "~1.7.0",
"ng-openapi-gen": "^0.23.0",
"typescript": "~4.6.2" "typescript": "~4.6.2"
} }
} }
/* tslint:disable */
/* eslint-disable */
import { Injectable } from '@angular/core';
/**
* Global configuration
*/
@Injectable({
providedIn: 'root',
})
export class ApiConfiguration {
rootUrl: string = '';
}
/**
* Parameters for `ApiModule.forRoot()`
*/
export interface ApiConfigurationParams {
rootUrl?: string;
}
/* tslint:disable */
/* eslint-disable */
import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ApiConfiguration, ApiConfigurationParams } from './api-configuration';
import { TournamentService } from './services/tournament.service';
import { ParticipantService } from './services/participant.service';
import { MatchService } from './services/match.service';
/**
* Module that provides all services and configuration.
*/
@NgModule({
imports: [],
exports: [],
declarations: [],
providers: [
TournamentService,
ParticipantService,
MatchService,
ApiConfiguration
],
})
export class ApiModule {
static forRoot(params: ApiConfigurationParams): ModuleWithProviders<ApiModule> {
return {
ngModule: ApiModule,
providers: [
{
provide: ApiConfiguration,
useValue: params
}
]
}
}
constructor(
@Optional() @SkipSelf() parentModule: ApiModule,
@Optional() http: HttpClient
) {
if (parentModule) {
throw new Error('ApiModule is already loaded. Import in your base AppModule only.');
}
if (!http) {
throw new Error('You need to import the HttpClientModule in your AppModule! \n' +
'See also https://github.com/angular/angular/issues/20575');
}
}
}
/* tslint:disable */
/* eslint-disable */
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ApiConfiguration } from './api-configuration';
/**
* Base class for services
*/
@Injectable()
export class BaseService {
constructor(
protected config: ApiConfiguration,
protected http: HttpClient
) {
}
private _rootUrl: string = '';
/**
* Returns the root url for all operations in this service. If not set directly in this
* service, will fallback to `ApiConfiguration.rootUrl`.
*/
get rootUrl(): string {
return this._rootUrl || this.config.rootUrl;
}
/**
* Sets the root URL for API operations in this service.
*/
set rootUrl(rootUrl: string) {
this._rootUrl = rootUrl;
}
}
export { RuleSettingsPartial } from './models/rule-settings-partial';
export { CreateTournamentDto } from './models/create-tournament-dto';
export { Match } from './models/match';
export { ParticipantScore } from './models/participant-score';
export { Participant } from './models/participant';
export { Tournament } from './models/tournament';
export { TournamentReturnMessageDto } from './models/tournament-return-message-dto';
export { TournamentPaginatedReturnMessageDto } from './models/tournament-paginated-return-message-dto';
export { UpdateTournamentDto } from './models/update-tournament-dto';
export { BlankReturnMessageDto } from './models/blank-return-message-dto';
export { CreateParticipantDto } from './models/create-participant-dto';
export { ParticipantReturnMessageDto } from './models/participant-return-message-dto';
export { ParticipantPaginatedReturnMessageDto } from './models/participant-paginated-return-message-dto';
export { UpdateParticipantDto } from './models/update-participant-dto';
export { CreateParticipantDtoImportData } from './models/create-participant-dto-import-data';
export { ParticipantImportEntry } from './models/participant-import-entry';
export { ParticipantImportEntryReturnMessageDto } from './models/participant-import-entry-return-message-dto';
export { MatchReturnMessageDto } from './models/match-return-message-dto';
export { MatchPaginatedReturnMessageDto } from './models/match-paginated-return-message-dto';
export { UpdateMatchDto } from './models/update-match-dto';
/* tslint:disable */
/* eslint-disable */
export interface BlankReturnMessageDto {
/**
* Return message
*/
message: string;
/**
* Return code
*/
statusCode: number;
/**
* Whether success.
*/
success: boolean;
}
/* tslint:disable */
/* eslint-disable */
import { CreateParticipantDto } from './create-participant-dto';
export interface CreateParticipantDtoImportData {
/**
* Import data
*/
data: Array<CreateParticipantDto>;
}
/* tslint:disable */
/* eslint-disable */
export interface CreateParticipantDto {
/**
* 名称
*/
name: string;
/**
* 是否已经退赛
*/
quit: boolean;
/**
* 比赛 ID。
*/
tournamentId: number;
}
/* tslint:disable */
/* eslint-disable */
import { RuleSettingsPartial } from './rule-settings-partial';
export interface CreateTournamentDto {
/**
* 协作者 MC ID
*/
collaborators?: Array<number>;
/**
* 描述
*/
description: string;
/**
* 名称
*/
name: string;
/**
* 规则
*/
rule: 'SingleElimination' | 'Swiss';
ruleSettings?: RuleSettingsPartial;
/**
* 可见性
*/
visibility: 'Public' | 'Internal' | 'Private';
}
/* tslint:disable */
/* eslint-disable */
import { Match } from './match';
export interface MatchPaginatedReturnMessageDto {
/**
* Return data.
*/
data?: Array<Match>;
/**
* Return message
*/
message: string;
/**
* Current page.
*/
pageCount: number;
/**
* Records per page.
*/
recordsPerPage: number;
/**
* Return code
*/
statusCode: number;
/**
* Whether success.
*/
success: boolean;
/**
* Total record count.
*/
total: number;
/**
* Total page count.
*/
totalPages: number;
}
/* tslint:disable */
/* eslint-disable */
import { Match } from './match';
export interface MatchReturnMessageDto {
/**
* Return data.
*/
data?: Match;
/**
* Return message
*/
message: string;
/**
* Return code
*/
statusCode: number;
/**
* Whether success.
*/
success: boolean;
}
/* tslint:disable */
/* eslint-disable */
import { Participant } from './participant';
import { Tournament } from './tournament';
export interface Match {
childMatch: Match;
/**
* 晋级通往的比赛 ID
*/
childMatchId?: number;
createTime: string;
deleteTime: string;
id: number;
/**
* 是否为季军赛。
*/
isThirdPlaceMatch: boolean;
/**
* The nth page, starting with 1.
*/
pageCount?: number;
parentMatches: Array<Match>;
player1: Participant;
/**
* 玩家 1 ID
*/
player1Id: number;
/**
* 玩家 1 分数
*/
player1Score?: number;
player2: Participant;
/**
* 玩家 2 ID
*/
player2Id: number;
/**
* 玩家 2 分数
*/
player2Score?: number;
/**
* Records per page.
*/
recordsPerPage?: number;
/**
* 比赛轮次。
*/
round: number;
/**
* 比赛状态
*/
status: 'Pending' | 'Running' | 'Finished' | 'Abandoned';
tournament: Tournament;
/**
* 比赛 ID。
*/
tournamentId: number;
updateTime: string;
winner: Participant;
/**
* 胜者 ID
*/
winnerId: number;
}
/* tslint:disable */
/* eslint-disable */
import { ParticipantImportEntry } from './participant-import-entry';
export interface ParticipantImportEntryReturnMessageDto {
/**
* Return data.
*/
data?: ParticipantImportEntry;
/**
* Return message
*/
message: string;
/**
* Return code
*/
statusCode: number;
/**
* Whether success.
*/
success: boolean;
}
/* tslint:disable */
/* eslint-disable */
import { Participant } from './participant';
export interface ParticipantImportEntry {
/**
* Import entry
*/
entry: Participant;
/**
* Import result
*/
result: string;
}
/* tslint:disable */
/* eslint-disable */
import { Participant } from './participant';
export interface ParticipantPaginatedReturnMessageDto {
/**
* Return data.
*/
data?: Array<Participant>;
/**
* Return message
*/
message: string;
/**
* Current page.
*/
pageCount: number;
/**
* Records per page.
*/
recordsPerPage: number;
/**
* Return code
*/
statusCode: number;
/**
* Whether success.
*/
success: boolean;
/**
* Total record count.
*/
total: number;
/**
* Total page count.
*/
totalPages: number;
}
/* tslint:disable */
/* eslint-disable */
import { Participant } from './participant';
export interface ParticipantReturnMessageDto {
/**
* Return data.
*/
data?: Participant;
/**
* Return message
*/
message: string;
/**
* Return code
*/
statusCode: number;
/**
* Whether success.
*/
success: boolean;
}
/* tslint:disable */
/* eslint-disable */
export interface ParticipantScore {
/**
* 轮空
*/
bye: number;
/**
* 平场
*/
draw: number;
/**
* 负场
*/
lose: number;
/**
* 排名
*/
rank: number;
/**
* 得分
*/
score: number;
/**
* 平局分
*/
tieBreaker: number;
/**
* 胜场
*/
win: number;
}
/* tslint:disable */
/* eslint-disable */
import { Match } from './match';
import { ParticipantScore } from './participant-score';
import { Tournament } from './tournament';
export interface Participant {
createTime: string;
deleteTime: string;
id: number;
/**
* 参与的比赛。
*/
matches: Array<Match>;
matches1: Array<Match>;
matches2: Array<Match>;
/**
* 名称
*/
name: string;
/**
* The nth page, starting with 1.
*/
pageCount?: number;
/**
* 是否已经退赛
*/
quit: boolean;
/**
* Records per page.
*/
recordsPerPage?: number;
score: ParticipantScore;
tournament: Tournament;
/**
* 比赛 ID。
*/
tournamentId: number;
updateTime: string;
wonMatches: Array<Match>;
}
/* tslint:disable */
/* eslint-disable */
export interface RuleSettingsPartial {
/**
* 瑞士轮轮空分。
*/
byeScore?: number;
/**
* 瑞士轮平局分。
*/
drawScore?: number;
/**
* 淘汰赛中是否是季军塞
*/
hasThirdPlaceMatch?: boolean;
/**
* 瑞士轮局数。
*/
rounds?: number;
/**
* 瑞士轮胜利分。
*/
winScore?: number;
}
/* tslint:disable */
/* eslint-disable */
import { Tournament } from './tournament';
export interface TournamentPaginatedReturnMessageDto {
/**
* Return data.
*/
data?: Array<Tournament>;
/**
* Return message
*/
message: string;
/**
* Current page.
*/
pageCount: number;
/**
* Records per page.
*/
recordsPerPage: number;
/**
* Return code
*/
statusCode: number;
/**
* Whether success.
*/
success: boolean;
/**
* Total record count.
*/
total: number;
/**
* Total page count.
*/
totalPages: number;
}
/* tslint:disable */
/* eslint-disable */
import { Tournament } from './tournament';
export interface TournamentReturnMessageDto {
/**
* Return data.
*/
data?: Tournament;
/**
* Return message
*/
message: string;
/**
* Return code
*/
statusCode: number;
/**
* Whether success.
*/
success: boolean;
}
/* tslint:disable */
/* eslint-disable */
import { Match } from './match';
import { Participant } from './participant';
import { RuleSettingsPartial } from './rule-settings-partial';
export interface Tournament {
/**
* 协作者 MC ID
*/
collaborators?: Array<number>;
createTime: string;
/**
* 创建时间
*/
createdAt: string;
/**
* 创建者 MC ID
*/
creator: number;
deleteTime: string;
/**
* 描述
*/
description: string;
id: number;
/**
* 对阵图树
*/
matchTree: Match;
matches: Array<Match>;
/**
* 名称
*/
name: string;
/**
* The nth page, starting with 1.
*/
pageCount?: number;
participants: Array<Participant>;
/**
* Records per page.
*/
recordsPerPage?: number;
/**
* 规则
*/
rule: 'SingleElimination' | 'Swiss';
ruleSettings?: RuleSettingsPartial;
/**
* 状态
*/
status: 'Ready' | 'Running' | 'Finished';
updateTime: string;
/**
* 可见性
*/
visibility: 'Public' | 'Internal' | 'Private';
}
/* tslint:disable */
/* eslint-disable */
export interface UpdateMatchDto {
/**
* 玩家 1 分数
*/
player1Score?: number;
/**
* 玩家 2 分数
*/
player2Score?: number;
/**
* 胜者 ID
*/
winnerId?: number;
}
/* tslint:disable */
/* eslint-disable */
export interface UpdateParticipantDto {
/**
* 名称
*/
name?: string;
/**
* 是否已经退赛
*/
quit?: boolean;
}
/* tslint:disable */
/* eslint-disable */
export interface UpdateTournamentDto {
/**
* 协作者 MC ID
*/
collaborators?: Array<number>;
/**
* 描述
*/
description?: string;
/**
* 名称
*/
name?: string;
/**
* 可见性
*/
visibility?: 'Public' | 'Internal' | 'Private';
}
/* tslint:disable */
/* eslint-disable */
import { HttpRequest, HttpParameterCodec, HttpParams, HttpHeaders, HttpContext } from '@angular/common/http';
/**
* Custom parameter codec to correctly handle the plus sign in parameter
* values. See https://github.com/angular/angular/issues/18261
*/
class ParameterCodec implements HttpParameterCodec {
encodeKey(key: string): string {
return encodeURIComponent(key);
}
encodeValue(value: string): string {
return encodeURIComponent(value);
}
decodeKey(key: string): string {
return decodeURIComponent(key);
}
decodeValue(value: string): string {
return decodeURIComponent(value);
}
}
const ParameterCodecInstance = new ParameterCodec();
/**
* Defines the options for appending a parameter
*/
interface ParameterOptions {
style?: string;
explode?: boolean;
}
/**
* Base class for a parameter
*/
abstract class Parameter {
constructor(public name: string, public value: any, public options: ParameterOptions, defaultStyle: string, defaultExplode: boolean) {
this.options = options || {};
if (this.options.style === null || this.options.style === undefined) {
this.options.style = defaultStyle;
}
if (this.options.explode === null || this.options.explode === undefined) {
this.options.explode = defaultExplode;
}
}
serializeValue(value: any, separator = ','): string {
if (value === null || value === undefined) {
return '';
} else if (value instanceof Array) {
return value.map(v => this.serializeValue(v).split(separator).join(encodeURIComponent(separator))).join(separator);
} else if (typeof value === 'object') {
const array: string[] = [];
for (const key of Object.keys(value)) {
let propVal = value[key];
if (propVal !== null && propVal !== undefined) {
propVal = this.serializeValue(propVal).split(separator).join(encodeURIComponent(separator));
if (this.options.explode) {
array.push(`${key}=${propVal}`);
} else {
array.push(key);
array.push(propVal);
}
}
}
return array.join(separator);
} else {
return String(value);
}
}
}
/**
* A parameter in the operation path
*/
class PathParameter extends Parameter {
constructor(name: string, value: any, options: ParameterOptions) {
super(name, value, options, 'simple', false);
}
append(path: string): string {
let value = this.value;
if (value === null || value === undefined) {
value = '';
}
let prefix = this.options.style === 'label' ? '.' : '';
let separator = this.options.explode ? prefix === '' ? ',' : prefix : ',';
let alreadySerialized = false;
if (this.options.style === 'matrix') {
// The parameter name is just used as prefix, except in some cases...
prefix = `;${this.name}=`;
if (this.options.explode && typeof value === 'object') {
prefix = ';';
if (value instanceof Array) {
// For arrays we have to repeat the name for each element
value = value.map(v => `${this.name}=${this.serializeValue(v, ';')}`);
value = value.join(';');
alreadySerialized = true;
} else {
// For objects we have to put each the key / value pairs
value = this.serializeValue(value, ';');
alreadySerialized = true
}
}
}
value = prefix + (alreadySerialized ? value : this.serializeValue(value, separator));
// Replace both the plain variable and the corresponding variant taking in the prefix and explode into account
path = path.replace(`{${this.name}}`, value);
path = path.replace(`{${prefix}${this.name}${this.options.explode ? '*' : ''}}`, value);
return path;
}
// @ts-ignore
serializeValue(value: any, separator = ','): string {
var result = typeof value === 'string' ? encodeURIComponent(value) : super.serializeValue(value, separator);
result = result.replace(/%3D/g, '=');
result = result.replace(/%3B/g, ';');
result = result.replace(/%2C/g, ',');
return result;
}
}
/**
* A parameter in the query
*/
class QueryParameter extends Parameter {
constructor(name: string, value: any, options: ParameterOptions) {
super(name, value, options, 'form', true);
}
append(params: HttpParams): HttpParams {
if (this.value instanceof Array) {
// Array serialization
if (this.options.explode) {
for (const v of this.value) {
params = params.append(this.name, this.serializeValue(v));
}
} else {
const separator = this.options.style === 'spaceDelimited'
? ' ' : this.options.style === 'pipeDelimited'
? '|' : ',';
return params.append(this.name, this.serializeValue(this.value, separator));
}
} else if (this.value !== null && typeof this.value === 'object') {
// Object serialization
if (this.options.style === 'deepObject') {
// Append a parameter for each key, in the form `name[key]`
for (const key of Object.keys(this.value)) {
const propVal = this.value[key];
if (propVal !== null && propVal !== undefined) {
params = params.append(`${this.name}[${key}]`, this.serializeValue(propVal));
}
}
} else if (this.options.explode) {
// Append a parameter for each key without using the parameter name
for (const key of Object.keys(this.value)) {
const propVal = this.value[key];
if (propVal !== null && propVal !== undefined) {
params = params.append(key, this.serializeValue(propVal));
}
}
} else {
// Append a single parameter whose values are a comma-separated list of key,value,key,value...
const array: any[] = [];
for (const key of Object.keys(this.value)) {
const propVal = this.value[key];
if (propVal !== null && propVal !== undefined) {
array.push(key);
array.push(propVal);
}
}
params = params.append(this.name, this.serializeValue(array));
}
} else if (this.value !== null && this.value !== undefined) {
// Plain value
params = params.append(this.name, this.serializeValue(this.value));
}
return params;
}
}
/**
* A parameter in the HTTP request header
*/
class HeaderParameter extends Parameter {
constructor(name: string, value: any, options: ParameterOptions) {
super(name, value, options, 'simple', false);
}
append(headers: HttpHeaders): HttpHeaders {
if (this.value !== null && this.value !== undefined) {
if (this.value instanceof Array) {
for (const v of this.value) {
headers = headers.append(this.name, this.serializeValue(v));
}
} else {
headers = headers.append(this.name, this.serializeValue(this.value));
}
}
return headers;
}
}
/**
* Helper to build http requests from parameters
*/
export class RequestBuilder {
private _path = new Map<string, PathParameter>();
private _query = new Map<string, QueryParameter>();
private _header = new Map<string, HeaderParameter>();
_bodyContent: any | null;
_bodyContentType?: string;
constructor(
public rootUrl: string,
public operationPath: string,
public method: string) {
}
/**
* Sets a path parameter
*/
path(name: string, value: any, options?: ParameterOptions): void {
this._path.set(name, new PathParameter(name, value, options || {}));
}
/**
* Sets a query parameter
*/
query(name: string, value: any, options?: ParameterOptions): void {
this._query.set(name, new QueryParameter(name, value, options || {}));
}
/**
* Sets a header parameter
*/
header(name: string, value: any, options?: ParameterOptions): void {
this._header.set(name, new HeaderParameter(name, value, options || {}));
}
/**
* Sets the body content, along with the content type
*/
body(value: any, contentType = 'application/json'): void {
if (value instanceof Blob) {
this._bodyContentType = value.type;
} else {
this._bodyContentType = contentType;
}
if (this._bodyContentType === 'application/x-www-form-urlencoded' && value !== null && typeof value === 'object') {
// Handle URL-encoded data
const pairs: Array<[string, string]> = [];
for (const key of Object.keys(value)) {
let val = value[key];
if (!(val instanceof Array)) {
val = [val];
}
for (const v of val) {
const formValue = this.formDataValue(v);
if (formValue !== null) {
pairs.push([key, formValue]);
}
}
}
this._bodyContent = pairs.map(p => `${encodeURIComponent(p[0])}=${encodeURIComponent(p[1])}`).join('&');
} else if (this._bodyContentType === 'multipart/form-data') {
// Handle multipart form data
const formData = new FormData();
if (value !== null && value !== undefined) {
for (const key of Object.keys(value)) {
const val = value[key];
if (val instanceof Array) {
for (const v of val) {
const toAppend = this.formDataValue(v);
if (toAppend !== null) {
formData.append(key, toAppend);
}
}
} else {
const toAppend = this.formDataValue(val);
if (toAppend !== null) {
formData.set(key, toAppend);
}
}
}
}
this._bodyContent = formData;
} else {
// The body is the plain content
this._bodyContent = value;
}
}
private formDataValue(value: any): any {
if (value === null || value === undefined) {
return null;
}
if (value instanceof Blob) {
return value;
}
if (typeof value === 'object') {
return JSON.stringify(value);
}
return String(value);
}
/**
* Builds the request with the current set parameters
*/
build<T = any>(options?: {
/** Which content types to accept */
accept?: string;
/** The expected response type */
responseType?: 'json' | 'text' | 'blob' | 'arraybuffer';
/** Whether to report progress on uploads / downloads */
reportProgress?: boolean;
/** Allow passing HttpContext for HttpClient */
context?: HttpContext;
}): HttpRequest<T> {
options = options || {};
// Path parameters
let path = this.operationPath;
for (const pathParam of this._path.values()) {
path = pathParam.append(path);
}
const url = this.rootUrl + path;
// Query parameters
let httpParams = new HttpParams({
encoder: ParameterCodecInstance
});
for (const queryParam of this._query.values()) {
httpParams = queryParam.append(httpParams);
}
// Header parameters
let httpHeaders = new HttpHeaders();
if (options.accept) {
httpHeaders = httpHeaders.append('Accept', options.accept);
}
for (const headerParam of this._header.values()) {
httpHeaders = headerParam.append(httpHeaders);
}
// Request content headers
if (this._bodyContentType && !(this._bodyContent instanceof FormData)) {
httpHeaders = httpHeaders.set('Content-Type', this._bodyContentType);
}
// Perform the request
return new HttpRequest<T>(this.method.toUpperCase(), url, this._bodyContent, {
params: httpParams,
headers: httpHeaders,
responseType: options.responseType,
reportProgress: options.reportProgress,
context: options.context
});
}
}
export { TournamentService } from './services/tournament.service';
export { ParticipantService } from './services/participant.service';
export { MatchService } from './services/match.service';
/* tslint:disable */
/* eslint-disable */
import { Injectable } from '@angular/core';
import { HttpClient, HttpResponse, HttpContext } from '@angular/common/http';
import { BaseService } from '../base-service';
import { ApiConfiguration } from '../api-configuration';
import { StrictHttpResponse } from '../strict-http-response';
import { RequestBuilder } from '../request-builder';
import { Observable } from 'rxjs';
import { map, filter } from 'rxjs/operators';
import { BlankReturnMessageDto } from '../models/blank-return-message-dto';
import { MatchPaginatedReturnMessageDto } from '../models/match-paginated-return-message-dto';
import { MatchReturnMessageDto } from '../models/match-return-message-dto';
import { UpdateMatchDto } from '../models/update-match-dto';
@Injectable({
providedIn: 'root',
})
export class MatchService extends BaseService {
constructor(
config: ApiConfiguration,
http: HttpClient
) {
super(config, http);
}
/**
* Path part for operation matchControllerFindOne
*/
static readonly MatchControllerFindOnePath = '/api/match/{id}';
/**
* Find a Match by id.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `matchControllerFindOne()` instead.
*
* This method doesn't expect any request body.
*/
matchControllerFindOne$Response(params: {
/**
* MC Token
*/
Authorization?: string;
id: number;
context?: HttpContext
}
): Observable<StrictHttpResponse<MatchReturnMessageDto>> {
const rb = new RequestBuilder(this.rootUrl, MatchService.MatchControllerFindOnePath, 'get');
if (params) {
rb.header('Authorization', params.Authorization, {});
rb.path('id', params.id, {});
}
return this.http.request(rb.build({
responseType: 'json',
accept: 'application/json',
context: params?.context
})).pipe(
filter((r: any) => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<MatchReturnMessageDto>;
})
);
}
/**
* Find a Match by id.
*
*
*
* This method provides access to only to the response body.
* To access the full response (for headers, for example), `matchControllerFindOne$Response()` instead.
*
* This method doesn't expect any request body.
*/
matchControllerFindOne(params: {
/**
* MC Token
*/
Authorization?: string;
id: number;
context?: HttpContext
}
): Observable<MatchReturnMessageDto> {
return this.matchControllerFindOne$Response(params).pipe(
map((r: StrictHttpResponse<MatchReturnMessageDto>) => r.body as MatchReturnMessageDto)
);
}
/**
* Path part for operation matchControllerUpdate
*/
static readonly MatchControllerUpdatePath = '/api/match/{id}';
/**
* Update a Match by id.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `matchControllerUpdate()` instead.
*
* This method sends `application/json` and handles request body of type `application/json`.
*/
matchControllerUpdate$Response(params: {
/**
* MC Token
*/
Authorization?: string;
id: number;
context?: HttpContext
body: UpdateMatchDto
}
): Observable<StrictHttpResponse<BlankReturnMessageDto>> {
const rb = new RequestBuilder(this.rootUrl, MatchService.MatchControllerUpdatePath, 'patch');
if (params) {
rb.header('Authorization', params.Authorization, {});
rb.path('id', params.id, {});
rb.body(params.body, 'application/json');
}
return this.http.request(rb.build({
responseType: 'json',
accept: 'application/json',
context: params?.context
})).pipe(
filter((r: any) => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<BlankReturnMessageDto>;
})
);
}
/**
* Update a Match by id.
*
*
*
* This method provides access to only to the response body.
* To access the full response (for headers, for example), `matchControllerUpdate$Response()` instead.
*
* This method sends `application/json` and handles request body of type `application/json`.
*/
matchControllerUpdate(params: {
/**
* MC Token
*/
Authorization?: string;
id: number;
context?: HttpContext
body: UpdateMatchDto
}
): Observable<BlankReturnMessageDto> {
return this.matchControllerUpdate$Response(params).pipe(
map((r: StrictHttpResponse<BlankReturnMessageDto>) => r.body as BlankReturnMessageDto)
);
}
/**
* Path part for operation matchControllerFindAll
*/
static readonly MatchControllerFindAllPath = '/api/match';
/**
* Find all Match.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `matchControllerFindAll()` instead.
*
* This method doesn't expect any request body.
*/
matchControllerFindAll$Response(params?: {
/**
* MC Token
*/
Authorization?: string;
/**
* The nth page, starting with 1.
*/
pageCount?: number;
/**
* Records per page.
*/
recordsPerPage?: number;
id?: number;
/**
* 比赛 ID。
*/
tournamentId?: number;
/**
* 比赛轮次。
*/
round?: number;
/**
* 是否为季军赛。
*/
isThirdPlaceMatch?: boolean;
/**
* 比赛状态
*/
status?: 'Pending' | 'Running' | 'Finished' | 'Abandoned';
/**
* 玩家 1 ID
*/
player1Id?: number;
/**
* 玩家 1 分数
*/
player1Score?: number;
/**
* 玩家 2 ID
*/
player2Id?: number;
/**
* 玩家 2 分数
*/
player2Score?: number;
/**
* 胜者 ID
*/
winnerId?: number;
/**
* 晋级通往的比赛 ID
*/
childMatchId?: number;
context?: HttpContext
}
): Observable<StrictHttpResponse<MatchPaginatedReturnMessageDto>> {
const rb = new RequestBuilder(this.rootUrl, MatchService.MatchControllerFindAllPath, 'get');
if (params) {
rb.header('Authorization', params.Authorization, {});
rb.query('pageCount', params.pageCount, {});
rb.query('recordsPerPage', params.recordsPerPage, {});
rb.query('id', params.id, {});
rb.query('tournamentId', params.tournamentId, {});
rb.query('round', params.round, {});
rb.query('isThirdPlaceMatch', params.isThirdPlaceMatch, {});
rb.query('status', params.status, {});
rb.query('player1Id', params.player1Id, {});
rb.query('player1Score', params.player1Score, {});
rb.query('player2Id', params.player2Id, {});
rb.query('player2Score', params.player2Score, {});
rb.query('winnerId', params.winnerId, {});
rb.query('childMatchId', params.childMatchId, {});
}
return this.http.request(rb.build({
responseType: 'json',
accept: 'application/json',
context: params?.context
})).pipe(
filter((r: any) => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<MatchPaginatedReturnMessageDto>;
})
);
}
/**
* Find all Match.
*
*
*
* This method provides access to only to the response body.
* To access the full response (for headers, for example), `matchControllerFindAll$Response()` instead.
*
* This method doesn't expect any request body.
*/
matchControllerFindAll(params?: {
/**
* MC Token
*/
Authorization?: string;
/**
* The nth page, starting with 1.
*/
pageCount?: number;
/**
* Records per page.
*/
recordsPerPage?: number;
id?: number;
/**
* 比赛 ID。
*/
tournamentId?: number;
/**
* 比赛轮次。
*/
round?: number;
/**
* 是否为季军赛。
*/
isThirdPlaceMatch?: boolean;
/**
* 比赛状态
*/
status?: 'Pending' | 'Running' | 'Finished' | 'Abandoned';
/**
* 玩家 1 ID
*/
player1Id?: number;
/**
* 玩家 1 分数
*/
player1Score?: number;
/**
* 玩家 2 ID
*/
player2Id?: number;
/**
* 玩家 2 分数
*/
player2Score?: number;
/**
* 胜者 ID
*/
winnerId?: number;
/**
* 晋级通往的比赛 ID
*/
childMatchId?: number;
context?: HttpContext
}
): Observable<MatchPaginatedReturnMessageDto> {
return this.matchControllerFindAll$Response(params).pipe(
map((r: StrictHttpResponse<MatchPaginatedReturnMessageDto>) => r.body as MatchPaginatedReturnMessageDto)
);
}
}
/* tslint:disable */
/* eslint-disable */
import { Injectable } from '@angular/core';
import { HttpClient, HttpResponse, HttpContext } from '@angular/common/http';
import { BaseService } from '../base-service';
import { ApiConfiguration } from '../api-configuration';
import { StrictHttpResponse } from '../strict-http-response';
import { RequestBuilder } from '../request-builder';
import { Observable } from 'rxjs';
import { map, filter } from 'rxjs/operators';
import { BlankReturnMessageDto } from '../models/blank-return-message-dto';
import { CreateParticipantDto } from '../models/create-participant-dto';
import { CreateParticipantDtoImportData } from '../models/create-participant-dto-import-data';
import { ParticipantPaginatedReturnMessageDto } from '../models/participant-paginated-return-message-dto';
import { ParticipantReturnMessageDto } from '../models/participant-return-message-dto';
import { UpdateParticipantDto } from '../models/update-participant-dto';
@Injectable({
providedIn: 'root',
})
export class ParticipantService extends BaseService {
constructor(
config: ApiConfiguration,
http: HttpClient
) {
super(config, http);
}
/**
* Path part for operation participantControllerFindAll
*/
static readonly ParticipantControllerFindAllPath = '/api/participant';
/**
* Find all Participant.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `participantControllerFindAll()` instead.
*
* This method doesn't expect any request body.
*/
participantControllerFindAll$Response(params?: {
/**
* MC Token
*/
Authorization?: string;
/**
* The nth page, starting with 1.
*/
pageCount?: number;
/**
* Records per page.
*/
recordsPerPage?: number;
id?: number;
/**
* 名称
*/
name?: string;
/**
* 是否已经退赛
*/
quit?: boolean;
/**
* 比赛 ID。
*/
tournamentId?: number;
context?: HttpContext
}
): Observable<StrictHttpResponse<ParticipantPaginatedReturnMessageDto>> {
const rb = new RequestBuilder(this.rootUrl, ParticipantService.ParticipantControllerFindAllPath, 'get');
if (params) {
rb.header('Authorization', params.Authorization, {});
rb.query('pageCount', params.pageCount, {});
rb.query('recordsPerPage', params.recordsPerPage, {});
rb.query('id', params.id, {});
rb.query('name', params.name, {});
rb.query('quit', params.quit, {});
rb.query('tournamentId', params.tournamentId, {});
}
return this.http.request(rb.build({
responseType: 'json',
accept: 'application/json',
context: params?.context
})).pipe(
filter((r: any) => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<ParticipantPaginatedReturnMessageDto>;
})
);
}
/**
* Find all Participant.
*
*
*
* This method provides access to only to the response body.
* To access the full response (for headers, for example), `participantControllerFindAll$Response()` instead.
*
* This method doesn't expect any request body.
*/
participantControllerFindAll(params?: {
/**
* MC Token
*/
Authorization?: string;
/**
* The nth page, starting with 1.
*/
pageCount?: number;
/**
* Records per page.
*/
recordsPerPage?: number;
id?: number;
/**
* 名称
*/
name?: string;
/**
* 是否已经退赛
*/
quit?: boolean;
/**
* 比赛 ID。
*/
tournamentId?: number;
context?: HttpContext
}
): Observable<ParticipantPaginatedReturnMessageDto> {
return this.participantControllerFindAll$Response(params).pipe(
map((r: StrictHttpResponse<ParticipantPaginatedReturnMessageDto>) => r.body as ParticipantPaginatedReturnMessageDto)
);
}
/**
* Path part for operation participantControllerCreate
*/
static readonly ParticipantControllerCreatePath = '/api/participant';
/**
* Create a new Participant.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `participantControllerCreate()` instead.
*
* This method sends `application/json` and handles request body of type `application/json`.
*/
participantControllerCreate$Response(params: {
/**
* MC Token
*/
Authorization?: string;
context?: HttpContext
body: CreateParticipantDto
}
): Observable<StrictHttpResponse<{
}>> {
const rb = new RequestBuilder(this.rootUrl, ParticipantService.ParticipantControllerCreatePath, 'post');
if (params) {
rb.header('Authorization', params.Authorization, {});
rb.body(params.body, 'application/json');
}
return this.http.request(rb.build({
responseType: 'json',
accept: 'application/json',
context: params?.context
})).pipe(
filter((r: any) => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<{
}>;
})
);
}
/**
* Create a new Participant.
*
*
*
* This method provides access to only to the response body.
* To access the full response (for headers, for example), `participantControllerCreate$Response()` instead.
*
* This method sends `application/json` and handles request body of type `application/json`.
*/
participantControllerCreate(params: {
/**
* MC Token
*/
Authorization?: string;
context?: HttpContext
body: CreateParticipantDto
}
): Observable<{
}> {
return this.participantControllerCreate$Response(params).pipe(
map((r: StrictHttpResponse<{
}>) => r.body as {
})
);
}
/**
* Path part for operation participantControllerFindOne
*/
static readonly ParticipantControllerFindOnePath = '/api/participant/{id}';
/**
* Find a Participant by id.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `participantControllerFindOne()` instead.
*
* This method doesn't expect any request body.
*/
participantControllerFindOne$Response(params: {
/**
* MC Token
*/
Authorization?: string;
id: number;
context?: HttpContext
}
): Observable<StrictHttpResponse<ParticipantReturnMessageDto>> {
const rb = new RequestBuilder(this.rootUrl, ParticipantService.ParticipantControllerFindOnePath, 'get');
if (params) {
rb.header('Authorization', params.Authorization, {});
rb.path('id', params.id, {});
}
return this.http.request(rb.build({
responseType: 'json',
accept: 'application/json',
context: params?.context
})).pipe(
filter((r: any) => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<ParticipantReturnMessageDto>;
})
);
}
/**
* Find a Participant by id.
*
*
*
* This method provides access to only to the response body.
* To access the full response (for headers, for example), `participantControllerFindOne$Response()` instead.
*
* This method doesn't expect any request body.
*/
participantControllerFindOne(params: {
/**
* MC Token
*/
Authorization?: string;
id: number;
context?: HttpContext
}
): Observable<ParticipantReturnMessageDto> {
return this.participantControllerFindOne$Response(params).pipe(
map((r: StrictHttpResponse<ParticipantReturnMessageDto>) => r.body as ParticipantReturnMessageDto)
);
}
/**
* Path part for operation participantControllerDelete
*/
static readonly ParticipantControllerDeletePath = '/api/participant/{id}';
/**
* Delete a Participant by id.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `participantControllerDelete()` instead.
*
* This method doesn't expect any request body.
*/
participantControllerDelete$Response(params: {
/**
* MC Token
*/
Authorization?: string;
id: number;
context?: HttpContext
}
): Observable<StrictHttpResponse<void>> {
const rb = new RequestBuilder(this.rootUrl, ParticipantService.ParticipantControllerDeletePath, 'delete');
if (params) {
rb.header('Authorization', params.Authorization, {});
rb.path('id', params.id, {});
}
return this.http.request(rb.build({
responseType: 'text',
accept: '*/*',
context: params?.context
})).pipe(
filter((r: any) => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return (r as HttpResponse<any>).clone({ body: undefined }) as StrictHttpResponse<void>;
})
);
}
/**
* Delete a Participant by id.
*
*
*
* This method provides access to only to the response body.
* To access the full response (for headers, for example), `participantControllerDelete$Response()` instead.
*
* This method doesn't expect any request body.
*/
participantControllerDelete(params: {
/**
* MC Token
*/
Authorization?: string;
id: number;
context?: HttpContext
}
): Observable<void> {
return this.participantControllerDelete$Response(params).pipe(
map((r: StrictHttpResponse<void>) => r.body as void)
);
}
/**
* Path part for operation participantControllerUpdate
*/
static readonly ParticipantControllerUpdatePath = '/api/participant/{id}';
/**
* Update a Participant by id.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `participantControllerUpdate()` instead.
*
* This method sends `application/json` and handles request body of type `application/json`.
*/
participantControllerUpdate$Response(params: {
/**
* MC Token
*/
Authorization?: string;
id: number;
context?: HttpContext
body: UpdateParticipantDto
}
): Observable<StrictHttpResponse<BlankReturnMessageDto>> {
const rb = new RequestBuilder(this.rootUrl, ParticipantService.ParticipantControllerUpdatePath, 'patch');
if (params) {
rb.header('Authorization', params.Authorization, {});
rb.path('id', params.id, {});
rb.body(params.body, 'application/json');
}
return this.http.request(rb.build({
responseType: 'json',
accept: 'application/json',
context: params?.context
})).pipe(
filter((r: any) => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<BlankReturnMessageDto>;
})
);
}
/**
* Update a Participant by id.
*
*
*
* This method provides access to only to the response body.
* To access the full response (for headers, for example), `participantControllerUpdate$Response()` instead.
*
* This method sends `application/json` and handles request body of type `application/json`.
*/
participantControllerUpdate(params: {
/**
* MC Token
*/
Authorization?: string;
id: number;
context?: HttpContext
body: UpdateParticipantDto
}
): Observable<BlankReturnMessageDto> {
return this.participantControllerUpdate$Response(params).pipe(
map((r: StrictHttpResponse<BlankReturnMessageDto>) => r.body as BlankReturnMessageDto)
);
}
/**
* Path part for operation participantControllerImport
*/
static readonly ParticipantControllerImportPath = '/api/participant/import';
/**
* Import Participant.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `participantControllerImport()` instead.
*
* This method sends `application/json` and handles request body of type `application/json`.
*/
participantControllerImport$Response(params: {
/**
* MC Token
*/
Authorization?: string;
context?: HttpContext
body: CreateParticipantDtoImportData
}
): Observable<StrictHttpResponse<{
}>> {
const rb = new RequestBuilder(this.rootUrl, ParticipantService.ParticipantControllerImportPath, 'post');
if (params) {
rb.header('Authorization', params.Authorization, {});
rb.body(params.body, 'application/json');
}
return this.http.request(rb.build({
responseType: 'json',
accept: 'application/json',
context: params?.context
})).pipe(
filter((r: any) => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<{
}>;
})
);
}
/**
* Import Participant.
*
*
*
* This method provides access to only to the response body.
* To access the full response (for headers, for example), `participantControllerImport$Response()` instead.
*
* This method sends `application/json` and handles request body of type `application/json`.
*/
participantControllerImport(params: {
/**
* MC Token
*/
Authorization?: string;
context?: HttpContext
body: CreateParticipantDtoImportData
}
): Observable<{
}> {
return this.participantControllerImport$Response(params).pipe(
map((r: StrictHttpResponse<{
}>) => r.body as {
})
);
}
}
/* tslint:disable */
/* eslint-disable */
import { Injectable } from '@angular/core';
import { HttpClient, HttpResponse, HttpContext } from '@angular/common/http';
import { BaseService } from '../base-service';
import { ApiConfiguration } from '../api-configuration';
import { StrictHttpResponse } from '../strict-http-response';
import { RequestBuilder } from '../request-builder';
import { Observable } from 'rxjs';
import { map, filter } from 'rxjs/operators';
import { BlankReturnMessageDto } from '../models/blank-return-message-dto';
import { CreateTournamentDto } from '../models/create-tournament-dto';
import { TournamentPaginatedReturnMessageDto } from '../models/tournament-paginated-return-message-dto';
import { TournamentReturnMessageDto } from '../models/tournament-return-message-dto';
import { UpdateTournamentDto } from '../models/update-tournament-dto';
@Injectable({
providedIn: 'root',
})
export class TournamentService extends BaseService {
constructor(
config: ApiConfiguration,
http: HttpClient
) {
super(config, http);
}
/**
* Path part for operation tournamentControllerFindAll
*/
static readonly TournamentControllerFindAllPath = '/api/tournament';
/**
* Find all Tournament.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `tournamentControllerFindAll()` instead.
*
* This method doesn't expect any request body.
*/
tournamentControllerFindAll$Response(params?: {
/**
* MC Token
*/
Authorization?: string;
/**
* The nth page, starting with 1.
*/
pageCount?: number;
/**
* Records per page.
*/
recordsPerPage?: number;
id?: number;
/**
* 名称
*/
name?: string;
/**
* 描述
*/
description?: string;
/**
* 规则
*/
rule?: 'SingleElimination' | 'Swiss';
/**
* 瑞士轮局数。
*/
rounds?: number;
/**
* 瑞士轮胜利分。
*/
winScore?: number;
/**
* 瑞士轮平局分。
*/
drawScore?: number;
/**
* 瑞士轮轮空分。
*/
byeScore?: number;
/**
* 淘汰赛中是否是季军塞
*/
hasThirdPlaceMatch?: boolean;
/**
* 可见性
*/
visibility?: 'Public' | 'Internal' | 'Private';
/**
* 状态
*/
status?: 'Ready' | 'Running' | 'Finished';
/**
* 创建者 MC ID
*/
creator?: number;
/**
* 协作者 MC ID
*/
collaborators?: Array<number>;
/**
* 创建时间
*/
createdAt?: string;
context?: HttpContext
}
): Observable<StrictHttpResponse<TournamentPaginatedReturnMessageDto>> {
const rb = new RequestBuilder(this.rootUrl, TournamentService.TournamentControllerFindAllPath, 'get');
if (params) {
rb.header('Authorization', params.Authorization, {});
rb.query('pageCount', params.pageCount, {});
rb.query('recordsPerPage', params.recordsPerPage, {});
rb.query('id', params.id, {});
rb.query('name', params.name, {});
rb.query('description', params.description, {});
rb.query('rule', params.rule, {});
rb.query('rounds', params.rounds, {});
rb.query('winScore', params.winScore, {});
rb.query('drawScore', params.drawScore, {});
rb.query('byeScore', params.byeScore, {});
rb.query('hasThirdPlaceMatch', params.hasThirdPlaceMatch, {});
rb.query('visibility', params.visibility, {});
rb.query('status', params.status, {});
rb.query('creator', params.creator, {});
rb.query('collaborators', params.collaborators, {});
rb.query('createdAt', params.createdAt, {});
}
return this.http.request(rb.build({
responseType: 'json',
accept: 'application/json',
context: params?.context
})).pipe(
filter((r: any) => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<TournamentPaginatedReturnMessageDto>;
})
);
}
/**
* Find all Tournament.
*
*
*
* This method provides access to only to the response body.
* To access the full response (for headers, for example), `tournamentControllerFindAll$Response()` instead.
*
* This method doesn't expect any request body.
*/
tournamentControllerFindAll(params?: {
/**
* MC Token
*/
Authorization?: string;
/**
* The nth page, starting with 1.
*/
pageCount?: number;
/**
* Records per page.
*/
recordsPerPage?: number;
id?: number;
/**
* 名称
*/
name?: string;
/**
* 描述
*/
description?: string;
/**
* 规则
*/
rule?: 'SingleElimination' | 'Swiss';
/**
* 瑞士轮局数。
*/
rounds?: number;
/**
* 瑞士轮胜利分。
*/
winScore?: number;
/**
* 瑞士轮平局分。
*/
drawScore?: number;
/**
* 瑞士轮轮空分。
*/
byeScore?: number;
/**
* 淘汰赛中是否是季军塞
*/
hasThirdPlaceMatch?: boolean;
/**
* 可见性
*/
visibility?: 'Public' | 'Internal' | 'Private';
/**
* 状态
*/
status?: 'Ready' | 'Running' | 'Finished';
/**
* 创建者 MC ID
*/
creator?: number;
/**
* 协作者 MC ID
*/
collaborators?: Array<number>;
/**
* 创建时间
*/
createdAt?: string;
context?: HttpContext
}
): Observable<TournamentPaginatedReturnMessageDto> {
return this.tournamentControllerFindAll$Response(params).pipe(
map((r: StrictHttpResponse<TournamentPaginatedReturnMessageDto>) => r.body as TournamentPaginatedReturnMessageDto)
);
}
/**
* Path part for operation tournamentControllerCreate
*/
static readonly TournamentControllerCreatePath = '/api/tournament';
/**
* Create a new Tournament.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `tournamentControllerCreate()` instead.
*
* This method sends `application/json` and handles request body of type `application/json`.
*/
tournamentControllerCreate$Response(params: {
/**
* MC Token
*/
Authorization?: string;
context?: HttpContext
body: CreateTournamentDto
}
): Observable<StrictHttpResponse<{
}>> {
const rb = new RequestBuilder(this.rootUrl, TournamentService.TournamentControllerCreatePath, 'post');
if (params) {
rb.header('Authorization', params.Authorization, {});
rb.body(params.body, 'application/json');
}
return this.http.request(rb.build({
responseType: 'json',
accept: 'application/json',
context: params?.context
})).pipe(
filter((r: any) => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<{
}>;
})
);
}
/**
* Create a new Tournament.
*
*
*
* This method provides access to only to the response body.
* To access the full response (for headers, for example), `tournamentControllerCreate$Response()` instead.
*
* This method sends `application/json` and handles request body of type `application/json`.
*/
tournamentControllerCreate(params: {
/**
* MC Token
*/
Authorization?: string;
context?: HttpContext
body: CreateTournamentDto
}
): Observable<{
}> {
return this.tournamentControllerCreate$Response(params).pipe(
map((r: StrictHttpResponse<{
}>) => r.body as {
})
);
}
/**
* Path part for operation tournamentControllerFindOne
*/
static readonly TournamentControllerFindOnePath = '/api/tournament/{id}';
/**
* Find a Tournament by id.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `tournamentControllerFindOne()` instead.
*
* This method doesn't expect any request body.
*/
tournamentControllerFindOne$Response(params: {
/**
* MC Token
*/
Authorization?: string;
id: number;
context?: HttpContext
}
): Observable<StrictHttpResponse<TournamentReturnMessageDto>> {
const rb = new RequestBuilder(this.rootUrl, TournamentService.TournamentControllerFindOnePath, 'get');
if (params) {
rb.header('Authorization', params.Authorization, {});
rb.path('id', params.id, {});
}
return this.http.request(rb.build({
responseType: 'json',
accept: 'application/json',
context: params?.context
})).pipe(
filter((r: any) => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<TournamentReturnMessageDto>;
})
);
}
/**
* Find a Tournament by id.
*
*
*
* This method provides access to only to the response body.
* To access the full response (for headers, for example), `tournamentControllerFindOne$Response()` instead.
*
* This method doesn't expect any request body.
*/
tournamentControllerFindOne(params: {
/**
* MC Token
*/
Authorization?: string;
id: number;
context?: HttpContext
}
): Observable<TournamentReturnMessageDto> {
return this.tournamentControllerFindOne$Response(params).pipe(
map((r: StrictHttpResponse<TournamentReturnMessageDto>) => r.body as TournamentReturnMessageDto)
);
}
/**
* Path part for operation tournamentControllerDelete
*/
static readonly TournamentControllerDeletePath = '/api/tournament/{id}';
/**
* Delete a Tournament by id.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `tournamentControllerDelete()` instead.
*
* This method doesn't expect any request body.
*/
tournamentControllerDelete$Response(params: {
/**
* MC Token
*/
Authorization?: string;
id: number;
context?: HttpContext
}
): Observable<StrictHttpResponse<void>> {
const rb = new RequestBuilder(this.rootUrl, TournamentService.TournamentControllerDeletePath, 'delete');
if (params) {
rb.header('Authorization', params.Authorization, {});
rb.path('id', params.id, {});
}
return this.http.request(rb.build({
responseType: 'text',
accept: '*/*',
context: params?.context
})).pipe(
filter((r: any) => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return (r as HttpResponse<any>).clone({ body: undefined }) as StrictHttpResponse<void>;
})
);
}
/**
* Delete a Tournament by id.
*
*
*
* This method provides access to only to the response body.
* To access the full response (for headers, for example), `tournamentControllerDelete$Response()` instead.
*
* This method doesn't expect any request body.
*/
tournamentControllerDelete(params: {
/**
* MC Token
*/
Authorization?: string;
id: number;
context?: HttpContext
}
): Observable<void> {
return this.tournamentControllerDelete$Response(params).pipe(
map((r: StrictHttpResponse<void>) => r.body as void)
);
}
/**
* Path part for operation tournamentControllerUpdate
*/
static readonly TournamentControllerUpdatePath = '/api/tournament/{id}';
/**
* Update a Tournament by id.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `tournamentControllerUpdate()` instead.
*
* This method sends `application/json` and handles request body of type `application/json`.
*/
tournamentControllerUpdate$Response(params: {
/**
* MC Token
*/
Authorization?: string;
id: number;
context?: HttpContext
body: UpdateTournamentDto
}
): Observable<StrictHttpResponse<BlankReturnMessageDto>> {
const rb = new RequestBuilder(this.rootUrl, TournamentService.TournamentControllerUpdatePath, 'patch');
if (params) {
rb.header('Authorization', params.Authorization, {});
rb.path('id', params.id, {});
rb.body(params.body, 'application/json');
}
return this.http.request(rb.build({
responseType: 'json',
accept: 'application/json',
context: params?.context
})).pipe(
filter((r: any) => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<BlankReturnMessageDto>;
})
);
}
/**
* Update a Tournament by id.
*
*
*
* This method provides access to only to the response body.
* To access the full response (for headers, for example), `tournamentControllerUpdate$Response()` instead.
*
* This method sends `application/json` and handles request body of type `application/json`.
*/
tournamentControllerUpdate(params: {
/**
* MC Token
*/
Authorization?: string;
id: number;
context?: HttpContext
body: UpdateTournamentDto
}
): Observable<BlankReturnMessageDto> {
return this.tournamentControllerUpdate$Response(params).pipe(
map((r: StrictHttpResponse<BlankReturnMessageDto>) => r.body as BlankReturnMessageDto)
);
}
/**
* Path part for operation tournamentControllerStart
*/
static readonly TournamentControllerStartPath = '/api/tournament/{id}/start';
/**
* Start a tournament.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `tournamentControllerStart()` instead.
*
* This method doesn't expect any request body.
*/
tournamentControllerStart$Response(params: {
/**
* MC Token
*/
Authorization?: string;
/**
* Tournament ID
*/
id: number;
context?: HttpContext
}
): Observable<StrictHttpResponse<BlankReturnMessageDto>> {
const rb = new RequestBuilder(this.rootUrl, TournamentService.TournamentControllerStartPath, 'post');
if (params) {
rb.header('Authorization', params.Authorization, {});
rb.path('id', params.id, {});
}
return this.http.request(rb.build({
responseType: 'json',
accept: 'application/json',
context: params?.context
})).pipe(
filter((r: any) => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<BlankReturnMessageDto>;
})
);
}
/**
* Start a tournament.
*
*
*
* This method provides access to only to the response body.
* To access the full response (for headers, for example), `tournamentControllerStart$Response()` instead.
*
* This method doesn't expect any request body.
*/
tournamentControllerStart(params: {
/**
* MC Token
*/
Authorization?: string;
/**
* Tournament ID
*/
id: number;
context?: HttpContext
}
): Observable<BlankReturnMessageDto> {
return this.tournamentControllerStart$Response(params).pipe(
map((r: StrictHttpResponse<BlankReturnMessageDto>) => r.body as BlankReturnMessageDto)
);
}
/**
* Path part for operation tournamentControllerReset
*/
static readonly TournamentControllerResetPath = '/api/tournament/{id}/reset';
/**
* Reset a tournament.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `tournamentControllerReset()` instead.
*
* This method doesn't expect any request body.
*/
tournamentControllerReset$Response(params: {
/**
* MC Token
*/
Authorization?: string;
/**
* Tournament ID
*/
id: number;
context?: HttpContext
}
): Observable<StrictHttpResponse<BlankReturnMessageDto>> {
const rb = new RequestBuilder(this.rootUrl, TournamentService.TournamentControllerResetPath, 'post');
if (params) {
rb.header('Authorization', params.Authorization, {});
rb.path('id', params.id, {});
}
return this.http.request(rb.build({
responseType: 'json',
accept: 'application/json',
context: params?.context
})).pipe(
filter((r: any) => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<BlankReturnMessageDto>;
})
);
}
/**
* Reset a tournament.
*
*
*
* This method provides access to only to the response body.
* To access the full response (for headers, for example), `tournamentControllerReset$Response()` instead.
*
* This method doesn't expect any request body.
*/
tournamentControllerReset(params: {
/**
* MC Token
*/
Authorization?: string;
/**
* Tournament ID
*/
id: number;
context?: HttpContext
}
): Observable<BlankReturnMessageDto> {
return this.tournamentControllerReset$Response(params).pipe(
map((r: StrictHttpResponse<BlankReturnMessageDto>) => r.body as BlankReturnMessageDto)
);
}
/**
* Path part for operation tournamentControllerFinish
*/
static readonly TournamentControllerFinishPath = '/api/tournament/{id}/finish';
/**
* Finish a tournament.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `tournamentControllerFinish()` instead.
*
* This method doesn't expect any request body.
*/
tournamentControllerFinish$Response(params: {
/**
* MC Token
*/
Authorization?: string;
/**
* Tournament ID
*/
id: number;
context?: HttpContext
}
): Observable<StrictHttpResponse<BlankReturnMessageDto>> {
const rb = new RequestBuilder(this.rootUrl, TournamentService.TournamentControllerFinishPath, 'post');
if (params) {
rb.header('Authorization', params.Authorization, {});
rb.path('id', params.id, {});
}
return this.http.request(rb.build({
responseType: 'json',
accept: 'application/json',
context: params?.context
})).pipe(
filter((r: any) => r instanceof HttpResponse),
map((r: HttpResponse<any>) => {
return r as StrictHttpResponse<BlankReturnMessageDto>;
})
);
}
/**
* Finish a tournament.
*
*
*
* This method provides access to only to the response body.
* To access the full response (for headers, for example), `tournamentControllerFinish$Response()` instead.
*
* This method doesn't expect any request body.
*/
tournamentControllerFinish(params: {
/**
* MC Token
*/
Authorization?: string;
/**
* Tournament ID
*/
id: number;
context?: HttpContext
}
): Observable<BlankReturnMessageDto> {
return this.tournamentControllerFinish$Response(params).pipe(
map((r: StrictHttpResponse<BlankReturnMessageDto>) => r.body as BlankReturnMessageDto)
);
}
}
/* tslint:disable */
/* eslint-disable */
import { HttpResponse } from '@angular/common/http';
/**
* Constrains the http response to not have the body defined as `T | null`, but `T` only.
*/
export type StrictHttpResponse<T> = HttpResponse<T> & {
readonly body: T;
}
...@@ -6,10 +6,19 @@ import { AppComponent } from './app.component'; ...@@ -6,10 +6,19 @@ import { AppComponent } from './app.component';
import { ToastComponent } from './toast/toast.component'; import { ToastComponent } from './toast/toast.component';
import { TournamentComponent } from './tournament/tournament.component'; import { TournamentComponent } from './tournament/tournament.component';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { ApiModule } from './api/api.module';
import { environment } from 'src/environments/environment';
@NgModule({ @NgModule({
declarations: [AppComponent, ToastComponent, TournamentComponent], declarations: [AppComponent, ToastComponent, TournamentComponent],
imports: [BrowserModule, AppRoutingModule, NgbModule], imports: [
BrowserModule,
AppRoutingModule,
NgbModule,
ApiModule.forRoot({
rootUrl: environment.production ? '' : 'http://localhost:3000',
}),
],
providers: [], providers: [],
bootstrap: [AppComponent], bootstrap: [AppComponent],
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment