@ecodev/natural 53.3.2 → 54.0.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.
@@ -1,4 +1,6 @@
1
- import { DocumentNode } from '@apollo/client/core';
1
+ import { ApolloLink, DocumentNode } from '@apollo/client/core';
2
+ import { HttpBatchLink, HttpLink, Options } from 'apollo-angular/http';
3
+ import { ExtractFiles } from 'apollo-angular/http/types';
2
4
  /**
3
5
  * Detect if the given variables have a file to be uploaded or not, and
4
6
  * also convert date to be serialized with their timezone.
@@ -8,3 +10,10 @@ export declare function hasFilesAndProcessDate(variables: unknown): boolean;
8
10
  * Whether the given GraphQL document contains at least one mutation
9
11
  */
10
12
  export declare function isMutation(query: DocumentNode): boolean;
13
+ export declare const naturalExtractFiles: ExtractFiles;
14
+ /**
15
+ * Create an Apollo link that supports batched queries and file uploads.
16
+ *
17
+ * File uploads and mutations are never batched.
18
+ */
19
+ export declare function createHttpLink(httpLink: HttpLink, httpBatchLink: HttpBatchLink, options: Options): ApolloLink;
@@ -0,0 +1,7 @@
1
+ import { HttpInterceptorFn } from '@angular/common/http';
2
+ /**
3
+ * Sign all HTTP POST requests that are GraphQL queries against `/graphql` endpoint with a custom signature.
4
+ *
5
+ * The server will validate the signature before executing the GraphQL query.
6
+ */
7
+ export declare function graphqlQuerySigner(key: string): HttpInterceptorFn;
@@ -1,16 +1,14 @@
1
1
  import { AbstractControl } from '@angular/forms';
2
- import { NaturalAbstractController } from '../classes/abstract-controller';
3
2
  import * as i0 from "@angular/core";
4
3
  /**
5
- * Need to add http:// prefix if we don't have prefix already AND we don't have part of it
4
+ * Need to add http:// prefix if we don't have prefix already AND we don't have part of it
6
5
  */
7
6
  export declare function ensureHttpPrefix(value: string | null): string | null;
8
7
  /**
9
8
  * This directive only supports ReactiveForms due to ngModel/ngControl encapsulation and changes emissions.
10
9
  */
