@envelop/operation-field-permissions 3.1.0 → 3.1.1-alpha-e859732.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.d.ts +10 -1
  2. package/package.json +3 -3
package/index.d.ts CHANGED
@@ -1,5 +1,14 @@
1
1
  import { Plugin } from '@envelop/core';
2
2
  declare type PromiseOrValue<T> = T | Promise<T>;
3
+ declare const OPERATION_PERMISSIONS_SYMBOL: unique symbol;
4
+ declare type ScopeContext = {
5
+ allowAll: boolean;
6
+ wildcardTypes: Set<string>;
7
+ schemaCoordinates: Set<string>;
8
+ };
9
+ declare type PluginContext = {
10
+ [OPERATION_PERMISSIONS_SYMBOL]: ScopeContext;
11
+ };
3
12
  declare type OperationScopeRuleOptions = {
4
13
  formatError: (schemaCoordinate: string) => string;
5
14
  };
@@ -7,5 +16,5 @@ declare type OperationScopeOptions<TContext> = {
7
16
  getPermissions: (context: TContext) => PromiseOrValue<Set<string> | string>;
8
17
  formatError?: OperationScopeRuleOptions['formatError'];
9
18
  };
10
- export declare const useOperationFieldPermissions: <TContext>(opts: OperationScopeOptions<TContext>) => Plugin;
19
+ export declare const useOperationFieldPermissions: <TContext>(opts: OperationScopeOptions<TContext>) => Plugin<{}, PluginContext>;
11
20
  export {};
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@envelop/operation-field-permissions",
3
- "version": "3.1.0",
3
+ "version": "3.1.1-alpha-e859732.0",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
- "@envelop/core": "^2.1.0",
6
+ "@envelop/core": "2.1.1-alpha-e859732.0",
7
7
  "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0"
8
8
  },
9
9
  "dependencies": {
10
- "@envelop/extended-validation": "^1.4.0"
10
+ "@envelop/extended-validation": "1.4.1-alpha-e859732.0"
11
11
  },
12
12
  "repository": {
13
13
  "type": "git",