-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c3a6ea
commit 198d9fe
Showing
3 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { generateApolloClient } from '@deep-foundation/hasura/client.js'; | ||
import Debug from 'debug'; | ||
import { DeepClient } from '../imports/client.js'; | ||
import { installPackage } from './1678940577209-deepcase.js'; | ||
import { containWithin, packageExists, sharePermissions } from './1664940577200-tsx.js'; | ||
|
||
const debug = Debug('deeplinks:migrations:timezone'); | ||
const log = debug.extend('log'); | ||
const error = debug.extend('error'); | ||
|
||
const rootClient = generateApolloClient({ | ||
path: `${process.env.MIGRATIONS_HASURA_PATH}/v1/graphql`, | ||
ssl: !!+(process.env.MIGRATIONS_HASURA_SSL || 0), | ||
secret: process.env.MIGRATIONS_HASURA_SECRET, | ||
}); | ||
|
||
const root = new DeepClient({ | ||
apolloClient: rootClient, | ||
}); | ||
|
||
export const up = async () => { | ||
log('up'); | ||
const packageName = '@deep-foundation/timezone'; | ||
if (!await packageExists(packageName)) { | ||
const adminId = await root.id('deep', 'admin'); | ||
const admin = await root.login({ linkId: adminId }); | ||
const deep = new DeepClient({ deep: root, ...admin }); | ||
|
||
await installPackage(deep, '@deep-foundation/timezone'); | ||
const packageId = await root.id('@deep-foundation/timezone'); | ||
await sharePermissions(adminId, packageId); | ||
await containWithin(adminId, packageId); | ||
} | ||
}; | ||
|
||
export const down = async () => { | ||
log('down'); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { generateApolloClient } from '@deep-foundation/hasura/client.js'; | ||
import Debug from 'debug'; | ||
import { DeepClient } from '../imports/client.js'; | ||
import { installPackage } from './1678940577209-deepcase.js'; | ||
import { containWithin, packageExists, sharePermissions } from './1664940577200-tsx.js'; | ||
|
||
const debug = Debug('deeplinks:migrations:coordinates'); | ||
const log = debug.extend('log'); | ||
const error = debug.extend('error'); | ||
|
||
const rootClient = generateApolloClient({ | ||
path: `${process.env.MIGRATIONS_HASURA_PATH}/v1/graphql`, | ||
ssl: !!+(process.env.MIGRATIONS_HASURA_SSL || 0), | ||
secret: process.env.MIGRATIONS_HASURA_SECRET, | ||
}); | ||
|
||
const root = new DeepClient({ | ||
apolloClient: rootClient, | ||
}); | ||
|
||
export const up = async () => { | ||
log('up'); | ||
const packageName = '@deep-foundation/coordinates'; | ||
if (!await packageExists(packageName)) { | ||
const adminId = await root.id('deep', 'admin'); | ||
const admin = await root.login({ linkId: adminId }); | ||
const deep = new DeepClient({ deep: root, ...admin }); | ||
|
||
await installPackage(deep, '@deep-foundation/coordinates'); | ||
const packageId = await root.id('@deep-foundation/coordinates'); | ||
await sharePermissions(adminId, packageId); | ||
await containWithin(adminId, packageId); | ||
} | ||
}; | ||
|
||
export const down = async () => { | ||
log('down'); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters