Skip to content

Commit

Permalink
0.0.570
Browse files Browse the repository at this point in the history
  • Loading branch information
ivansglazunov committed Sep 25, 2024
1 parent 14ff913 commit 44a0afc
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,5 @@ const imported = await packages.import(readed);
// { [name@version]: Package } // possible Package.errors

// shorthand
await deep.Packages().write(process.cwd()+'/../', await deep.Packages().export());
await deep.Packages().write(process.cwd(), await deep.Packages().export());
```
38 changes: 38 additions & 0 deletions migrations/1727224344983-promise-cleaner.ts
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:promise-cleaner');
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/promise-cleaner';
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/promise-cleaner');
const packageId = await root.id('@deep-foundation/promise-cleaner');
await sharePermissions(adminId, packageId);
await containWithin(adminId, packageId);
}
};

export const down = async () => {
log('down');
};
38 changes: 38 additions & 0 deletions migrations/1727234538431-rules.ts
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:rules');
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/rules';
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/rules');
const packageId = await root.id('@deep-foundation/rules');
await sharePermissions(adminId, packageId);
await containWithin(adminId, packageId);
}
};

export const down = async () => {
log('down');
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@deep-foundation/deeplinks",
"version": "0.0.569",
"version": "0.0.570",
"license": "Unlicense",
"type": "module",
"main": "import.js",
Expand Down

0 comments on commit 44a0afc

Please sign in to comment.