@salesforce/lds-adapters-apex 1.261.0 → 1.262.1

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.
@@ -461,10 +461,6 @@ function splitQualifiedFieldApiName(fieldApiName) {
461
461
  }
462
462
  return [fieldApiName.substring(0, idx), fieldApiName.substring(idx + 1)];
463
463
  }
464
- function isPromise(value) {
465
- // check for Thenable due to test frameworks using custom Promise impls
466
- return value !== null && value !== undefined && typeof value.then === 'function';
467
- }
468
464
 
469
465
  function createResourceRequest(config) {
470
466
  const headers = {};
@@ -601,47 +597,6 @@ function handleSnapshot(snapshot) {
601
597
  }
602
598
  return snapshot.data;
603
599
  }
604
- /**
605
- * Takes a snapshot and returns an object that quacks like a Promise, but does so synchronously
606
- *
607
- * @param snapshot snapshot to unwrap
608
- * @returns PromiseLike
609
- */
610
- function asPromiseLike(snapshot) {
611
- if (snapshot === null) {
612
- if (process.env.NODE_ENV !== 'production') {
613
- throw new Error("Imperative adapters should never have a null snapshot... how'd y'all get here?");
614
- }
615
- }
616
- return {
617
- then: (onFulfilled, onRejected) => {
618
- try {
619
- const data = handleSnapshot(snapshot);
620
- if (onFulfilled) {
621
- return onFulfilled(data);
622
- }
623
- }
624
- catch (e) {
625
- if (onRejected) {
626
- return onRejected(e);
627
- }
628
- return {
629
- catch: (callback) => {
630
- callback(e);
631
- },
632
- };
633
- }
634
- },
635
- catch: (callback) => {
636
- try {
637
- handleSnapshot(snapshot);
638
- }
639
- catch (e) {
640
- callback(e);
641
- }
642
- },
643
- };
644
- }
645
600
  /**
646
601
  * Returns a function that executes the supplied ldsAdapter,
647
602
  * and handles unwrapping the snapshot to return to caller
@@ -652,11 +607,7 @@ function asPromiseLike(snapshot) {
652
607
  function invoker(ldsAdapter) {
653
608
  return (config, requestContext) => {
654
609
  const snapshotOrPromise = ldsAdapter(config, requestContext);
655
- if (isPromise(snapshotOrPromise)) {
656
- return Promise.resolve(snapshotOrPromise).then(handleSnapshot);
657
- }
658
- // to preserve previous behavior return a PromiseLike
659
- return asPromiseLike(snapshotOrPromise);
610
+ return Promise.resolve(snapshotOrPromise).then(handleSnapshot);
660
611
  };
661
612
  }
662
613
  const invokerFactory = (luvio, invokerParams, adapterFactory) => {
@@ -24,4 +24,3 @@ export declare function getFieldApiName(value: string | FieldId): string;
24
24
  * @return The object and field API names.
25
25
  */
26
26
  export declare function splitQualifiedFieldApiName(fieldApiName: string): string[];
27
- export declare function isPromise<D>(value: D | Promise<D> | null): value is Promise<D>;
@@ -7,18 +7,7 @@ export declare function ingestSuccess(luvio: Luvio, resourceParams: ResourceRequ
7
7
  export declare function onFetchResponseSuccess(luvio: Luvio, context: AdapterContext, _config: ApexAdapterConfig, resourceParams: ResourceRequestConfig, response: FetchResponse<any>): Promise<FulfilledSnapshot<any, any> | StaleSnapshot<any, any>>;
8
8
  export declare function onFetchResponseError(luvio: Luvio, _context: AdapterContext, _config: ApexAdapterConfig, _resourceParams: ResourceRequestConfig, response: ErrorResponse): Promise<import("@luvio/engine").ErrorSnapshot>;
9
9
  export declare function buildNetworkSnapshot(luvio: Luvio, context: AdapterContext, config: ApexAdapterConfig, options?: DispatchResourceRequestContext): Promise<Snapshot<any>>;
10
- export interface PromiseLike {
11
- then: (onFulfilled?: ((result: any) => any) | undefined, onRejected?: ((reason: any) => any) | undefined) => any;
12
- catch: (callback: any) => void;
13
- }
14
- /**
15
- * Takes a snapshot and returns an object that quacks like a Promise, but does so synchronously
16
- *
17
- * @param snapshot snapshot to unwrap
18
- * @returns PromiseLike
19
- */
20
- export declare function asPromiseLike(snapshot: Snapshot<any> | null): PromiseLike;
21
- type ApexInvoker = (config: unknown, requestContext: AdapterRequestContext) => Promise<any> | PromiseLike;
10
+ type ApexInvoker = (config: unknown, requestContext: AdapterRequestContext) => Promise<any>;
22
11
  export type ApexAdapterFactory<Config, DataType> = (luvio: Luvio, namespace: string, classname: string, method: string, isContinuation: boolean) => Adapter<Config, DataType>;
23
12
  export declare const postInvoker: (luvio: Luvio, invokerParams: ApexInvokerParams) => ApexInvoker;
24
13
  export declare const getInvoker: (luvio: Luvio, invokerParams: ApexInvokerParams) => ApexInvoker;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-adapters-apex",
3
- "version": "1.261.0",
3
+ "version": "1.262.1",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "Wire adapters for Apex",
6
6
  "main": "dist/es/es2018/apex-service.js",
@@ -19,7 +19,6 @@
19
19
  "build:karma": "rollup --bundleConfigAsCjs --config rollup.config.karma.js",
20
20
  "start": "nx build:karma && karma start",
21
21
  "test": "nx build:karma && karma start --single-run",
22
- "test:compat": "nx build:karma && karma start --single-run --compat",
23
22
  "test:unit": "jest",
24
23
  "release:corejar": "yarn build && ../core-build/scripts/core.js --adapter=lds-adapters-apex",
25
24
  "release:core": "../../scripts/release/core.js --adapter=lds-adapters-apex"
@@ -31,12 +30,12 @@
31
30
  ]
