@salesforce/lds-network-nimbus 1.124.2 → 1.124.4
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.
- package/dist/main.js +752 -752
- package/dist/{main.d.ts → types/main.d.ts} +3 -3
- package/dist/{network → types/network}/NimbusNetworkAdapter.d.ts +2 -2
- package/dist/{network → types/network}/__mocks__/o11y/activity.d.ts +2 -2
- package/dist/{network → types/network}/__mocks__/o11y/client.d.ts +5 -5
- package/dist/{network → types/network}/__mocks__/o11y/idleDetector.d.ts +2 -2
- package/dist/{network → types/network}/__mocks__/o11y/instrumentation.d.ts +15 -15
- package/dist/{network → types/network}/networkUtils.d.ts +4 -4
- package/dist/{network → types/network}/record-field-batching/ScopedFields.d.ts +44 -44
- package/dist/{network → types/network}/record-field-batching/makeNetworkAdapterChunkRecordFields.d.ts +9 -9
- package/dist/{network → types/network}/record-field-batching/makeNetworkChunkFieldsGetRecord.d.ts +15 -15
- package/dist/{network → types/network}/record-field-batching/makeNetworkChunkFieldsGetRecordsBatch.d.ts +7 -7
- package/dist/{network → types/network}/record-field-batching/makeNetworkChunkFieldsGetRelatedListRecords.d.ts +22 -22
- package/dist/{network → types/network}/record-field-batching/makeNetworkChunkFieldsGetRelatedListRecordsBatch.d.ts +6 -6
- package/dist/{network → types/network}/record-field-batching/utils.d.ts +71 -71
- package/dist/{utils → types/utils}/language.d.ts +29 -29
- package/package.json +3 -3
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { NimbusNetworkAdapter } from './network/NimbusNetworkAdapter';
|
|
2
|
-
export { makeNetworkAdapterChunkRecordFields } from './network/record-field-batching/makeNetworkAdapterChunkRecordFields';
|
|
3
|
-
export { CompositeResponseEnvelope } from './network/record-field-batching/utils';
|
|
1
|
+
export { NimbusNetworkAdapter } from './network/NimbusNetworkAdapter';
|
|
2
|
+
export { makeNetworkAdapterChunkRecordFields } from './network/record-field-batching/makeNetworkAdapterChunkRecordFields';
|
|
3
|
+
export { CompositeResponseEnvelope } from './network/record-field-batching/utils';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { NetworkAdapter } from '@luvio/engine';
|
|
2
|
-
export declare const NimbusNetworkAdapter: NetworkAdapter;
|
|
1
|
+
import type { NetworkAdapter } from '@luvio/engine';
|
|
2
|
+
export declare const NimbusNetworkAdapter: NetworkAdapter;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Activity } from 'o11y/client';
|
|
2
|
-
export declare const activity: Activity;
|
|
1
|
+
import type { Activity } from 'o11y/client';
|
|
2
|
+
export declare const activity: Activity;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Instrumentation } from 'o11y/client';
|
|
2
|
-
export { activity } from './activity';
|
|
3
|
-
export { instrumentation } from './instrumentation';
|
|
4
|
-
export { idleDetector } from './idleDetector';
|
|
5
|
-
export declare function getInstrumentation(_name: string): Instrumentation;
|
|
1
|
+
import type { Instrumentation } from 'o11y/client';
|
|
2
|
+
export { activity } from './activity';
|
|
3
|
+
export { instrumentation } from './instrumentation';
|
|
4
|
+
export { idleDetector } from './idleDetector';
|
|
5
|
+
export declare function getInstrumentation(_name: string): Instrumentation;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { IdleDetector } from 'o11y/client';
|
|
2
|
-
export declare const idleDetector: IdleDetector;
|
|
1
|
+
import type { IdleDetector } from 'o11y/client';
|
|
2
|
+
export declare const idleDetector: IdleDetector;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { Activity, MetricsTags, Schema, SchematizedData } from 'o11y/client';
|
|
2
|
-
declare function log(_schema: Schema, _data?: SchematizedData): void;
|
|
3
|
-
declare function error(_err: Error, _userSchemaOrText?: string, _data?: SchematizedData): void;
|
|
4
|
-
declare function startActivity(_name: string): Activity;
|
|
5
|
-
declare function incrementCounter(_operation: string, _increment?: number, _hasError?: boolean, _tags?: MetricsTags): void;
|
|
6
|
-
declare function trackValue(_operation: string, _value: number, _hasError?: boolean, _tags?: MetricsTags): void;
|
|
7
|
-
export declare const instrumentation: {
|
|
8
|
-
log: typeof log;
|
|
9
|
-
error: typeof error;
|
|
10
|
-
startActivity: typeof startActivity;
|
|
11
|
-
incrementCounter: typeof incrementCounter;
|
|
12
|
-
trackValue: typeof trackValue;
|
|
13
|
-
};
|
|
14
|
-
export declare const METRIC_KEYS: {};
|
|
15
|
-
export {};
|
|
1
|
+
import type { Activity, MetricsTags, Schema, SchematizedData } from 'o11y/client';
|
|
2
|
+
declare function log(_schema: Schema, _data?: SchematizedData): void;
|
|
3
|
+
declare function error(_err: Error, _userSchemaOrText?: string, _data?: SchematizedData): void;
|
|
4
|
+
declare function startActivity(_name: string): Activity;
|
|
5
|
+
declare function incrementCounter(_operation: string, _increment?: number, _hasError?: boolean, _tags?: MetricsTags): void;
|
|
6
|
+
declare function trackValue(_operation: string, _value: number, _hasError?: boolean, _tags?: MetricsTags): void;
|
|
7
|
+
export declare const instrumentation: {
|
|
8
|
+
log: typeof log;
|
|
9
|
+
error: typeof error;
|
|
10
|
+
startActivity: typeof startActivity;
|
|
11
|
+
incrementCounter: typeof incrementCounter;
|
|
12
|
+
trackValue: typeof trackValue;
|
|
13
|
+
};
|
|
14
|
+
export declare const METRIC_KEYS: {};
|
|
15
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Request, Response } from '@salesforce/nimbus-plugin-lds';
|
|
2
|
-
import type { ResourceRequest, FetchResponse, ResourceRequestContext } from '@luvio/engine';
|
|
3
|
-
export declare function buildNimbusNetworkPluginRequest(resourceRequest: ResourceRequest, resourceRequestContext: ResourceRequestContext): Request;
|
|
4
|
-
export declare function buildLdsResponse(response: Response): FetchResponse<any>;
|
|
1
|
+
import type { Request, Response } from '@salesforce/nimbus-plugin-lds';
|
|
2
|
+
import type { ResourceRequest, FetchResponse, ResourceRequestContext } from '@luvio/engine';
|
|
3
|
+
export declare function buildNimbusNetworkPluginRequest(resourceRequest: ResourceRequest, resourceRequestContext: ResourceRequestContext): Request;
|
|
4
|
+
export declare function buildLdsResponse(response: Response): FetchResponse<any>;
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
export declare class ScopedFields {
|
|
2
|
-
scope: string;
|
|
3
|
-
fields: Record<string, true>;
|
|
4
|
-
constructor(scope: string, fields: Array<string>);
|
|
5
|
-
isUnScoped(): boolean;
|
|
6
|
-
addField(field: string): void;
|
|
7
|
-
addFields(fields: Array<string>): void;
|
|
8
|
-
toQueryParameterValue(): string;
|
|
9
|
-
toQueryParams(): string | string[];
|
|
10
|
-
/**
|
|
11
|
-
* parse Contacts:Contact.Id,Contact.Name into a QueryFields
|
|
12
|
-
*/
|
|
13
|
-
static fromQueryParameterValue(paramValue: string): ScopedFields | undefined;
|
|
14
|
-
}
|
|
15
|
-
export declare class ScopedFieldsCollection {
|
|
16
|
-
listIdToFieldsMap: Record<string, ScopedFields>;
|
|
17
|
-
/**
|
|
18
|
-
* merge the from ScopedFieldsCollection into current one
|
|
19
|
-
* @param from
|
|
20
|
-
*/
|
|
21
|
-
merge(from: ScopedFieldsCollection): void;
|
|
22
|
-
toQueryParams(): string | string[];
|
|
23
|
-
/**
|
|
24
|
-
* convert to query parameter value
|
|
25
|
-
* @returns
|
|
26
|
-
*/
|
|
27
|
-
toQueryParameterValue(): string;
|
|
28
|
-
/**
|
|
29
|
-
* split the ScopedFields into multiple ScopedFields
|
|
30
|
-
* which there max fields list length will not exceeded the specified maxLength
|
|
31
|
-
* @param maxLength
|
|
32
|
-
*/
|
|
33
|
-
split(maxLength?: number): Array<ScopedFieldsCollection>;
|
|
34
|
-
size(): number;
|
|
35
|
-
countOfUnScoped(): number;
|
|
36
|
-
countOfScoped(): number;
|
|
37
|
-
isUnScopedMixedWithScoped(): boolean;
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
40
|
-
* @param paramValue like Contacts:Contact.Id,Contact.Name;Opportunities:Opportunity.Id
|
|
41
|
-
* @returns
|
|
42
|
-
*/
|
|
43
|
-
static fromQueryParameterValue(paramValue: String | null): ScopedFieldsCollection;
|
|
44
|
-
}
|
|
1
|
+
export declare class ScopedFields {
|
|
2
|
+
scope: string;
|
|
3
|
+
fields: Record<string, true>;
|
|
4
|
+
constructor(scope: string, fields: Array<string>);
|
|
5
|
+
isUnScoped(): boolean;
|
|
6
|
+
addField(field: string): void;
|
|
7
|
+
addFields(fields: Array<string>): void;
|
|
8
|
+
toQueryParameterValue(): string;
|
|
9
|
+
toQueryParams(): string | string[];
|
|
10
|
+
/**
|
|
11
|
+
* parse Contacts:Contact.Id,Contact.Name into a QueryFields
|
|
12
|
+
*/
|
|
13
|
+
static fromQueryParameterValue(paramValue: string): ScopedFields | undefined;
|
|
14
|
+
}
|
|
15
|
+
export declare class ScopedFieldsCollection {
|
|
16
|
+
listIdToFieldsMap: Record<string, ScopedFields>;
|
|
17
|
+
/**
|
|
18
|
+
* merge the from ScopedFieldsCollection into current one
|
|
19
|
+
* @param from
|
|
20
|
+
*/
|
|
21
|
+
merge(from: ScopedFieldsCollection): void;
|
|
22
|
+
toQueryParams(): string | string[];
|
|
23
|
+
/**
|
|
24
|
+
* convert to query parameter value
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
toQueryParameterValue(): string;
|
|
28
|
+
/**
|
|
29
|
+
* split the ScopedFields into multiple ScopedFields
|
|
30
|
+
* which there max fields list length will not exceeded the specified maxLength
|
|
31
|
+
* @param maxLength
|
|
32
|
+
*/
|
|
33
|
+
split(maxLength?: number): Array<ScopedFieldsCollection>;
|
|
34
|
+
size(): number;
|
|
35
|
+
countOfUnScoped(): number;
|
|
36
|
+
countOfScoped(): number;
|
|
37
|
+
isUnScopedMixedWithScoped(): boolean;
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* @param paramValue like Contacts:Contact.Id,Contact.Name;Opportunities:Opportunity.Id
|
|
41
|
+
* @returns
|
|
42
|
+
*/
|
|
43
|
+
static fromQueryParameterValue(paramValue: String | null): ScopedFieldsCollection;
|
|
44
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { NetworkAdapter } from '@luvio/engine';
|
|
2
|
-
/**
|
|
3
|
-
* Higher order function that accepts a network adapter and returns a new network adapter
|
|
4
|
-
* that is capable of performing field batching to ensure that URL length limits are respected
|
|
5
|
-
* when hitting record endpoints that accept a field list
|
|
6
|
-
*
|
|
7
|
-
* @param networkAdapter the network adapter to do the call.
|
|
8
|
-
*/
|
|
9
|
-
export declare function makeNetworkAdapterChunkRecordFields(networkAdapter: NetworkAdapter): NetworkAdapter;
|
|
1
|
+
import type { NetworkAdapter } from '@luvio/engine';
|
|
2
|
+
/**
|
|
3
|
+
* Higher order function that accepts a network adapter and returns a new network adapter
|
|
4
|
+
* that is capable of performing field batching to ensure that URL length limits are respected
|
|
5
|
+
* when hitting record endpoints that accept a field list
|
|
6
|
+
*
|
|
7
|
+
* @param networkAdapter the network adapter to do the call.
|
|
8
|
+
*/
|
|
9
|
+
export declare function makeNetworkAdapterChunkRecordFields(networkAdapter: NetworkAdapter): NetworkAdapter;
|
package/dist/{network → types/network}/record-field-batching/makeNetworkChunkFieldsGetRecord.d.ts
RENAMED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { NetworkAdapter, FetchResponse } from '@luvio/engine';
|
|
2
|
-
import type { RecordRepresentation } from '@salesforce/lds-adapters-uiapi';
|
|
3
|
-
import type { AggregateResponse, UiApiErrorResponse } from './utils';
|
|
4
|
-
export type GetRecordResult = RecordRepresentation | UiApiErrorResponse;
|
|
5
|
-
export type GetRecordAggregateResponse = AggregateResponse<GetRecordResult>;
|
|
6
|
-
export type GetRecordResponse = FetchResponse<GetRecordResult>;
|
|
7
|
-
/**
|
|
8
|
-
* Export to facilitate unit tests
|
|
9
|
-
* Merge the second getRecord result into the first one.
|
|
10
|
-
* If any is error response, merged result is error response.
|
|
11
|
-
* If both are sucesses, due to they are from same records,
|
|
12
|
-
* fields sub node will be merged recursively
|
|
13
|
-
*/
|
|
14
|
-
export declare function mergeGetRecordResult(first: GetRecordResult, second: GetRecordResult): GetRecordResult;
|
|
15
|
-
export declare function makeNetworkChunkFieldsGetRecord(networkAdapter: NetworkAdapter): NetworkAdapter;
|
|
1
|
+
import type { NetworkAdapter, FetchResponse } from '@luvio/engine';
|
|
2
|
+
import type { RecordRepresentation } from '@salesforce/lds-adapters-uiapi';
|
|
3
|
+
import type { AggregateResponse, UiApiErrorResponse } from './utils';
|
|
4
|
+
export type GetRecordResult = RecordRepresentation | UiApiErrorResponse;
|
|
5
|
+
export type GetRecordAggregateResponse = AggregateResponse<GetRecordResult>;
|
|
6
|
+
export type GetRecordResponse = FetchResponse<GetRecordResult>;
|
|
7
|
+
/**
|
|
8
|
+
* Export to facilitate unit tests
|
|
9
|
+
* Merge the second getRecord result into the first one.
|
|
10
|
+
* If any is error response, merged result is error response.
|
|
11
|
+
* If both are sucesses, due to they are from same records,
|
|
12
|
+
* fields sub node will be merged recursively
|
|
13
|
+
*/
|
|
14
|
+
export declare function mergeGetRecordResult(first: GetRecordResult, second: GetRecordResult): GetRecordResult;
|
|
15
|
+
export declare function makeNetworkChunkFieldsGetRecord(networkAdapter: NetworkAdapter): NetworkAdapter;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { FetchResponse, NetworkAdapter } from '@luvio/engine';
|
|
2
|
-
import type { BatchRepresentation } from '@salesforce/lds-adapters-uiapi';
|
|
3
|
-
import type { AggregateResponse } from './utils';
|
|
4
|
-
export declare const RECORDS_BATCH_ENDPOINT_REGEX: RegExp;
|
|
5
|
-
export type GetRecordsBatchAggregateResponse = AggregateResponse<BatchRepresentation>;
|
|
6
|
-
export type GetRecordsBatchResponse = FetchResponse<BatchRepresentation>;
|
|
7
|
-
export declare function makeNetworkChunkFieldsGetRecordsBatch(networkAdapter: NetworkAdapter): NetworkAdapter;
|
|
1
|
+
import type { FetchResponse, NetworkAdapter } from '@luvio/engine';
|
|
2
|
+
import type { BatchRepresentation } from '@salesforce/lds-adapters-uiapi';
|
|
3
|
+
import type { AggregateResponse } from './utils';
|
|
4
|
+
export declare const RECORDS_BATCH_ENDPOINT_REGEX: RegExp;
|
|
5
|
+
export type GetRecordsBatchAggregateResponse = AggregateResponse<BatchRepresentation>;
|
|
6
|
+
export type GetRecordsBatchResponse = FetchResponse<BatchRepresentation>;
|
|
7
|
+
export declare function makeNetworkChunkFieldsGetRecordsBatch(networkAdapter: NetworkAdapter): NetworkAdapter;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import type { NetworkAdapter } from '@luvio/engine';
|
|
2
|
-
import type { AggregateResponse } from './utils';
|
|
3
|
-
import type { RelatedListRecordCollectionRepresentation } from '@salesforce/lds-adapters-uiapi';
|
|
4
|
-
export type RelatedListAggregateResponse = AggregateResponse<RelatedListRecordCollectionRepresentation>;
|
|
5
|
-
/**
|
|
6
|
-
* Merge the second related list record collection into first one and return it.
|
|
7
|
-
* It checks both collections should have exaction same records, otherwise error.
|
|
8
|
-
* Exports it for unit tests
|
|
9
|
-
*/
|
|
10
|
-
export declare function mergeRelatedRecordsFields(first: RelatedListRecordCollectionRepresentation, second: RelatedListRecordCollectionRepresentation): RelatedListRecordCollectionRepresentation;
|
|
11
|
-
export declare function makeNetworkChunkFieldsGetRelatedListRecords(networkAdapter: NetworkAdapter): NetworkAdapter;
|
|
12
|
-
/**
|
|
13
|
-
* merge to paging url with different set of fields or optional fields as combined one
|
|
14
|
-
* the paging url is like
|
|
15
|
-
* /services/data/v58.0/ui-api/related-list-records/001R0000006l1xKIAQ/Contacts
|
|
16
|
-
* ?fields=Id%2CName&optionalFields=Contact.Id%2CContact.Name&pageSize=50&pageToken=0
|
|
17
|
-
* @param path1 url path and query parmeter without domain
|
|
18
|
-
* @param path2 url path and query parmeter without domain
|
|
19
|
-
*
|
|
20
|
-
* Export to unit test
|
|
21
|
-
*/
|
|
22
|
-
export declare function mergeUrl(path1: string | null, path2: string | null): string | null;
|
|
1
|
+
import type { NetworkAdapter } from '@luvio/engine';
|
|
2
|
+
import type { AggregateResponse } from './utils';
|
|
3
|
+
import type { RelatedListRecordCollectionRepresentation } from '@salesforce/lds-adapters-uiapi';
|
|
4
|
+
export type RelatedListAggregateResponse = AggregateResponse<RelatedListRecordCollectionRepresentation>;
|
|
5
|
+
/**
|
|
6
|
+
* Merge the second related list record collection into first one and return it.
|
|
7
|
+
* It checks both collections should have exaction same records, otherwise error.
|
|
8
|
+
* Exports it for unit tests
|
|
9
|
+
*/
|
|
10
|
+
export declare function mergeRelatedRecordsFields(first: RelatedListRecordCollectionRepresentation, second: RelatedListRecordCollectionRepresentation): RelatedListRecordCollectionRepresentation;
|
|
11
|
+
export declare function makeNetworkChunkFieldsGetRelatedListRecords(networkAdapter: NetworkAdapter): NetworkAdapter;
|
|
12
|
+
/**
|
|
13
|
+
* merge to paging url with different set of fields or optional fields as combined one
|
|
14
|
+
* the paging url is like
|
|
15
|
+
* /services/data/v58.0/ui-api/related-list-records/001R0000006l1xKIAQ/Contacts
|
|
16
|
+
* ?fields=Id%2CName&optionalFields=Contact.Id%2CContact.Name&pageSize=50&pageToken=0
|
|
17
|
+
* @param path1 url path and query parmeter without domain
|
|
18
|
+
* @param path2 url path and query parmeter without domain
|
|
19
|
+
*
|
|
20
|
+
* Export to unit test
|
|
21
|
+
*/
|
|
22
|
+
export declare function mergeUrl(path1: string | null, path2: string | null): string | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { FetchResponse, NetworkAdapter } from '@luvio/engine';
|
|
2
|
-
import type { AggregateResponse } from './utils';
|
|
3
|
-
import type { RelatedListRecordCollectionBatchRepresentation } from '@salesforce/lds-adapters-uiapi';
|
|
4
|
-
export type RelatedListBatchAggregateResponse = AggregateResponse<RelatedListRecordCollectionBatchRepresentation>;
|
|
5
|
-
export type RelatedListBatchResponse = FetchResponse<RelatedListRecordCollectionBatchRepresentation>;
|
|
6
|
-
export declare function makeNetworkChunkFieldsGetRelatedListRecordsBatch(networkAdapter: NetworkAdapter): NetworkAdapter;
|
|
1
|
+
import type { FetchResponse, NetworkAdapter } from '@luvio/engine';
|
|
2
|
+
import type { AggregateResponse } from './utils';
|
|
3
|
+
import type { RelatedListRecordCollectionBatchRepresentation } from '@salesforce/lds-adapters-uiapi';
|
|
4
|
+
export type RelatedListBatchAggregateResponse = AggregateResponse<RelatedListRecordCollectionBatchRepresentation>;
|
|
5
|
+
export type RelatedListBatchResponse = FetchResponse<RelatedListRecordCollectionBatchRepresentation>;
|
|
6
|
+
export declare function makeNetworkChunkFieldsGetRelatedListRecordsBatch(networkAdapter: NetworkAdapter): NetworkAdapter;
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
import type { ResourceRequest, FetchResponse } from '@luvio/engine';
|
|
2
|
-
import { HttpStatusCode } from '@luvio/engine';
|
|
3
|
-
import type { RecordRepresentation, BatchRepresentation, RelatedListRecordCollectionRepresentation, RelatedListRecordCollectionBatchRepresentation } from '@salesforce/lds-adapters-uiapi';
|
|
4
|
-
import type { GetRecordResult } from './makeNetworkChunkFieldsGetRecord';
|
|
5
|
-
import { ScopedFieldsCollection } from './ScopedFields';
|
|
6
|
-
export declare const MAX_STRING_LENGTH_PER_CHUNK = 10000;
|
|
7
|
-
export interface CompositeRequest {
|
|
8
|
-
url: string;
|
|
9
|
-
referenceId: string;
|
|
10
|
-
}
|
|
11
|
-
interface UiApiClientOptions {
|
|
12
|
-
ifModifiedSince?: string;
|
|
13
|
-
ifUnmodifiedSince?: string;
|
|
14
|
-
}
|
|
15
|
-
export interface UiApiParams {
|
|
16
|
-
[name: string]: any;
|
|
17
|
-
clientOptions?: UiApiClientOptions;
|
|
18
|
-
}
|
|
19
|
-
export interface UiApiError {
|
|
20
|
-
errorCode: string;
|
|
21
|
-
message: string;
|
|
22
|
-
}
|
|
23
|
-
export type UiApiErrorResponse = Array<UiApiError>;
|
|
24
|
-
export type CompositeResponse<T> = {
|
|
25
|
-
body: T;
|
|
26
|
-
httpStatusCode: HttpStatusCode;
|
|
27
|
-
};
|
|
28
|
-
export interface CompositeResponseEnvelope<T> {
|
|
29
|
-
compositeResponse: CompositeResponse<T | UiApiErrorResponse>[];
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Object Representation types allowed when merging
|
|
33
|
-
*/
|
|
34
|
-
type SupportedAggregateRepresentation<T> = Extract<T, GetRecordResult | BatchRepresentation | RelatedListRecordCollectionRepresentation | RelatedListRecordCollectionBatchRepresentation>;
|
|
35
|
-
export type AggregateResponse<T> = FetchResponse<CompositeResponseEnvelope<SupportedAggregateRepresentation<T>>>;
|
|
36
|
-
/**
|
|
37
|
-
* Supported batch representation
|
|
38
|
-
*/
|
|
39
|
-
type SupportedBatchRepresentation = RelatedListRecordCollectionBatchRepresentation | BatchRepresentation;
|
|
40
|
-
/**
|
|
41
|
-
* Supported batch representation
|
|
42
|
-
*/
|
|
43
|
-
type SupportedBatchCollectionRepresentation = RelatedListRecordCollectionRepresentation | RecordRepresentation;
|
|
44
|
-
/**
|
|
45
|
-
* merge the aggregate ui child responses into a single object representation
|
|
46
|
-
* @param response
|
|
47
|
-
* @param mergeFunc the function used to define how the records should be merged together
|
|
48
|
-
* @returns the merged record
|
|
49
|
-
*/
|
|
50
|
-
export declare function mergeAggregateUiResponse<T>(response: AggregateResponse<T>, mergeFunc: (first: T, second: T) => SupportedAggregateRepresentation<T>): FetchResponse<SupportedAggregateRepresentation<T> | UiApiErrorResponse>;
|
|
51
|
-
export declare function buildAggregateUiUrl(params: UiApiParams, resourceRequest: ResourceRequest): string;
|
|
52
|
-
export declare function shouldUseAggregateUiForFields(fieldsArray: string, optionalFieldsArray: string): boolean;
|
|
53
|
-
export declare function isSpanningRecord(fieldValue: null | string | number | boolean | RecordRepresentation): fieldValue is RecordRepresentation;
|
|
54
|
-
export declare function mergeRecordFields(first: RecordRepresentation, second: RecordRepresentation): RecordRepresentation;
|
|
55
|
-
export declare function mergeBatchRecordsFields(first: SupportedBatchRepresentation, second: SupportedBatchRepresentation, collectionMergeFunc: (first: SupportedBatchCollectionRepresentation, second: SupportedBatchCollectionRepresentation) => SupportedBatchCollectionRepresentation): SupportedBatchRepresentation;
|
|
56
|
-
/**
|
|
57
|
-
* Check to see if we have fields that are > max allowed characters long
|
|
58
|
-
* @param resourceRequest resource request to check
|
|
59
|
-
* @param endpoint Regular Expression to check the endpoint to aggregate
|
|
60
|
-
* @returns undefined if we should not aggregate. object if we should.
|
|
61
|
-
*/
|
|
62
|
-
export declare function createAggregateBatchRequestInfo(resourceRequest: ResourceRequest, endpoint: RegExp): {
|
|
63
|
-
fieldCollection: ScopedFieldsCollection[];
|
|
64
|
-
optionalFieldCollection: ScopedFieldsCollection[];
|
|
65
|
-
} | undefined;
|
|
66
|
-
export declare function createAggregateUiRequest(resourceRequest: ResourceRequest, compositeRequest: CompositeRequest[]): ResourceRequest;
|
|
67
|
-
export declare function buildCompositeRequestByFields(referenceId: string, resourceRequest: ResourceRequest, recordsCompositeRequest: {
|
|
68
|
-
fieldCollection: ScopedFieldsCollection[] | undefined;
|
|
69
|
-
optionalFieldCollection: ScopedFieldsCollection[] | undefined;
|
|
70
|
-
}): CompositeRequest[];
|
|
71
|
-
export {};
|
|
1
|
+
import type { ResourceRequest, FetchResponse } from '@luvio/engine';
|
|
2
|
+
import { HttpStatusCode } from '@luvio/engine';
|
|
3
|
+
import type { RecordRepresentation, BatchRepresentation, RelatedListRecordCollectionRepresentation, RelatedListRecordCollectionBatchRepresentation } from '@salesforce/lds-adapters-uiapi';
|
|
4
|
+
import type { GetRecordResult } from './makeNetworkChunkFieldsGetRecord';
|
|
5
|
+
import { ScopedFieldsCollection } from './ScopedFields';
|
|
6
|
+
export declare const MAX_STRING_LENGTH_PER_CHUNK = 10000;
|
|
7
|
+
export interface CompositeRequest {
|
|
8
|
+
url: string;
|
|
9
|
+
referenceId: string;
|
|
10
|
+
}
|
|
11
|
+
interface UiApiClientOptions {
|
|
12
|
+
ifModifiedSince?: string;
|
|
13
|
+
ifUnmodifiedSince?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface UiApiParams {
|
|
16
|
+
[name: string]: any;
|
|
17
|
+
clientOptions?: UiApiClientOptions;
|
|
18
|
+
}
|
|
19
|
+
export interface UiApiError {
|
|
20
|
+
errorCode: string;
|
|
21
|
+
message: string;
|
|
22
|
+
}
|
|
23
|
+
export type UiApiErrorResponse = Array<UiApiError>;
|
|
24
|
+
export type CompositeResponse<T> = {
|
|
25
|
+
body: T;
|
|
26
|
+
httpStatusCode: HttpStatusCode;
|
|
27
|
+
};
|
|
28
|
+
export interface CompositeResponseEnvelope<T> {
|
|
29
|
+
compositeResponse: CompositeResponse<T | UiApiErrorResponse>[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Object Representation types allowed when merging
|
|
33
|
+
*/
|
|
34
|
+
type SupportedAggregateRepresentation<T> = Extract<T, GetRecordResult | BatchRepresentation | RelatedListRecordCollectionRepresentation | RelatedListRecordCollectionBatchRepresentation>;
|
|
35
|
+
export type AggregateResponse<T> = FetchResponse<CompositeResponseEnvelope<SupportedAggregateRepresentation<T>>>;
|
|
36
|
+
/**
|
|
37
|
+
* Supported batch representation
|
|
38
|
+
*/
|
|
39
|
+
type SupportedBatchRepresentation = RelatedListRecordCollectionBatchRepresentation | BatchRepresentation;
|
|
40
|
+
/**
|
|
41
|
+
* Supported batch representation
|
|
42
|
+
*/
|
|
43
|
+
type SupportedBatchCollectionRepresentation = RelatedListRecordCollectionRepresentation | RecordRepresentation;
|
|
44
|
+
/**
|
|
45
|
+
* merge the aggregate ui child responses into a single object representation
|
|
46
|
+
* @param response
|
|
47
|
+
* @param mergeFunc the function used to define how the records should be merged together
|
|
48
|
+
* @returns the merged record
|
|
49
|
+
*/
|
|
50
|
+
export declare function mergeAggregateUiResponse<T>(response: AggregateResponse<T>, mergeFunc: (first: T, second: T) => SupportedAggregateRepresentation<T>): FetchResponse<SupportedAggregateRepresentation<T> | UiApiErrorResponse>;
|
|
51
|
+
export declare function buildAggregateUiUrl(params: UiApiParams, resourceRequest: ResourceRequest): string;
|
|
52
|
+
export declare function shouldUseAggregateUiForFields(fieldsArray: string, optionalFieldsArray: string): boolean;
|
|
53
|
+
export declare function isSpanningRecord(fieldValue: null | string | number | boolean | RecordRepresentation): fieldValue is RecordRepresentation;
|
|
54
|
+
export declare function mergeRecordFields(first: RecordRepresentation, second: RecordRepresentation): RecordRepresentation;
|
|
55
|
+
export declare function mergeBatchRecordsFields(first: SupportedBatchRepresentation, second: SupportedBatchRepresentation, collectionMergeFunc: (first: SupportedBatchCollectionRepresentation, second: SupportedBatchCollectionRepresentation) => SupportedBatchCollectionRepresentation): SupportedBatchRepresentation;
|
|
56
|
+
/**
|
|
57
|
+
* Check to see if we have fields that are > max allowed characters long
|
|
58
|
+
* @param resourceRequest resource request to check
|
|
59
|
+
* @param endpoint Regular Expression to check the endpoint to aggregate
|
|
60
|
+
* @returns undefined if we should not aggregate. object if we should.
|
|
61
|
+
*/
|
|
62
|
+
export declare function createAggregateBatchRequestInfo(resourceRequest: ResourceRequest, endpoint: RegExp): {
|
|
63
|
+
fieldCollection: ScopedFieldsCollection[];
|
|
64
|
+
optionalFieldCollection: ScopedFieldsCollection[];
|
|
65
|
+
} | undefined;
|
|
66
|
+
export declare function createAggregateUiRequest(resourceRequest: ResourceRequest, compositeRequest: CompositeRequest[]): ResourceRequest;
|
|
67
|
+
export declare function buildCompositeRequestByFields(referenceId: string, resourceRequest: ResourceRequest, recordsCompositeRequest: {
|
|
68
|
+
fieldCollection: ScopedFieldsCollection[] | undefined;
|
|
69
|
+
optionalFieldCollection: ScopedFieldsCollection[] | undefined;
|
|
70
|
+
}): CompositeRequest[];
|
|
71
|
+
export {};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
declare const keys: {
|
|
2
|
-
(o: object): string[];
|
|
3
|
-
(o: {}): string[];
|
|
4
|
-
}, create: {
|
|
5
|
-
(o: object | null): any;
|
|
6
|
-
(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
|
|
7
|
-
}, assign: {
|
|
8
|
-
<T extends {}, U>(target: T, source: U): T & U;
|
|
9
|
-
<T_1 extends {}, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V;
|
|
10
|
-
<T_2 extends {}, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W;
|
|
11
|
-
(target: object, ...sources: any[]): any;
|
|
12
|
-
}, entries: {
|
|
13
|
-
<T>(o: {
|
|
14
|
-
[s: string]: T;
|
|
15
|
-
} | ArrayLike<T>): [string, T][];
|
|
16
|
-
(o: {}): [string, any][];
|
|
17
|
-
};
|
|
18
|
-
declare const stringify: {
|
|
19
|
-
(value: any, replacer?: ((this: any, key: string, value: any) => any) | undefined, space?: string | number | undefined): string;
|
|
20
|
-
(value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string;
|
|
21
|
-
}, parse: (text: string, reviver?: ((this: any, key: string, value: any) => any) | undefined) => any;
|
|
22
|
-
declare const push: (...items: any[]) => number, join: (separator?: string | undefined) => string, slice: (start?: number | undefined, end?: number | undefined) => any[];
|
|
23
|
-
declare const isArray: (arg: any) => arg is any[], from: {
|
|
24
|
-
<T>(arrayLike: ArrayLike<T>): T[];
|
|
25
|
-
<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
|
|
26
|
-
<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
|
|
27
|
-
<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
|
|
28
|
-
};
|
|
29
|
-
export { keys as ObjectKeys, create as ObjectCreate, assign as ObjectAssign, entries as ObjectEntries, push as ArrayPrototypePush, join as ArrayPrototypeJoin, slice as ArrayPrototypeSlice, isArray as ArrayIsArray, from as ArrayFrom, stringify as JSONStringify, parse as JSONParse, };
|
|
1
|
+
declare const keys: {
|
|
2
|
+
(o: object): string[];
|
|
3
|
+
(o: {}): string[];
|
|
4
|
+
}, create: {
|
|
5
|
+
(o: object | null): any;
|
|
6
|
+
(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;
|
|
7
|
+
}, assign: {
|
|
8
|
+
<T extends {}, U>(target: T, source: U): T & U;
|
|
9
|
+
<T_1 extends {}, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V;
|
|
10
|
+
<T_2 extends {}, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W;
|
|
11
|
+
(target: object, ...sources: any[]): any;
|
|
12
|
+
}, entries: {
|
|
13
|
+
<T>(o: {
|
|
14
|
+
[s: string]: T;
|
|
15
|
+
} | ArrayLike<T>): [string, T][];
|
|
16
|
+
(o: {}): [string, any][];
|
|
17
|
+
};
|
|
18
|
+
declare const stringify: {
|
|
19
|
+
(value: any, replacer?: ((this: any, key: string, value: any) => any) | undefined, space?: string | number | undefined): string;
|
|
20
|
+
(value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string;
|
|
21
|
+
}, parse: (text: string, reviver?: ((this: any, key: string, value: any) => any) | undefined) => any;
|
|
22
|
+
declare const push: (...items: any[]) => number, join: (separator?: string | undefined) => string, slice: (start?: number | undefined, end?: number | undefined) => any[];
|
|
23
|
+
declare const isArray: (arg: any) => arg is any[], from: {
|
|
24
|
+
<T>(arrayLike: ArrayLike<T>): T[];
|
|
25
|
+
<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
|
|
26
|
+
<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
|
|
27
|
+
<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
|
|
28
|
+
};
|
|
29
|
+
export { keys as ObjectKeys, create as ObjectCreate, assign as ObjectAssign, entries as ObjectEntries, push as ArrayPrototypePush, join as ArrayPrototypeJoin, slice as ArrayPrototypeSlice, isArray as ArrayIsArray, from as ArrayFrom, stringify as JSONStringify, parse as JSONParse, };
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-network-nimbus",
|
|
3
|
-
"version": "1.124.
|
|
3
|
+
"version": "1.124.4",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "A nimbus-plugin-based implementation of the Luvio NetworkAdapter.",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"module": "dist/main.js",
|
|
8
|
-
"types": "dist/main.d.ts",
|
|
8
|
+
"types": "dist/types/main.d.ts",
|
|
9
9
|
"files": [
|
|
10
10
|
"dist"
|
|
11
11
|
],
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
-
"types": "./dist/main.d.ts",
|
|
14
|
+
"types": "./dist/types/main.d.ts",
|
|
15
15
|
"import": "./dist/main.js",
|
|
16
16
|
"default": "./dist/main.js"
|
|
17
17
|
}
|