@@ -60,7 +60,7 @@ import {
6060import { execute } from './graphql' ;
6161import { UpdateSchemaPolicyForOrganization , UpdateSchemaPolicyForProject } from './schema-policy' ;
6262import { collect , CollectedOperation , legacyCollect } from './usage' ;
63- import { generateUnique } from './utils' ;
63+ import { generateUnique , getServiceHost } from './utils' ;
6464
6565export function initSeed ( ) {
6666 function createConnectionPool ( ) {
@@ -89,6 +89,15 @@ export function initSeed() {
8989 } ,
9090 authenticate,
9191 generateEmail : ( ) => userEmail ( generateUnique ( ) ) ,
92+ async purgeOrganizationAccessTokenById ( id : string ) {
93+ const registryAddress = await getServiceHost ( 'server' , 8082 ) ;
94+ await fetch (
95+ 'http://' + registryAddress + '/cache/organization-access-token-cache/delete/' + id ,
96+ {
97+ method : 'POST' ,
98+ } ,
99+ ) . then ( res => res . json ( ) ) ;
100+ } ,
92101 async createOwner ( ) {
93102 const ownerEmail = userEmail ( generateUnique ( ) ) ;
94103 const auth = await authenticate ( ownerEmail ) ;
@@ -120,7 +129,7 @@ export function initSeed() {
120129 ) {
121130 const result = await createOrganizationAccessToken (
122131 {
123- title : 'A Access Token ' ,
132+ title : 'an access token ' ,
124133 description : 'access token' ,
125134 organization : {
126135 byId : organization . id ,
@@ -488,7 +497,7 @@ export function initSeed() {
488497 return result . addAlertChannel ;
489498 } ,
490499 /**
491- * Create a access token for a given target.
500+ * Create an access token for a given target.
492501 * This token can be used for usage reporting and all actions that would be performed by the CLI.
493502 */
494503 async createTargetAccessToken ( {
0 commit comments