@foris/avocado-not-front 8.5.0 → 8.6.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.
@@ -29,10 +29,16 @@ export type NotFrontPaginationKeys = {
29
29
  text?: string;
30
30
  size?: string;
31
31
  };
32
+ export type NotFrontRestDataSourceEncoding = 'json' | 'multipart';
33
+ /** Client-only marker in REST `data`; resolved from flow `entries` at fetch time. */
34
+ export interface NotFrontFileFromStateRef {
35
+ __fileFromState: string;
36
+ }
32
37
  export interface NotFrontDataSourceRest extends BaseDataSource {
33
38
  type: 'rest';
34
39
  data?: any;
35
40
  paginationKeys?: NotFrontPaginationKeys;
41
+ encoding?: NotFrontRestDataSourceEncoding;
36
42
  }
37
43
  export interface NotFrontDataSourceGraphQL extends BaseDataSource {
38
44
  type: 'graphql';
@@ -0,0 +1,21 @@
1
+ import type { NotFrontDataSourceRest, NotFrontFileFromStateRef, NotFrontRestDataSourceEncoding } from '../types/componentsCore.type';
2
+ export declare class NotFrontRestDataSourceError extends Error {
3
+ constructor(message: string);
4
+ }
5
+ export type NotFrontFileMetadata = {
6
+ __notFrontFile: {
7
+ name: string;
8
+ size: number;
9
+ type: string;
10
+ };
11
+ };
12
+ export declare const getRestDataSourceEncoding: (dataSource: NotFrontDataSourceRest) => NotFrontRestDataSourceEncoding;
13
+ export declare const isNotFrontFileFromStateRef: (value: unknown) => value is NotFrontFileFromStateRef;
14
+ export declare const resolveRestDataSourceData: (data: unknown, entries: Record<string, unknown>, encoding: NotFrontRestDataSourceEncoding) => unknown;
15
+ export declare const buildMultipartFormData: (resolvedData: Record<string, unknown>) => FormData;
16
+ export declare const sanitizeStateForNextUI: (entries: Record<string, unknown>) => Record<string, unknown>;
17
+ export declare const stripContentTypeHeader: (headers: Record<string, string> | undefined) => Record<string, string>;
18
+ export declare const prepareRestDataSourceRequest: (dataSource: NotFrontDataSourceRest, entries: Record<string, unknown>) => {
19
+ body: unknown;
20
+ headers: Record<string, string>;
21
+ };