11
- export declare class NaturalHttpPrefixDirective extends NaturalAbstractController {
10
+ export declare class NaturalHttpPrefixDirective {
12
11
  naturalHttpPrefix: AbstractControl | null;
13
- constructor();
14
12
  httpize($event: string): void;
15
13
  static ɵfac: i0.ɵɵFactoryDeclaration<NaturalHttpPrefixDirective, never>;
16
14
  static ɵdir: i0.ɵɵDirectiveDeclaration<NaturalHttpPrefixDirective, "[naturalHttpPrefix]", never, { "naturalHttpPrefix": { "alias": "naturalHttpPrefix"; "required": false; }; }, {}, never, never, true, never>;
@@ -1,30 +1,14 @@
1
- import { OnDestroy } from '@angular/core';
2
- import { FormControl } from '@angular/forms';
3
- import { BehaviorSubject } from 'rxjs';
4
- import { NaturalAbstractController } from '../../../classes/abstract-controller';
5
- import { FilterGroupConditionField } from '../../search/classes/graphql-doctrine.types';
6
1
  import { NaturalDropdownData } from '../../search/dropdown-container/dropdown.service';
7
2
  import { DropdownComponent } from '../../search/types/dropdown-component';
3
+ import { TypeOptionsComponent } from '../type-options/type-options.component';
4
+ import { NaturalDropdownRef } from '../../search/dropdown-container/dropdown-ref';
8
5
  import * as i0 from "@angular/core";
9
6
  export interface TypeBooleanConfiguration {
10
7
  displayWhenActive: string;
11
8
  displayWhenInactive: string;
12
9
  }
13
- export declare class TypeBooleanComponent extends NaturalAbstractController implements DropdownComponent, OnDestroy {
14
- readonly renderedValue: BehaviorSubject<string>;
15
- readonly formControl: FormControl<boolean>;
16
- readonly configuration: Required<TypeBooleanConfiguration>;
17
- private readonly defaults;
18
- constructor(data: NaturalDropdownData<TypeBooleanConfiguration>);
19
- getCondition(): FilterGroupConditionField;
20
- /**
21
- * Always valid because checked and unchecked are both valid values
22
- */
23
- isValid(): boolean;
24
- /**
25
- * Always dirty because even on dropdown opening, the default value is accepted as intentional. There is no "default/empty" state
26
- */
27
- isDirty(): boolean;
10
+ export declare class TypeBooleanComponent extends TypeOptionsComponent implements DropdownComponent {
11
+ constructor(data: NaturalDropdownData<TypeBooleanConfiguration>, dropdownRef: NaturalDropdownRef);
28
12
  static ɵfac: i0.ɵɵFactoryDeclaration<TypeBooleanComponent, never>;
29
13
  static ɵcmp: i0.ɵɵComponentDeclaration<TypeBooleanComponent, "ng-component", never, {}, {}, never, never, true, never>;
30
14
  }
@@ -1,7 +1,5 @@
1
- import { OnDestroy } from '@angular/core';
2
1
  import { FormControl } from '@angular/forms';
3
2
  import { BehaviorSubject } from 'rxjs';
4
- import { NaturalAbstractController } from '../../../classes/abstract-controller';
5
3
  import { Literal } from '../../../types/types';
6
4
  import { FilterGroupConditionField } from '../../search/classes/graphql-doctrine.types';
7
5
  import { NaturalDropdownRef } from '../../search/dropdown-container/dropdown-ref';
@@ -15,7 +13,8 @@ export interface TypeOption {
15
13
  export interface TypeOptionsConfiguration {
16
14
  options: TypeOption[];
17
15
  }
18
- export declare class TypeOptionsComponent extends NaturalAbstractController implements DropdownComponent, OnDestroy {
16
+ export declare class TypeOptionsComponent implements DropdownComponent {
17
+ data: NaturalDropdownData<TypeOptionsConfiguration>;
19
18
  protected dropdownRef: NaturalDropdownRef;
20
19
  readonly renderedValue: BehaviorSubject<string>;
21
20
  readonly formControl: FormControl<TypeOption>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecodev/natural",
3
- "version": "53.3.2",
3
+ "version": "54.0.0",
4
4
  "license": "MIT",
5
5
  "repository": "github:Ecodev/natural",
6
6
  "sideEffects": false,
@@ -17,6 +17,8 @@
17
17
  }
18
18
  },
19
19
  "dependencies": {
20
+ "crypto-es": "^2.0.3",
21
+ "extract-files": "^13.0.0",
20
22
  "tslib": "^2.5.3"
21
23
  },
22
24
  "peerDependencies": {
package/public-api.d.ts CHANGED
@@ -4,7 +4,7 @@ export * from './lib/classes/abstract-detail';
4
4
  export * from './lib/classes/abstract-editable-list';
5
5
  export * from './lib/classes/abstract-list';
6
6
  export * from './lib/classes/abstract-navigable-list';
7
- export { hasFilesAndProcessDate, isMutation } from './lib/classes/apollo-utils';
7
+ export { createHttpLink } from './lib/classes/apollo-utils';
8
8
  export * from './lib/classes/data-source';
9
9
  export * from './lib/classes/query-variable-manager';
10
10
  export * from './lib/classes/rxjs';
@@ -41,3 +41,4 @@ export * from './lib/modules/matomo/public-api';
41
41
  export * from './lib/modules/logger/public-api';
42
42
  export * from './lib/directives/http-prefix.directive';
43
43
  export { naturalProviders } from './lib/classes/providers';
44
+ export { graphqlQuerySigner } from './lib/classes/signing';