sfobjects-basic-client 1.1.2 → 1.1.3
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/index.d.ts +4 -0
- package/dist/index.js +3 -1
- package/package.json +1 -1
- package/src/index.ts +3 -1
package/dist/index.d.ts
CHANGED
|
@@ -178,4 +178,8 @@ export declare function isPlainObject(value: unknown): value is Record<string, a
|
|
|
178
178
|
export declare function constructSoql<OI>(_cfg: SfObjCfgIndex<OI>): (objName: string, from: string, select: (string | {})[], where?: string | Record<string, any>, orderBy?: Record<string, any>, limit?: number) => string;
|
|
179
179
|
export declare function getSfObject<OI>(_cfg: SfObjCfgIndex<OI>): <N extends KeyOf<OI>>(from: N, _conn: ISfConnection) => SfObjActions<OI, N>;
|
|
180
180
|
export declare const getSfObjects: <OI>(cfg: SfObjCfgIndex<OI>) => (conn: ISfConnection) => { [N in KeyOf<OI>]: SfObjActions<OI, N>; };
|
|
181
|
+
export declare const sfObject: <OI, N extends KeyOf<OI>>(cfg: SfObjCfgIndex<OI>, n: N) => {
|
|
182
|
+
info: SfObjCfgIndex<OI>[N];
|
|
183
|
+
select: <S extends SfRootSelect<OI, N>>(s: S[]) => S[];
|
|
184
|
+
};
|
|
181
185
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.getSfObjects = void 0;
|
|
24
|
+
exports.sfObject = exports.getSfObjects = void 0;
|
|
25
25
|
exports.isPlainObject = isPlainObject;
|
|
26
26
|
exports.constructSoql = constructSoql;
|
|
27
27
|
exports.getSfObject = getSfObject;
|
|
@@ -255,3 +255,5 @@ const getSfObjects = (cfg) => (conn) => {
|
|
|
255
255
|
return Object.keys(cfg).reduce((p, n) => (Object.assign(Object.assign({}, p), { [n]: _func(n, conn) })), {});
|
|
256
256
|
};
|
|
257
257
|
exports.getSfObjects = getSfObjects;
|
|
258
|
+
const sfObject = (cfg, n) => ({ info: cfg[n], select: (s) => s });
|
|
259
|
+
exports.sfObject = sfObject;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -581,4 +581,6 @@ export function getSfObject<OI>(_cfg: SfObjCfgIndex<OI>) {
|
|
|
581
581
|
export const getSfObjects = <OI>(cfg: SfObjCfgIndex<OI>) => (conn: ISfConnection) => {
|
|
582
582
|
const _func = getSfObject<OI>(cfg);
|
|
583
583
|
return (Object.keys(cfg) as KeyOf<OI>[]).reduce((p, n) => ({ ...p, [n]: _func(n, conn) }), {} as { [N in KeyOf<OI>]: SfObjActions<OI, N> });
|
|
584
|
-
}
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
export const sfObject = <OI, N extends KeyOf<OI>>(cfg: SfObjCfgIndex<OI>, n: N) => ({ info: cfg[n], select: <S extends SfRootSelect<OI, N>>(s: S[]) => s });
|