32
31
  },
33
32
  "dependencies": {
34
- "@salesforce/lds-bindings": "^1.261.0",
35
- "@salesforce/lds-default-luvio": "^1.261.0"
33
+ "@salesforce/lds-bindings": "^1.262.1",
34
+ "@salesforce/lds-default-luvio": "^1.262.1"
36
35
  },
37
36
  "devDependencies": {
38
- "@salesforce/lds-compiler-plugins": "^1.261.0",
39
- "@salesforce/lds-karma": "^1.261.0"
37
+ "@salesforce/lds-compiler-plugins": "^1.262.1",
38
+ "@salesforce/lds-karma": "^1.262.1"
40
39
  },
41
40
  "nx": {
42
41
  "targets": {
package/sfdc/index.js CHANGED
@@ -440,10 +440,6 @@ function stableJSONStringify(node) {
440
440
  }
441
441
  return '{' + out + '}';
442
442
  }
443
- function isPromise(value) {
444
- // check for Thenable due to test frameworks using custom Promise impls
445
- return value !== null && value !== undefined && typeof value.then === 'function';
446
- }
447
443
 
448
444
  function createResourceRequest(config) {
449
445
  const headers = {};
@@ -580,47 +576,6 @@ function handleSnapshot(snapshot) {
580
576
  }
581
577
  return snapshot.data;
582
578
  }
583
- /**
584
- * Takes a snapshot and returns an object that quacks like a Promise, but does so synchronously
585
- *
586
- * @param snapshot snapshot to unwrap
587
- * @returns PromiseLike
588
- */
589
- function asPromiseLike(snapshot) {
590
- if (snapshot === null) {
591
- if (process.env.NODE_ENV !== 'production') {
592
- throw new Error("Imperative adapters should never have a null snapshot... how'd y'all get here?");
593
- }
594
- }
595
- return {
596
- then: (onFulfilled, onRejected) => {
597
- try {
598
- const data = handleSnapshot(snapshot);
599
- if (onFulfilled) {
600
- return onFulfilled(data);
601
- }
602
- }
603
- catch (e) {
604
- if (onRejected) {
605
- return onRejected(e);
606
- }
607
- return {
608
- catch: (callback) => {
609
- callback(e);
610
- },
611
- };
612
- }
613
- },
614
- catch: (callback) => {
615
- try {
616
- handleSnapshot(snapshot);
617
- }
618
- catch (e) {
619
- callback(e);
620
- }
621
- },
622
- };
623
- }
624
579
  /**
625
580
  * Returns a function that executes the supplied ldsAdapter,
626
581
  * and handles unwrapping the snapshot to return to caller
@@ -631,11 +586,7 @@ function asPromiseLike(snapshot) {
631
586
  function invoker(ldsAdapter) {
632
587
  return (config, requestContext) => {
633
588
  const snapshotOrPromise = ldsAdapter(config, requestContext);
634
- if (isPromise(snapshotOrPromise)) {
635
- return Promise.resolve(snapshotOrPromise).then(handleSnapshot);
636
- }
637
- // to preserve previous behavior return a PromiseLike
638
- return asPromiseLike(snapshotOrPromise);
589
+ return Promise.resolve(snapshotOrPromise).then(handleSnapshot);
639
590
  };
640
591
  }
641
592
  const invokerFactory = (luvio, invokerParams, adapterFactory) => {
@@ -706,4 +657,4 @@ const getApexInvoker = function (namespace, classname, method, isContinuation, i
706
657
  };
707
658
 
708
659
  export { getApexInvoker, refreshApex };
709
- // version: 1.261.0-10ee630e7
660
+ // version: 1.262.1-9a1924e93