@atls/nestjs-keto 0.0.7 → 0.0.9

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.
@@ -1,2 +1,2 @@
1
- import { GetGuardingRelationTuple } from './guarded-by-keto.interfaces.js';
1
+ import type { GetGuardingRelationTuple } from './guarded-by-keto.interfaces.js';
2
2
  export declare const getGuardingRelationTuple: GetGuardingRelationTuple;
@@ -1,2 +1,2 @@
1
- import { GuardedByKetoFunction } from './guarded-by-keto.interfaces.js';
1
+ import type { GuardedByKetoFunction } from './guarded-by-keto.interfaces.js';
2
2
  export declare const GuardedByKeto: GuardedByKetoFunction;
@@ -1,5 +1,5 @@
1
- import { CustomDecorator } from '@nestjs/common';
2
- import { Reflector } from '@nestjs/core';
3
- export type GetGuardingRelationTuple = (reflector: Reflector, handler: Parameters<Reflector['get']>[1]) => string | ReplaceGenerator;
1
+ import type { CustomDecorator } from '@nestjs/common';
2
+ import type { Reflector } from '@nestjs/core';
3
+ export type GetGuardingRelationTuple = (reflector: Reflector, handler: Parameters<Reflector['get']>[1]) => ReplaceGenerator | string;
4
4
  export type ReplaceGenerator = (value: string) => string;
5
- export type GuardedByKetoFunction = (relationTuple: string | ReplaceGenerator) => CustomDecorator<symbol>;
5
+ export type GuardedByKetoFunction = (relationTuple: ReplaceGenerator | string) => CustomDecorator<symbol>;
@@ -1,5 +1,5 @@
1
1
  export * from './guarded-by-keto.decorator.js';
2
- export { GuardedByKetoFunction } from './guarded-by-keto.interfaces.js';
3
- export { GetGuardingRelationTuple } from './guarded-by-keto.interfaces.js';
2
+ export type { GuardedByKetoFunction } from './guarded-by-keto.interfaces.js';
3
+ export type { GetGuardingRelationTuple } from './guarded-by-keto.interfaces.js';
4
4
  export { GUARDED_BY_METADATA_KEY } from './guarded-by-keto.constants.js';
5
5
  export { getGuardingRelationTuple } from './get-guarding-relation.helper.js';
@@ -1,4 +1,3 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
1
  import { AssertionError } from 'node:assert';
