Skip to content

Commit

Permalink
feat: juno.dev.config
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpeterparker committed Feb 17, 2024
1 parent 5c26792 commit 877c14b
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 3 deletions.
1 change: 0 additions & 1 deletion packages/admin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ export type * from './types/controllers.types';
export type * from './types/customdomain.types';
export type * from './types/ic.types';
export type * from './types/releases.types';
export type * from './types/rules.types';
2 changes: 1 addition & 1 deletion packages/admin/src/services/satellite.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import {
import type {SatelliteParameters} from '../types/actor.types';
import type {BuildType} from '../types/build.types';
import type {CustomDomain} from '../types/customdomain.types';
import type {Rule, RulesType} from '../types/rules.types';
import type {Rule, RulesType} from '@junobuild/config';
import {encodeIDLControllers} from '../utils/idl.utils';
import {mapRule, mapRuleType, mapSetRule} from '../utils/rule.utils';

Expand Down
2 changes: 1 addition & 1 deletion packages/admin/src/utils/rule.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
PermissionPublic,
StorageRulesType
} from '../constants/rules.constants';
import type {MemoryText, PermissionText, Rule, RulesType} from '../types/rules.types';
import type {MemoryText, PermissionText, Rule, RulesType} from '@junobuild/config';

export const mapRuleType = (type: RulesType): RulesTypeApi =>
type === 'storage' ? StorageRulesType : DbRulesType;
Expand Down
22 changes: 22 additions & 0 deletions packages/config/src/dev/juno.dev.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import {Rule} from "../types/rules";

export type SatelliteDevCollection = Omit<Rule, 'created_at' | 'updated_at'>;

export interface SatelliteDevCollections {
db?: SatelliteDevCollection[];
storage?: SatelliteDevCollection[];
}

export interface SatelliteDevController {
id: string;
scope: 'write' | 'admin';
}

export interface SatelliteDevConfig {
collections: SatelliteDevCollections;
controllers?: SatelliteDevController[];
}

export interface JunoDevConfig {
satellite: SatelliteDevConfig;
}
2 changes: 2 additions & 0 deletions packages/config/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
export type * from './dev/juno.dev.config';
export type * from './types/encoding';
export type * from './types/juno.config';
export type * from './types/juno.env';
export type * from './types/rules';
export type * from './types/satellite.config';
export type * from './types/storage.config';
export type * from './types/utility';
Expand Down
File renamed without changes.

0 comments on commit 877c14b

Please sign in to comment.