@venizia/ardor-kernel 0.4.8-18 → 0.4.8-19

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.
@@ -7,5 +7,4 @@ export { ArtifactBindingKeys, ArtifactNamespaces, ArtifactTypes, BindingKeys, Bi
7
7
  export type { IArtifactMetadata, IArtifactRegistrationOptions, TBindingNamespace, TBindingScope, } from '@venizia/ignis-kernel/metadata';
8
8
  export { RepositoryTypes } from '@venizia/ignis-kernel/repository';
9
9
  export type { TRepositoryType } from '@venizia/ignis-kernel/repository';
10
- export { provideOption } from './provide-option.js';
11
10
  //# sourceMappingURL=index.d.ts.map
@@ -6,5 +6,4 @@ export { component, configuration, datasource, inject, injectable, model, provid
6
6
  export { ArtifactBindingKeys, ArtifactNamespaces, ArtifactTypes, BindingKeys, BindingNamespaces, } from '@venizia/ignis-kernel/metadata';
7
7
  // The `type` of `@repository`: `REMOTE` for an `HttpRepository`, which has no model.
8
8
  export { RepositoryTypes } from '@venizia/ignis-kernel/repository';
9
- export { provideOption } from './provide-option.js';
10
9
  //# sourceMappingURL=index.js.map
@@ -19,7 +19,7 @@ import type { DefaultAuthService } from '../services/auth.js';
19
19
  * BaseArdorApplication,
20
20
  * configuration,
21
21
  * CoreBindings,
22
- * provideOption,
22
+ * provide,
23
23
  * RolePermissionProvider,
24
24
  * type IApplicationInfo,
25
25
  * type IRolePermissionProviderOptions,
@@ -27,7 +27,7 @@ import type { DefaultAuthService } from '../services/auth.js';
27
27
  *
28
28
  * @configuration()
29
29
  * export class PermissionConfiguration {
30
- * @provideOption({ key: CoreBindings.PERMISSION_PROVIDER_OPTIONS })
30
+ * @provide({ key: CoreBindings.PERMISSION_PROVIDER_OPTIONS })
31
31
  * permissionOptions(): IRolePermissionProviderOptions {
32
32
  * return { grants: { admin: ['*'], editor: ['orders.*', 'stocks.list'] } };
33
33
  * }
@@ -58,7 +58,7 @@ class GrantPattern {
58
58
  * BaseArdorApplication,
59
59
  * configuration,
60
60
  * CoreBindings,
61
- * provideOption,
61
+ * provide,
62
62
  * RolePermissionProvider,
63
63
  * type IApplicationInfo,
64
64
  * type IRolePermissionProviderOptions,
@@ -66,7 +66,7 @@ class GrantPattern {
66
66
  *
67
67
  * @configuration()
68
68
  * export class PermissionConfiguration {
69
- * @provideOption({ key: CoreBindings.PERMISSION_PROVIDER_OPTIONS })
69
+ * @provide({ key: CoreBindings.PERMISSION_PROVIDER_OPTIONS })
70
70
  * permissionOptions(): IRolePermissionProviderOptions {
71
71
  * return { grants: { admin: ['*'], editor: ['orders.*', 'stocks.list'] } };
72
72
  * }
@@ -1,4 +1,3 @@
1
- import type { IRestDataProviderOptions, IRolePermissionProviderOptions, TAuthProviderOptions } from './types.js';
2
1
  /** The container keys the kernel binds and reads. */
3
2
  export declare class CoreBindings {
4
3
  /** The application itself, bound by `preConfigure`. */
@@ -26,16 +25,6 @@ export declare class CoreBindings {
26
25
  /** The `IRolePermissionProviderOptions` that `RolePermissionProvider` reads. */
27
26
  static readonly PERMISSION_PROVIDER_OPTIONS = "@app/application/options/permission";
28
27
  }
29
- /**
30
- * The options type of each options key of `CoreBindings`, which `provideOption` checks a method
31
- * against. A package that owns an options type declares it with `declare module '@venizia/ardor-kernel'`:
32
- * `@venizia/ardor-admin` adds `CoreBindings.I18N_PROVIDER_OPTIONS`.
33
- */
34
- export interface ICoreOptionTypes {
35
- [CoreBindings.AUTH_PROVIDER_OPTIONS]: TAuthProviderOptions;
36
- [CoreBindings.REST_DATA_PROVIDER_OPTIONS]: IRestDataProviderOptions;
37
- [CoreBindings.PERMISSION_PROVIDER_OPTIONS]: IRolePermissionProviderOptions;
38
- }
39
28
  /** The session keys and the store prefix of one application, from `LocalStorageKeys.scoped`. */
40
29
  export interface IScopedKeys {
41
30
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venizia/ardor-kernel",
3
- "version": "0.4.8-18",
3
+ "version": "0.4.8-19",
4
4
  "description": "ARDOR kernel - the isomorphic core of the ARDOR frontend framework: application base on IGNIS inversion, service and provider bases, request/auth constants, binding keys, the network request service, runtime config and the HTTP repository (from IGNIS). No React and no react-admin.",
5
5
  "keywords": [
6
6
  "ardor",
@@ -1,28 +0,0 @@
1
- import type { ICoreOptionTypes } from '../../common/index.js';
2
- /**
3
- * `@provide` for an options key of `CoreBindings`: the method must return the options type of that
4
- * key (`ICoreOptionTypes`), so a wrong return type fails at compile time instead of mid-render.
5
- * The method is synchronous: the container does not await a provider.
6
- *
7
- * @example
8
- * ```ts
9
- * import {
10
- * configuration,
11
- * CoreBindings,
12
- * provideOption,
13
- * type IRestDataProviderOptions,
14
- * } from '@venizia/ardor';
15
- *
16
- * @configuration()
17
- * export class ApiConfiguration {
18
- * @provideOption({ key: CoreBindings.REST_DATA_PROVIDER_OPTIONS })
19
- * restDataProviderOptions(): IRestDataProviderOptions {
20
- * return { url: 'https://api.example.com' };
21
- * }
22
- * }
23
- * ```
24
- */
25
- export declare const provideOption: <K extends keyof ICoreOptionTypes>(opts: {
26
- key: K;
27
- }) => (target: object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<() => ICoreOptionTypes[K]>) => void;
28
- //# sourceMappingURL=provide-option.d.ts.map
@@ -1,30 +0,0 @@
1
- import { provide } from '@venizia/ignis-kernel/metadata';
2
- /**
3
- * `@provide` for an options key of `CoreBindings`: the method must return the options type of that
4
- * key (`ICoreOptionTypes`), so a wrong return type fails at compile time instead of mid-render.
5
- * The method is synchronous: the container does not await a provider.
6
- *
7
- * @example
8
- * ```ts
9
- * import {
10
- * configuration,
11
- * CoreBindings,
12
- * provideOption,
13
- * type IRestDataProviderOptions,
14
- * } from '@venizia/ardor';
15
- *
16
- * @configuration()
17
- * export class ApiConfiguration {
18
- * @provideOption({ key: CoreBindings.REST_DATA_PROVIDER_OPTIONS })
19
- * restDataProviderOptions(): IRestDataProviderOptions {
20
- * return { url: 'https://api.example.com' };
21
- * }
22
- * }
23
- * ```
24
- */
25
- export const provideOption = (opts) => {
26
- return (target, propertyKey, descriptor) => {
27
- provide({ key: opts.key })(target, propertyKey, descriptor);
28
- };
29
- };
30
- //# sourceMappingURL=provide-option.js.map