3
2
  export declare class KetoGeneralException extends AssertionError {
4
3
  constructor(message: string);
@@ -1,4 +1,3 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
1
  import { AssertionError } from 'node:assert';
3
2
  export declare class KetoRelationTupleInvalidException extends AssertionError {
4
3
  constructor();
@@ -1,5 +1,5 @@
1
- import { ExecutionContext } from '@nestjs/common';
2
- import { CanActivate } from '@nestjs/common';
1
+ import type { ExecutionContext } from '@nestjs/common';
2
+ import type { CanActivate } from '@nestjs/common';
3
3
  import { Reflector } from '@nestjs/core';
4
4
  import { KetoReadClientService } from '../services/index.js';
5
5
  export declare class KetoGuard implements CanActivate {
@@ -1,3 +1,3 @@
1
1
  export * from './keto.module.js';
2
2
  export * from './keto.constants.js';
3
- export * from './keto-module.interfaces.js';
3
+ export type * from './keto-module.interfaces.js';
@@ -1,3 +1,2 @@
1
1
  export * from "./keto.module.js";
2
2
  export * from "./keto.constants.js";
3
- export * from "./keto-module.interfaces.js";
@@ -1,18 +1,18 @@
1
- import { Type } from '@nestjs/common/interfaces';
2
- import { ModuleMetadata } from '@nestjs/common/interfaces';
3
- import { ConfigurationParameters } from '@ory/keto-client';
4
- import { SubjectSet } from '@ory/keto-client';
1
+ import type { Type } from '@nestjs/common/interfaces';
2
+ import type { ModuleMetadata } from '@nestjs/common/interfaces';
3
+ import type { ConfigurationParameters } from '@ory/keto-client';
4
+ import type { SubjectSet } from '@ory/keto-client';
5
5
  export interface KetoModuleOptions extends ConfigurationParameters {
6
6
  global?: boolean;
7
7
  }
8
8
  export interface KetoOptionsFactory {
9
- createKetoOptions(): Promise<KetoModuleOptions> | KetoModuleOptions;
9
+ createKetoOptions: () => KetoModuleOptions | Promise<KetoModuleOptions>;
10
10
  }
11
11
  export interface KetoModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
12
12
  useExisting?: Type<KetoOptionsFactory>;
13
13
  useClass?: Type<KetoOptionsFactory>;
14
- useFactory?: (...args: any[]) => Promise<KetoModuleOptions> | KetoModuleOptions;
15
- inject?: any[];
14
+ useFactory?: (...args: Array<any>) => KetoModuleOptions | Promise<KetoModuleOptions>;
15
+ inject?: Array<any>;
16
16
  global?: boolean;
17
17
  }
18
18
  export type RelationShipTuple = RelationShipTupleWithId | RelationShipTupleWithSet;
@@ -1,6 +1,6 @@
1
- import { DynamicModule } from '@nestjs/common';
2
- import { KetoModuleAsyncOptions } from './keto-module.interfaces.js';
3
- import { KetoModuleOptions } from './keto-module.interfaces.js';
1
+ import type { DynamicModule } from '@nestjs/common';
2
+ import type { KetoModuleAsyncOptions } from './keto-module.interfaces.js';
3
+ import type { KetoModuleOptions } from './keto-module.interfaces.js';
4
4
  export declare class KetoModule {
5
5
  static register(options: KetoModuleOptions): DynamicModule;
6
6
  static registerAsync(options: KetoModuleAsyncOptions): DynamicModule;
@@ -52,7 +52,7 @@ let KetoModule = KetoModule_1 = class KetoModule {
52
52
  }
53
53
  return {
54
54
  provide: KETO_MODULE_CONFIGURATION,
55
- useFactory: (optionsFactory) => optionsFactory.createKetoOptions(),
55
+ useFactory: async (optionsFactory) => optionsFactory.createKetoOptions(),
56
56
  inject: [options.useExisting || options.useClass],
57
57
  };
58
58
  }
@@ -1,4 +1,4 @@
1
- import { Provider } from '@nestjs/common';
2
- import { KetoModuleOptions } from './keto-module.interfaces.js';
3
- export declare const createKetoConfigurationProvider: (options: KetoModuleOptions) => Provider[];
4
- export declare const createKetoExportsProvider: () => Provider[];
1
+ import type { Provider } from '@nestjs/common';
2
+ import type { KetoModuleOptions } from './keto-module.interfaces.js';
3
+ export declare const createKetoConfigurationProvider: (options: KetoModuleOptions) => Array<Provider>;
4
+ export declare const createKetoExportsProvider: () => Array<Provider>;
@@ -1,4 +1,4 @@
1
- import { RelationShipTuple } from '../module/index.js';
1
+ import type { RelationShipTuple } from '../module/index.js';
2
2
  import { KetoPermissionsService } from './keto-permissions.service.js';
3
3
  export declare class KetoReadClientService {
4
4
  private readonly permissionService;
@@ -1,6 +1,6 @@
1
- import { RelationshipPatchActionEnum } from '@ory/keto-client';
2
- import { Relationship } from '@ory/keto-client';
3
- import { RelationShipTuple } from '../module/index.js';
1
+ import type { RelationshipPatchActionEnum } from '@ory/keto-client';
2
+ import type { Relationship } from '@ory/keto-client';
3
+ import type { RelationShipTuple } from '../module/index.js';
4
4
  import { KetoRelationsService } from './keto-relations.service.js';
5
5
  export declare class KetoWriteClientService {
6
6
  private readonly relationsService;
@@ -1,5 +1,5 @@
1
- import { RelationShipTuple } from '../module/index.js';
2
- type Tuple = string | ((...args: string[]) => string);
1
+ import type { RelationShipTuple } from '../module/index.js';
2
+ type Tuple = string | ((...args: Array<string>) => string);
3
3
  export declare class RelationTupleConverter {
4
4
  private readonly tuple;
5
5
  private readonly replacement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atls/nestjs-keto",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "license": "BSD-3-Clause",
5
5
  "type": "module",
6
6
  "exports": {