Compare commits

...

86 Commits

Author SHA1 Message Date
Andy McKay cc3c3729d7 Merge pull request #11 from actions/dependabot/npm_and_yarn/acorn-5.7.4
Package and Smoke Test / Package (push) Has been cancelled
Package and Smoke Test / Smoke Test (push) Has been cancelled
Bump acorn from 5.7.3 to 5.7.4
2020-07-21 08:09:10 -07:00
Andy McKay faa02d25f4 Merge pull request #20 from actions/dependabot/npm_and_yarn/lodash-4.17.19
Bump lodash from 4.17.15 to 4.17.19
2020-07-21 08:09:00 -07:00
dependabot[bot] a973c4c3a5 Bump lodash from 4.17.15 to 4.17.19
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>
2020-07-19 17:57:30 +00:00
Trent Jones 84f259d626 Merge pull request #16 from ericsciple/users/ericsciple/m262ghes
Use @actions/github to invoke GraphQL for GHES compatibility
2020-05-15 12:29:19 -05:00
eric sciple f4a606f9ac Use @actions/github@2.2.0 to invoke GraphQL for GHES compatibility 2020-05-13 20:24:25 -04:00
dependabot[bot] a2a661c47c Bump acorn from 5.7.3 to 5.7.4
Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/5.7.3...5.7.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-04-05 23:22:05 +00:00
Trent Jones 9bf8ee6742 Merge pull request #3 from actions/releases/v1
added branding
2020-02-29 20:23:29 -06:00
Trent Jones 8c77cbb4f6 added branding 2020-02-29 20:05:38 -06:00
Trent Jones d5af907521 added branding 2020-02-29 20:05:28 -06:00
Trent Jones 2c9db061ca resolved merge conflict 2020-02-29 19:52:48 -06:00
Trent Jones 6194df3be9 test 2020-02-29 19:45:32 -06:00
Trent Jones e72c4f419a doc update 2020-02-29 19:26:07 -06:00
Trent Jones 6eb0ecceb6 docs 2020-02-29 19:03:48 -06:00
Trent Jones 7ea5df3c82 test 2020-02-29 19:02:08 -06:00
Trent Jones 4063f1efb4 test 2020-02-29 19:00:41 -06:00
Trent Jones e748b1abda test 2020-02-29 18:59:11 -06:00
Trent Jones 457f525ea5 test 2020-02-29 18:58:39 -06:00
Trent Jones fb974a4852 test 2020-02-29 18:56:02 -06:00
Trent Jones 9e57a99ae1 test 2020-02-29 18:54:31 -06:00
Trent Jones 16b2685969 test
t
2020-02-29 18:53:36 -06:00
Trent Jones 1a0ab95368 test 2020-02-29 18:52:16 -06:00
Trent Jones abfb577aff test 2020-02-29 18:48:03 -06:00
Trent Jones b95a4524b1 test 2020-02-29 18:46:16 -06:00
Trent Jones 0408e417a7 test 2020-02-29 18:43:58 -06:00
Trent Jones ae7c18cadc test 2020-02-29 18:40:13 -06:00
Trent Jones ee2f64b81c test 2020-02-29 18:39:45 -06:00
Trent Jones 29ce9916e9 doc test 2020-02-29 18:37:22 -06:00
Trent Jones 70fbdc473e test 2020-02-29 18:32:52 -06:00
Trent Jones f8ba3d6cf1 test 2020-02-29 18:31:02 -06:00
Trent Jones b389d7e74f test 2020-02-29 18:29:39 -06:00
Trent Jones 5baa794111 test 2020-02-29 18:27:56 -06:00
Trent Jones afc26f3ddf test 2020-02-29 18:24:18 -06:00
Trent Jones 744187c67e test 2020-02-29 18:23:52 -06:00
Trent Jones 30a70d3d0c test 2020-02-29 18:22:48 -06:00
Trent Jones 00b6330ec7 test 2020-02-29 18:21:42 -06:00
Trent Jones e7f13a59ae test 2020-02-29 18:21:15 -06:00
Trent Jones 388aa443d3 test 2020-02-29 18:18:37 -06:00
Trent Jones 0ed5f228f0 table test 2020-02-29 18:15:24 -06:00
Trent Jones 7fffd15783 test 2020-02-29 18:12:35 -06:00
Trent Jones c632014a56 doc update 2020-02-29 18:09:40 -06:00
Trent Jones 27202baee1 fix broken links 2020-02-29 17:52:33 -06:00
Trent Jones bb7eba695a formatting 2020-02-29 17:51:37 -06:00
Trent Jones 28729af438 test 2020-02-29 17:51:11 -06:00
Trent Jones 5a6debbcdd docs update 2020-02-29 17:50:30 -06:00
Trent Jones edf5b5d8e4 test 2020-02-29 17:41:10 -06:00
Trent Jones 0eb9b10a55 test 2020-02-29 17:40:39 -06:00
Trent Jones 88b9ac7698 test 2020-02-29 17:39:54 -06:00
Trent Jones f6e4bbc53a test 2020-02-29 17:39:12 -06:00
Trent Jones 9430d878c2 test 2020-02-29 17:37:44 -06:00
Trent Jones 685bc3493f links 2020-02-29 17:37:01 -06:00
Trent Jones 0ecd0be4ae format update 2020-02-29 17:32:39 -06:00
Trent Jones 28c93d0c78 test 2020-02-29 17:31:50 -06:00
Trent Jones e55adba2c6 table test 2020-02-29 17:31:01 -06:00
Trent Jones 69feaae867 test 2020-02-29 17:28:45 -06:00
Trent Jones c97e740fe9 test 2020-02-29 17:24:30 -06:00
Trent Jones 6cf22caa9a test 2020-02-29 17:23:36 -06:00
Trent Jones bcb5cecde2 test 2020-02-29 17:22:55 -06:00
Trent Jones fbc874e360 test 2020-02-29 17:20:40 -06:00
Trent Jones 9c544d0a68 format 2020-02-29 17:19:27 -06:00
Trent Jones 6b981bfadb usage update 2020-02-29 17:17:53 -06:00
Trent Jones f249cc20c7 scenario update 2020-02-29 17:10:44 -06:00
Trent Jones 1ef35ee24a formatting check 2020-02-29 16:55:52 -06:00
Trent Jones 0019c62465 doc test 2020-02-29 16:53:59 -06:00
Trent Jones 092d66c080 doc update 2020-02-29 16:52:52 -06:00
Trent Jones bc2bb9497f format test 2020-02-29 16:51:55 -06:00
Trent Jones e8046ba930 docs 2020-02-29 16:43:18 -06:00
Trent Jones ba9c18eeeb doc 2020-02-29 16:38:27 -06:00
Trent Jones c305af0360 usage doc 2020-02-29 16:37:36 -06:00
Trent Jones fe861955dd docs 2020-02-29 16:36:54 -06:00
Trent Jones 78a314e72c test 2020-02-29 16:34:30 -06:00
Trent Jones 8044eff2eb test 2020-02-29 16:33:47 -06:00
Trent Jones da04bb6bfb test 2020-02-29 16:33:23 -06:00
Trent Jones b545ae5120 docs 2020-02-29 16:32:10 -06:00
Trent Jones 490022b056 docs 2020-02-29 16:31:12 -06:00
Trent Jones ff55b2a44d docs 2020-02-29 15:55:55 -06:00
Trent Jones e4b4ccfa46 ci test name 2020-02-29 14:14:05 -06:00
Trent Jones 297ae5fc8b ci testing 2020-02-29 14:09:16 -06:00
Trent Jones 822eb5f632 ci test 2020-02-29 14:00:06 -06:00
Trent Jones 3692b9b73d ci testing 2020-02-29 13:39:38 -06:00
Trent Jones 56f4c0e28d ci testing 2020-02-29 13:35:50 -06:00
Trent Jones f52e3ae7a4 ci testing 2020-02-29 13:31:33 -06:00
Trent Jones 452b50c500 ci testing 2020-02-29 13:29:43 -06:00
Trent Jones 9625970c51 test fix 2020-02-29 13:26:10 -06:00
Trent Jones 933feb0fd6 test and error message update 2020-02-29 13:19:47 -06:00
Trent Jones 64d3415e33 updated action for build and smoke test 2020-02-29 13:06:39 -06:00
Trent Jones 4e192c30d8 delete package versions action v1 2020-02-29 12:56:23 -06:00
5 changed files with 91 additions and 77 deletions
+7 -14
View File
@@ -3,18 +3,9 @@ import {
RequestParameters
} from '@octokit/graphql/dist-types/types'
import * as Graphql from '@octokit/graphql'
import * as Graphql from '../../src/version/graphql'
import {GetVersionsQueryResponse} from '../../src/version'
import SpyInstance = jest.SpyInstance
export function mockGraphql(): SpyInstance<
Promise<GraphQlQueryResponseData>,
[string, (RequestParameters | undefined)?]
> {
return jest.spyOn(Graphql, 'graphql')
}
export function getMockedOldestQueryResponse(
numVersions: number
): GetVersionsQueryResponse {
@@ -49,8 +40,10 @@ export function getMockedOldestQueryResponse(
export function mockOldestQueryResponse(
numVersions: number
): ReturnType<typeof mockGraphql> {
return mockGraphql().mockResolvedValue(
getMockedOldestQueryResponse(numVersions)
)
) {
const response = new Promise((resolve) => {
resolve(getMockedOldestQueryResponse(numVersions))
}) as Promise<GraphQlQueryResponseData>
jest.spyOn(Graphql, 'graphql').mockImplementation(
(token: string, query: string, parameters: RequestParameters) => response)
}
+61 -57
View File
@@ -10,9 +10,9 @@
"integrity": "sha512-ZKdyhlSlyz38S6YFfPnyNgCDZuAF2T0Qv5eHflNWytPS8Qjvz39bZFMry9Bb/dpSnqWcNeav5yM2CTYpJeY+Dw=="
},
"@actions/github": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/@actions/github/-/github-2.1.1.tgz",
"integrity": "sha512-kAgTGUx7yf5KQCndVeHSwCNZuDBvPyxm5xKTswW2lofugeuC1AZX73nUUVDNaysnM9aKFMHv9YCdVJbg7syEyA==",
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/@actions/github/-/github-2.2.0.tgz",
"integrity": "sha512-9UAZqn8ywdR70n3GwVle4N8ALosQs4z50N7XMXrSTUVOmVpaBC5kE3TRTT7qQdi3OaQV24mjGuJZsHUmhD+ZXw==",
"requires": {
"@actions/http-client": "^1.0.3",
"@octokit/graphql": "^4.3.1",
@@ -20,9 +20,9 @@
}
},
"@actions/http-client": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.6.tgz",
"integrity": "sha512-LGmio4w98UyGX33b/W6V6Nx/sQHRXZ859YlMkn36wPsXPB82u8xTVlA/Dq2DXrm6lEq9RVmisRJa1c+HETAIJA==",
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.8.tgz",
"integrity": "sha512-G4JjJ6f9Hb3Zvejj+ewLLKLf99ZC+9v+yCxoYf9vSyH+WkzPLB2LuUtRMGNkooMqdugGBFStIKXOuvH1W+EctA==",
"requires": {
"tunnel": "0.0.6"
}
@@ -438,11 +438,11 @@
}
},
"@octokit/endpoint": {
"version": "5.5.3",
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-5.5.3.tgz",
"integrity": "sha512-EzKwkwcxeegYYah5ukEeAI/gYRLv2Y9U5PpIsseGSFDk+G3RbipQGBs8GuYS1TLCtQaqoO66+aQGtITPalxsNQ==",
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.1.tgz",
"integrity": "sha512-pOPHaSz57SFT/m3R5P8MUu4wLPszokn5pXcB/pzavLTQf2jbU+6iayTvzaY6/BiotuRS0qyEUkx3QglT4U958A==",
"requires": {
"@octokit/types": "^2.0.0",
"@octokit/types": "^2.11.1",
"is-plain-object": "^3.0.0",
"universal-user-agent": "^5.0.0"
},
@@ -459,25 +459,17 @@
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz",
"integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA=="
},
"universal-user-agent": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-5.0.0.tgz",
"integrity": "sha512-B5TPtzZleXyPrUMKCpEHFmVhMN6EhmJYjG5PQna9s7mXeSqGTLap4OpqLl5FCEFUI3UBmllkETwKf/db66Y54Q==",
"requires": {
"os-name": "^3.1.0"
}
}
}
},
"@octokit/graphql": {
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.3.1.tgz",
"integrity": "sha512-hCdTjfvrK+ilU2keAdqNBWOk+gm1kai1ZcdjRfB30oA3/T6n53UVJb7w0L5cR3/rhU91xT3HSqCd+qbvH06yxA==",
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.4.0.tgz",
"integrity": "sha512-Du3hAaSROQ8EatmYoSAJjzAz3t79t9Opj/WY1zUgxVUGfIKn0AEjg+hlOLscF6fv6i/4y/CeUvsWgIfwMkTccw==",
"requires": {
"@octokit/request": "^5.3.0",
"@octokit/types": "^2.0.0",
"universal-user-agent": "^4.0.0"
"universal-user-agent": "^5.0.0"
}
},
"@octokit/plugin-paginate-rest": {
@@ -503,13 +495,13 @@
}
},
"@octokit/request": {
"version": "5.3.2",
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.3.2.tgz",
"integrity": "sha512-7NPJpg19wVQy1cs2xqXjjRq/RmtSomja/VSWnptfYwuBxLdbYh2UjhGi0Wx7B1v5Iw5GKhfFDQL7jM7SSp7K2g==",
"version": "5.4.2",
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.2.tgz",
"integrity": "sha512-zKdnGuQ2TQ2vFk9VU8awFT4+EYf92Z/v3OlzRaSh4RIP0H6cvW1BFPXq4XYvNez+TPQjqN+0uSkCYnMFFhcFrw==",
"requires": {
"@octokit/endpoint": "^5.5.0",
"@octokit/request-error": "^1.0.1",
"@octokit/types": "^2.0.0",
"@octokit/endpoint": "^6.0.1",
"@octokit/request-error": "^2.0.0",
"@octokit/types": "^2.11.1",
"deprecation": "^2.0.0",
"is-plain-object": "^3.0.0",
"node-fetch": "^2.3.0",
@@ -534,21 +526,13 @@
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
},
"universal-user-agent": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-5.0.0.tgz",
"integrity": "sha512-B5TPtzZleXyPrUMKCpEHFmVhMN6EhmJYjG5PQna9s7mXeSqGTLap4OpqLl5FCEFUI3UBmllkETwKf/db66Y54Q==",
"requires": {
"os-name": "^3.1.0"
}
}
}
},
"@octokit/request-error": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.2.1.tgz",
"integrity": "sha512-+6yDyk1EES6WK+l3viRDElw96MvwfJxCt45GvmjDUKWjYIb3PJZQkq3i46TwGwoPD4h8NmTrENmtyA1FwbmhRA==",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.0.tgz",
"integrity": "sha512-rtYicB4Absc60rUv74Rjpzek84UbVHGHJRu4fNVlZ1mCcyUPPuzFfG9Rn6sjHrd95DEsmjSt1Axlc699ZlbDkw==",
"requires": {
"@octokit/types": "^2.0.0",
"deprecation": "^2.0.0",
@@ -576,12 +560,32 @@
"octokit-pagination-methods": "^1.1.0",
"once": "^1.4.0",
"universal-user-agent": "^4.0.0"
},
"dependencies": {
"@octokit/request-error": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.2.1.tgz",
"integrity": "sha512-+6yDyk1EES6WK+l3viRDElw96MvwfJxCt45GvmjDUKWjYIb3PJZQkq3i46TwGwoPD4h8NmTrENmtyA1FwbmhRA==",
"requires": {
"@octokit/types": "^2.0.0",
"deprecation": "^2.0.0",
"once": "^1.4.0"
}
},
"universal-user-agent": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.1.tgz",
"integrity": "sha512-LnST3ebHwVL2aNe4mejI9IQh2HfZ1RLo8Io2HugSif8ekzD1TlWpHpColOB/eh8JHMLkGH3Akqf040I+4ylNxg==",
"requires": {
"os-name": "^3.1.0"
}
}
}
},
"@octokit/types": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.3.1.tgz",
"integrity": "sha512-rvJP1Y9A/+Cky2C3var1vsw3Lf5Rjn/0sojNl2AjCX+WbpIHYccaJ46abrZoIxMYnOToul6S9tPytUVkFI7CXQ==",
"version": "2.16.2",
"resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz",
"integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==",
"requires": {
"@types/node": ">= 8"
}
@@ -802,9 +806,9 @@
"dev": true
},
"acorn": {
"version": "6.4.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.0.tgz",
"integrity": "sha512-gac8OEcQ2Li1dxIEWGZzsp2BitJxwkwcOm0zHAJLcPJaVvm58FRnk6RkuLRpU1EujipU2ZFODv2P9DLMfnV8mw==",
"version": "6.4.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz",
"integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==",
"dev": true
},
"acorn-globals": {
@@ -4379,9 +4383,9 @@
},
"dependencies": {
"acorn": {
"version": "5.7.3",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz",
"integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==",
"version": "5.7.4",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz",
"integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==",
"dev": true
}
}
@@ -4518,9 +4522,9 @@
}
},
"lodash": {
"version": "4.17.15",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
"version": "4.17.19",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz",
"integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==",
"dev": true
},
"lodash.get": {
@@ -6380,9 +6384,9 @@
}
},
"universal-user-agent": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.1.tgz",
"integrity": "sha512-LnST3ebHwVL2aNe4mejI9IQh2HfZ1RLo8Io2HugSif8ekzD1TlWpHpColOB/eh8JHMLkGH3Akqf040I+4ylNxg==",
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-5.0.0.tgz",
"integrity": "sha512-B5TPtzZleXyPrUMKCpEHFmVhMN6EhmJYjG5PQna9s7mXeSqGTLap4OpqLl5FCEFUI3UBmllkETwKf/db66Y54Q==",
"requires": {
"os-name": "^3.1.0"
}
@@ -6556,9 +6560,9 @@
"dev": true
},
"windows-release": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.2.0.tgz",
"integrity": "sha512-QTlz2hKLrdqukrsapKsINzqMgOUpQW268eJ0OaOpJN32h272waxR9fkB9VoWRtK7uKHG5EHJcTXQBD8XZVJkFA==",
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.3.0.tgz",
"integrity": "sha512-2HetyTg1Y+R+rUgrKeUEhAG/ZuOmTrI1NBb3ZyAGQMYmOJjBBPe4MTodghRkmLJZHwkuPi02anbeGP+Zf401LQ==",
"requires": {
"execa": "^1.0.0"
}
+2 -3
View File
@@ -1,7 +1,7 @@
import {from, Observable, merge, throwError, of} from 'rxjs'
import {graphql} from '@octokit/graphql'
import {catchError, map, tap} from 'rxjs/operators'
import {GraphQlQueryResponse} from '@octokit/graphql/dist-types/types'
import {graphql} from './graphql'
export interface DeletePackageVersionMutationResponse {
deletePackageVersion: {
@@ -21,10 +21,9 @@ export function deletePackageVersion(
token: string
): Observable<boolean> {
return from(
graphql(mutation, {
graphql(token, mutation, {
packageVersionId,
headers: {
authorization: `token ${token}`,
Accept: 'application/vnd.github.package-deletes-preview+json'
}
}) as Promise<DeletePackageVersionMutationResponse>
+2 -3
View File
@@ -1,7 +1,7 @@
import {graphql} from '@octokit/graphql'
import {GraphQlQueryResponse} from '@octokit/graphql/dist-types/types'
import {Observable, from, throwError} from 'rxjs'
import {catchError, map} from 'rxjs/operators'
import {graphql} from './graphql'
export interface VersionInfo {
id: string
@@ -52,13 +52,12 @@ export function queryForOldestVersions(
token: string
): Observable<GetVersionsQueryResponse> {
return from(
graphql(query, {
graphql(token, query, {
owner,
repo,
package: packageName,
last: numVersions,
headers: {
authorization: `token ${token}`,
Accept: 'application/vnd.github.packages-preview+json'
}
}) as Promise<GetVersionsQueryResponse>
+19
View File
@@ -0,0 +1,19 @@
import {GitHub} from '@actions/github'
import {GraphQlQueryResponseData} from '@octokit/graphql/dist-types/types'
import {RequestParameters} from '@octokit/types/dist-types/RequestParameters'
/**
* Sends a GraphQL query request based on endpoint options
*
* @param {string} token Auth token
* @param {string} query GraphQL query. Example: `'query { viewer { login } }'`.
* @param {object} parameters URL, query or body parameters, as well as `headers`, `mediaType.{format|previews}`, `request`, or `baseUrl`.
*/
export async function graphql(
token: string,
query: string,
parameters: RequestParameters
): Promise<GraphQlQueryResponseData> {
const github = new GitHub(token)
return await github.graphql(query, parameters)
}