@jonloucks/contracts-ts 1.4.0 → 2.0.2
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/README.md +73 -22
- package/api/AutoClose.d.ts +7 -2
- package/api/AutoClose.d.ts.map +1 -1
- package/api/AutoClose.js +24 -23
- package/api/AutoClose.js.map +1 -1
- package/api/AutoCloseFactory.d.ts +3 -3
- package/api/AutoCloseFactory.d.ts.map +1 -1
- package/api/AutoCloseFactory.js +5 -9
- package/api/AutoCloseFactory.js.map +1 -1
- package/api/AutoOpen.js +3 -6
- package/api/AutoOpen.js.map +1 -1
- package/api/BasicContract.js +6 -11
- package/api/BasicContract.js.map +1 -1
- package/api/BindStrategy.js +4 -9
- package/api/BindStrategy.js.map +1 -1
- package/api/Contract.js +3 -6
- package/api/Contract.js.map +1 -1
- package/api/ContractException.js +5 -10
- package/api/ContractException.js.map +1 -1
- package/api/ContractFactory.js +3 -6
- package/api/ContractFactory.js.map +1 -1
- package/api/Contracts.d.ts +1 -1
- package/api/Contracts.d.ts.map +1 -1
- package/api/Contracts.js +4 -7
- package/api/Contracts.js.map +1 -1
- package/api/ContractsFactory.js +3 -6
- package/api/ContractsFactory.js.map +1 -1
- package/api/Convenience.d.ts +21 -16
- package/api/Convenience.d.ts.map +1 -1
- package/api/Convenience.js +17 -35
- package/api/Convenience.js.map +1 -1
- package/api/Open.d.ts.map +1 -1
- package/api/Open.js +9 -13
- package/api/Open.js.map +1 -1
- package/api/Promisor.d.ts +9 -5
- package/api/Promisor.d.ts.map +1 -1
- package/api/Promisor.js +18 -23
- package/api/Promisor.js.map +1 -1
- package/api/PromisorFactory.d.ts +3 -2
- package/api/PromisorFactory.d.ts.map +1 -1
- package/api/PromisorFactory.js +5 -9
- package/api/PromisorFactory.js.map +1 -1
- package/api/RatifiedContract.js +11 -16
- package/api/RatifiedContract.js.map +1 -1
- package/api/Repository.d.ts +2 -2
- package/api/Repository.d.ts.map +1 -1
- package/api/Repository.js +4 -7
- package/api/Repository.js.map +1 -1
- package/api/RepositoryFactory.js +5 -9
- package/api/RepositoryFactory.js.map +1 -1
- package/api/Types.d.ts +0 -24
- package/api/Types.d.ts.map +1 -1
- package/api/Types.js +13 -62
- package/api/Types.js.map +1 -1
- package/auxiliary/AtomicBoolean.js +3 -6
- package/auxiliary/AtomicBoolean.js.map +1 -1
- package/auxiliary/AtomicBooleanFactory.js +5 -9
- package/auxiliary/AtomicBooleanFactory.js.map +1 -1
- package/auxiliary/AtomicInteger.js +3 -6
- package/auxiliary/AtomicInteger.js.map +1 -1
- package/auxiliary/AtomicIntegerFactory.js +5 -9
- package/auxiliary/AtomicIntegerFactory.js.map +1 -1
- package/auxiliary/AtomicReference.js +3 -6
- package/auxiliary/AtomicReference.js.map +1 -1
- package/auxiliary/AtomicReferenceFactory.js +5 -9
- package/auxiliary/AtomicReferenceFactory.js.map +1 -1
- package/auxiliary/Checks.js +23 -36
- package/auxiliary/Checks.js.map +1 -1
- package/auxiliary/Consumer.js +7 -12
- package/auxiliary/Consumer.js.map +1 -1
- package/auxiliary/Convenience.d.ts +10 -6
- package/auxiliary/Convenience.d.ts.map +1 -1
- package/auxiliary/Convenience.js +17 -19
- package/auxiliary/Convenience.js.map +1 -1
- package/auxiliary/IdempotenState.d.ts +1 -1
- package/auxiliary/IdempotenState.d.ts.map +1 -1
- package/auxiliary/IdempotenState.js +2 -5
- package/auxiliary/IdempotenState.js.map +1 -1
- package/auxiliary/Idempotent.js +3 -6
- package/auxiliary/Idempotent.js.map +1 -1
- package/auxiliary/IdempotentFactory.js +5 -9
- package/auxiliary/IdempotentFactory.js.map +1 -1
- package/auxiliary/IllegalArgumentException.js +4 -8
- package/auxiliary/IllegalArgumentException.js.map +1 -1
- package/auxiliary/IllegalStateException.js +4 -8
- package/auxiliary/IllegalStateException.js.map +1 -1
- package/auxiliary/Predicate.js +9 -15
- package/auxiliary/Predicate.js.map +1 -1
- package/auxiliary/Supplier.js +10 -16
- package/auxiliary/Supplier.js.map +1 -1
- package/auxiliary/Transform.js +11 -18
- package/auxiliary/Transform.js.map +1 -1
- package/auxiliary/Validate.d.ts.map +1 -1
- package/auxiliary/Validate.js +17 -76
- package/auxiliary/Validate.js.map +1 -1
- package/impl/AtomicBoolean.impl.js +1 -4
- package/impl/AtomicBoolean.impl.js.map +1 -1
- package/impl/AtomicBooleanFactory.impl.js +3 -6
- package/impl/AtomicBooleanFactory.impl.js.map +1 -1
- package/impl/AtomicInteger.impl.js +1 -4
- package/impl/AtomicInteger.impl.js.map +1 -1
- package/impl/AtomicIntegerFactory.impl.js +3 -6
- package/impl/AtomicIntegerFactory.impl.js.map +1 -1
- package/impl/AtomicReference.impl.js +2 -7
- package/impl/AtomicReference.impl.js.map +1 -1
- package/impl/AtomicReferenceFactory.impl.js +3 -6
- package/impl/AtomicReferenceFactory.impl.js.map +1 -1
- package/impl/AutoCloseFactory.impl.d.ts +0 -3
- package/impl/AutoCloseFactory.impl.d.ts.map +1 -1
- package/impl/AutoCloseFactory.impl.js +7 -10
- package/impl/AutoCloseFactory.impl.js.map +1 -1
- package/impl/AutoCloseMany.impl.d.ts +0 -2
- package/impl/AutoCloseMany.impl.d.ts.map +1 -1
- package/impl/AutoCloseMany.impl.js +9 -9
- package/impl/AutoCloseMany.impl.js.map +1 -1
- package/impl/AutoCloseOne.impl.d.ts.map +1 -1
- package/impl/AutoCloseOne.impl.js +12 -12
- package/impl/AutoCloseOne.impl.js.map +1 -1
- package/impl/ContractFactory.impl.js +7 -11
- package/impl/ContractFactory.impl.js.map +1 -1
- package/impl/Contracts.impl.d.ts.map +1 -1
- package/impl/Contracts.impl.js +38 -41
- package/impl/Contracts.impl.js.map +1 -1
- package/impl/ContractsFactory.impl.js +28 -32
- package/impl/ContractsFactory.impl.js.map +1 -1
- package/impl/ContractsWrapper.impl.js +3 -6
- package/impl/ContractsWrapper.impl.js.map +1 -1
- package/impl/Events.d.ts +1 -2
- package/impl/Events.d.ts.map +1 -1
- package/impl/Events.impl.d.ts +1 -2
- package/impl/Events.impl.d.ts.map +1 -1
- package/impl/Events.impl.js +6 -9
- package/impl/Events.impl.js.map +1 -1
- package/impl/Events.js +1 -2
- package/impl/Events.js.map +1 -1
- package/impl/ExtractorPromisor.impl.d.ts +2 -1
- package/impl/ExtractorPromisor.impl.d.ts.map +1 -1
- package/impl/ExtractorPromisor.impl.js +6 -9
- package/impl/ExtractorPromisor.impl.js.map +1 -1
- package/impl/Idempotent.impl.js +10 -13
- package/impl/Idempotent.impl.js.map +1 -1
- package/impl/IdempotentFactory.impl.js +5 -8
- package/impl/IdempotentFactory.impl.js.map +1 -1
- package/impl/Internal.impl.js +5 -8
- package/impl/Internal.impl.js.map +1 -1
- package/impl/LifeCyclePromisor.impl.js +19 -22
- package/impl/LifeCyclePromisor.impl.js.map +1 -1
- package/impl/Policy.d.ts +0 -1
- package/impl/Policy.d.ts.map +1 -1
- package/impl/Policy.impl.d.ts +1 -3
- package/impl/Policy.impl.d.ts.map +1 -1
- package/impl/Policy.impl.js +7 -10
- package/impl/Policy.impl.js.map +1 -1
- package/impl/Policy.js +1 -2
- package/impl/PromisorFactory.impl.d.ts.map +1 -1
- package/impl/PromisorFactory.impl.js +11 -14
- package/impl/PromisorFactory.impl.js.map +1 -1
- package/impl/Repository.impl.d.ts.map +1 -1
- package/impl/Repository.impl.js +19 -22
- package/impl/Repository.impl.js.map +1 -1
- package/impl/RepositoryFactory.impl.js +3 -6
- package/impl/RepositoryFactory.impl.js.map +1 -1
- package/impl/SingletonPromisor.impl.js +7 -10
- package/impl/SingletonPromisor.impl.js.map +1 -1
- package/impl/Storage.impl.d.ts +2 -1
- package/impl/Storage.impl.d.ts.map +1 -1
- package/impl/Storage.impl.js +7 -7
- package/impl/Storage.impl.js.map +1 -1
- package/impl/ValuePromisor.impl.js +1 -4
- package/impl/ValuePromisor.impl.js.map +1 -1
- package/index.d.ts +8 -20
- package/index.d.ts.map +1 -1
- package/index.js +10 -38
- package/index.js.map +1 -1
- package/package.json +14 -13
- package/version.js +2 -5
- package/version.js.map +1 -1
- package/auxiliary/Functional.d.ts +0 -9
- package/auxiliary/Functional.d.ts.map +0 -1
- package/auxiliary/Functional.js +0 -23
- package/auxiliary/Functional.js.map +0 -1
package/api/Contracts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Contracts.js","sourceRoot":"","sources":["../../src/api/Contracts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Contracts.js","sourceRoot":"","sources":["../../src/api/Contracts.ts"],"names":[],"mappings":"AACA,OAAO,EAAQ,KAAK,IAAI,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAI5E,OAAO,EAAE,cAAc,EAA8B,MAAM,mCAAmC,CAAC;AAkF/F;;;;;GAKG;AACH,MAAM,UAAU,KAAK,CAAC,KAAc;IAClC,OAAO,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC;AAC1F,CAAC"}
|
package/api/ContractsFactory.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.guard = guard;
|
|
4
|
-
const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
1
|
+
import { guardFunctions } from "@jonloucks/contracts-ts/api/Types";
|
|
5
2
|
/**
|
|
6
3
|
* Type guard for ContractsFactory
|
|
7
4
|
*
|
|
8
5
|
* @param value the value to check
|
|
9
6
|
* @return true if value is ContractsFactory, false otherwise
|
|
10
7
|
*/
|
|
11
|
-
function guard(value) {
|
|
12
|
-
return
|
|
8
|
+
export function guard(value) {
|
|
9
|
+
return guardFunctions(value, 'createContracts');
|
|
13
10
|
}
|
|
14
11
|
//# sourceMappingURL=ContractsFactory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContractsFactory.js","sourceRoot":"","sources":["../../src/api/ContractsFactory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ContractsFactory.js","sourceRoot":"","sources":["../../src/api/ContractsFactory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAgB,MAAM,mCAAmC,CAAC;AAkBjF;;;;;GAKG;AACH,MAAM,UAAU,KAAK,CAAC,KAAc;IAClC,OAAO,cAAc,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;AAClD,CAAC"}
|
package/api/Convenience.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { Contract, ContractConfig, CONTRACTS, createContract } from "@jonloucks/contracts-ts";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { VERSION, type Contract, type ContractConfig, CONTRACTS, createContract } from "@jonloucks/contracts-ts";
|
|
2
|
+
import { AutoOpen } from "@jonloucks/contracts-ts/api/AutoOpen";
|
|
3
|
+
import { ContractException } from "@jonloucks/contracts-ts/api/ContractException";
|
|
4
|
+
import { type Contracts, type Config as ContractsConfig } from "@jonloucks/contracts-ts/api/Contracts";
|
|
5
|
+
import { type Promisor, type Type as PromisorType } from "@jonloucks/contracts-ts/api/Promisor";
|
|
6
|
+
import { type AutoClose, type AutoCloseType, inlineAutoClose } from "@jonloucks/contracts-ts/api/AutoClose";
|
|
7
|
+
import { type BindStrategyType } from "@jonloucks/contracts-ts/api/BindStrategy";
|
|
8
|
+
import { type Repository, type Config as RepositoryConfig } from "@jonloucks/contracts-ts/api/Repository";
|
|
9
|
+
import { type OptionalType, type RequiredType, type UndefinedType, isNumber, isFunction, isString, isBoolean, isObject, guardFunctions } from "@jonloucks/contracts-ts/api/Types";
|
|
10
|
+
import { type Transform, type Type as TransformType } from "@jonloucks/contracts-ts/auxiliary/Transform";
|
|
11
|
+
import { validateContracts } from "@jonloucks/contracts-ts/auxiliary/Validate";
|
|
8
12
|
/**
|
|
9
13
|
* @module Convenience
|
|
10
14
|
* @description
|
|
@@ -24,14 +28,14 @@ export { AutoClose, BindStrategyType, Contract, ContractConfig, CONTRACTS, creat
|
|
|
24
28
|
* @param contract the Contract to claim from
|
|
25
29
|
* @returns the deliverable
|
|
26
30
|
*/
|
|
27
|
-
|
|
31
|
+
declare function claim<T>(contract: RequiredType<Contract<T>>): OptionalType<T>;
|
|
28
32
|
/**
|
|
29
33
|
* Enforce a deliverable from a Contract via the shared global CONTRACTS instance.
|
|
30
34
|
*
|
|
31
35
|
* @param contract the Contract to enforce from
|
|
32
36
|
* @returns the deliverable
|
|
33
37
|
*/
|
|
34
|
-
|
|
38
|
+
declare function enforce<T>(contract: RequiredType<Contract<T>>): RequiredType<T>;
|
|
35
39
|
/**
|
|
36
40
|
* Bind a Promisor to a Contract via the shared global CONTRACTS instance.
|
|
37
41
|
*
|
|
@@ -40,14 +44,14 @@ export declare function enforce<T>(contract: RequiredType<Contract<T>>): Require
|
|
|
40
44
|
* @param bindStrategy optional BindStrategyType
|
|
41
45
|
* @returns an AutoClose to manage the binding lifecycle
|
|
42
46
|
*/
|
|
43
|
-
|
|
47
|
+
declare function bind<T>(contract: RequiredType<Contract<T>>, promisor: PromisorType<T>, bindStrategy?: BindStrategyType): RequiredType<AutoClose>;
|
|
44
48
|
/**
|
|
45
49
|
* Check if a Contract is bound via the shared global CONTRACTS instance.
|
|
46
50
|
*
|
|
47
51
|
* @param contract the Contract to check
|
|
48
52
|
* @returns true if the Contract is bound, false otherwise
|
|
49
53
|
*/
|
|
50
|
-
|
|
54
|
+
declare function isBound<T>(contract: RequiredType<Contract<T>>): boolean;
|
|
51
55
|
/**
|
|
52
56
|
* Creates a Promisor that returns the given value every time it is claimed.
|
|
53
57
|
*
|
|
@@ -55,7 +59,7 @@ export declare function isBound<T>(contract: RequiredType<Contract<T>>): boolean
|
|
|
55
59
|
* @return The new Promisor
|
|
56
60
|
* @param <T> the type of deliverable
|
|
57
61
|
*/
|
|
58
|
-
|
|
62
|
+
declare function createValue<T>(deliverable: OptionalType<T>): RequiredType<Promisor<T>>;
|
|
59
63
|
/**
|
|
60
64
|
* Creates a Promisor that only calls the source Promisor once and then always
|
|
61
65
|
* returns that value.
|
|
@@ -65,7 +69,7 @@ export declare function createValue<T>(deliverable: OptionalType<T>): RequiredTy
|
|
|
65
69
|
* @return The new Promisor
|
|
66
70
|
* @param <T> the type of deliverable
|
|
67
71
|
*/
|
|
68
|
-
|
|
72
|
+
declare function createSingleton<T>(promisor: PromisorType<T>): RequiredType<Promisor<T>>;
|
|
69
73
|
/**
|
|
70
74
|
* Reference counted, lazy loaded, with opt-in 'open' and 'close' invoked on deliverable.
|
|
71
75
|
* Note: increment and decrementUsage are relayed to the source promisor.
|
|
@@ -74,7 +78,7 @@ export declare function createSingleton<T>(promisor: PromisorType<T>): RequiredT
|
|
|
74
78
|
* @return the new Promisor
|
|
75
79
|
* @param <T> the type of deliverable
|
|
76
80
|
*/
|
|
77
|
-
|
|
81
|
+
declare function createLifeCycle<T>(promisor: PromisorType<T>): RequiredType<Promisor<T>>;
|
|
78
82
|
/**
|
|
79
83
|
* Extract values from the deliverable of a source Promisor.
|
|
80
84
|
* Note: increment and decrementUsage are relayed to the source promisor.
|
|
@@ -85,12 +89,13 @@ export declare function createLifeCycle<T>(promisor: PromisorType<T>): RequiredT
|
|
|
85
89
|
* @param <T> the type of deliverable
|
|
86
90
|
* @param <R> the new Promisor deliverable type
|
|
87
91
|
*/
|
|
88
|
-
|
|
92
|
+
declare function createExtractor<T, R>(promisor: PromisorType<T>, extractor: TransformType<T, R>): RequiredType<Promisor<R>>;
|
|
89
93
|
/**
|
|
90
94
|
* Factory method to create a Repository via the shared global REPOSITORY_FACTORY instance.
|
|
91
95
|
*
|
|
92
96
|
* @param config optional configuration for the Repository
|
|
93
97
|
* @returns the Repository implementation
|
|
94
98
|
*/
|
|
95
|
-
|
|
99
|
+
declare function createRepository(config?: RepositoryConfig): RequiredType<Repository>;
|
|
100
|
+
export { type AutoClose, type AutoCloseType, type AutoOpen, bind, type BindStrategyType, claim, createExtractor, createLifeCycle, createRepository, createSingleton, createValue, type Contract, type ContractConfig, ContractException, type Contracts, type ContractsConfig, CONTRACTS, createContract, enforce, guardFunctions, inlineAutoClose, isBound, isBoolean, isFunction, isNumber, isObject, isString, type OptionalType, type Promisor, type PromisorType, type Repository, type RepositoryConfig, type RequiredType, type Transform, type TransformType, type UndefinedType, validateContracts, VERSION };
|
|
96
101
|
//# sourceMappingURL=Convenience.d.ts.map
|
package/api/Convenience.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Convenience.d.ts","sourceRoot":"","sources":["../../src/api/Convenience.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"Convenience.d.ts","sourceRoot":"","sources":["../../src/api/Convenience.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEjH,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,MAAM,IAAI,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACvG,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,IAAI,IAAI,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAChG,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAC5G,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAGjF,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,MAAM,IAAI,gBAAgB,EA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7
|
-
|
|
8
|
-
exports.createValue = createValue;
|
|
9
|
-
exports.createSingleton = createSingleton;
|
|
10
|
-
exports.createLifeCycle = createLifeCycle;
|
|
11
|
-
exports.createExtractor = createExtractor;
|
|
12
|
-
exports.createRepository = createRepository;
|
|
13
|
-
const contracts_ts_1 = require("@jonloucks/contracts-ts");
|
|
14
|
-
Object.defineProperty(exports, "CONTRACTS", { enumerable: true, get: function () { return contracts_ts_1.CONTRACTS; } });
|
|
15
|
-
Object.defineProperty(exports, "createContract", { enumerable: true, get: function () { return contracts_ts_1.createContract; } });
|
|
16
|
-
const AutoClose_1 = require("@jonloucks/contracts-ts/api/AutoClose");
|
|
17
|
-
Object.defineProperty(exports, "inlineAutoClose", { enumerable: true, get: function () { return AutoClose_1.inlineAutoClose; } });
|
|
18
|
-
const PromisorFactory_1 = require("@jonloucks/contracts-ts/api/PromisorFactory");
|
|
19
|
-
const RepositoryFactory_1 = require("@jonloucks/contracts-ts/api/RepositoryFactory");
|
|
20
|
-
const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
21
|
-
Object.defineProperty(exports, "isNumber", { enumerable: true, get: function () { return Types_1.isNumber; } });
|
|
22
|
-
Object.defineProperty(exports, "isFunction", { enumerable: true, get: function () { return Types_1.isFunction; } });
|
|
23
|
-
Object.defineProperty(exports, "isString", { enumerable: true, get: function () { return Types_1.isString; } });
|
|
24
|
-
Object.defineProperty(exports, "isBoolean", { enumerable: true, get: function () { return Types_1.isBoolean; } });
|
|
25
|
-
Object.defineProperty(exports, "isObject", { enumerable: true, get: function () { return Types_1.isObject; } });
|
|
26
|
-
Object.defineProperty(exports, "guardFunctions", { enumerable: true, get: function () { return Types_1.guardFunctions; } });
|
|
1
|
+
import { VERSION, CONTRACTS, createContract } from "@jonloucks/contracts-ts";
|
|
2
|
+
import { ContractException } from "@jonloucks/contracts-ts/api/ContractException";
|
|
3
|
+
import { inlineAutoClose } from "@jonloucks/contracts-ts/api/AutoClose";
|
|
4
|
+
import { CONTRACT as PROMISOR_FACTORY } from "@jonloucks/contracts-ts/api/PromisorFactory";
|
|
5
|
+
import { CONTRACT as REPOSITORY_FACTORY } from "@jonloucks/contracts-ts/api/RepositoryFactory";
|
|
6
|
+
import { isNumber, isFunction, isString, isBoolean, isObject, guardFunctions } from "@jonloucks/contracts-ts/api/Types";
|
|
7
|
+
import { validateContracts } from "@jonloucks/contracts-ts/auxiliary/Validate";
|
|
27
8
|
/**
|
|
28
9
|
* @module Convenience
|
|
29
10
|
* @description
|
|
@@ -44,7 +25,7 @@ Object.defineProperty(exports, "guardFunctions", { enumerable: true, get: functi
|
|
|
44
25
|
* @returns the deliverable
|
|
45
26
|
*/
|
|
46
27
|
function claim(contract) {
|
|
47
|
-
return
|
|
28
|
+
return CONTRACTS.claim(contract);
|
|
48
29
|
}
|
|
49
30
|
/**
|
|
50
31
|
* Enforce a deliverable from a Contract via the shared global CONTRACTS instance.
|
|
@@ -53,7 +34,7 @@ function claim(contract) {
|
|
|
53
34
|
* @returns the deliverable
|
|
54
35
|
*/
|
|
55
36
|
function enforce(contract) {
|
|
56
|
-
return
|
|
37
|
+
return CONTRACTS.enforce(contract);
|
|
57
38
|
}
|
|
58
39
|
/**
|
|
59
40
|
* Bind a Promisor to a Contract via the shared global CONTRACTS instance.
|
|
@@ -64,7 +45,7 @@ function enforce(contract) {
|
|
|
64
45
|
* @returns an AutoClose to manage the binding lifecycle
|
|
65
46
|
*/
|
|
66
47
|
function bind(contract, promisor, bindStrategy) {
|
|
67
|
-
return
|
|
48
|
+
return CONTRACTS.bind(contract, promisor, bindStrategy);
|
|
68
49
|
}
|
|
69
50
|
/**
|
|
70
51
|
* Check if a Contract is bound via the shared global CONTRACTS instance.
|
|
@@ -73,7 +54,7 @@ function bind(contract, promisor, bindStrategy) {
|
|
|
73
54
|
* @returns true if the Contract is bound, false otherwise
|
|
74
55
|
*/
|
|
75
56
|
function isBound(contract) {
|
|
76
|
-
return
|
|
57
|
+
return CONTRACTS.isBound(contract);
|
|
77
58
|
}
|
|
78
59
|
/**
|
|
79
60
|
* Creates a Promisor that returns the given value every time it is claimed.
|
|
@@ -83,7 +64,7 @@ function isBound(contract) {
|
|
|
83
64
|
* @param <T> the type of deliverable
|
|
84
65
|
*/
|
|
85
66
|
function createValue(deliverable) {
|
|
86
|
-
return enforce(
|
|
67
|
+
return enforce(PROMISOR_FACTORY).createValue(deliverable);
|
|
87
68
|
}
|
|
88
69
|
/**
|
|
89
70
|
* Creates a Promisor that only calls the source Promisor once and then always
|
|
@@ -95,7 +76,7 @@ function createValue(deliverable) {
|
|
|
95
76
|
* @param <T> the type of deliverable
|
|
96
77
|
*/
|
|
97
78
|
function createSingleton(promisor) {
|
|
98
|
-
return enforce(
|
|
79
|
+
return enforce(PROMISOR_FACTORY).createSingleton(promisor);
|
|
99
80
|
}
|
|
100
81
|
/**
|
|
101
82
|
* Reference counted, lazy loaded, with opt-in 'open' and 'close' invoked on deliverable.
|
|
@@ -106,7 +87,7 @@ function createSingleton(promisor) {
|
|
|
106
87
|
* @param <T> the type of deliverable
|
|
107
88
|
*/
|
|
108
89
|
function createLifeCycle(promisor) {
|
|
109
|
-
return enforce(
|
|
90
|
+
return enforce(PROMISOR_FACTORY).createLifeCycle(promisor);
|
|
110
91
|
}
|
|
111
92
|
/**
|
|
112
93
|
* Extract values from the deliverable of a source Promisor.
|
|
@@ -119,7 +100,7 @@ function createLifeCycle(promisor) {
|
|
|
119
100
|
* @param <R> the new Promisor deliverable type
|
|
120
101
|
*/
|
|
121
102
|
function createExtractor(promisor, extractor) {
|
|
122
|
-
return enforce(
|
|
103
|
+
return enforce(PROMISOR_FACTORY).createExtractor(promisor, extractor);
|
|
123
104
|
}
|
|
124
105
|
/**
|
|
125
106
|
* Factory method to create a Repository via the shared global REPOSITORY_FACTORY instance.
|
|
@@ -128,6 +109,7 @@ function createExtractor(promisor, extractor) {
|
|
|
128
109
|
* @returns the Repository implementation
|
|
129
110
|
*/
|
|
130
111
|
function createRepository(config) {
|
|
131
|
-
return enforce(
|
|
112
|
+
return enforce(REPOSITORY_FACTORY).createRepository(config);
|
|
132
113
|
}
|
|
114
|
+
export { bind, claim, createExtractor, createLifeCycle, createRepository, createSingleton, createValue, ContractException, CONTRACTS, createContract, enforce, guardFunctions, inlineAutoClose, isBound, isBoolean, isFunction, isNumber, isObject, isString, validateContracts, VERSION };
|
|
133
115
|
//# sourceMappingURL=Convenience.js.map
|
package/api/Convenience.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Convenience.js","sourceRoot":"","sources":["../../src/api/Convenience.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Convenience.js","sourceRoot":"","sources":["../../src/api/Convenience.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAsC,SAAS,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAGjH,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAGlF,OAAO,EAAsC,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAE5G,OAAO,EAAE,QAAQ,IAAI,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC3F,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AAE/F,OAAO,EAA4D,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAElL,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAE/E;;;;;;;;;;;;GAYG;AAEH;;;;;GAKG;AACH,SAAS,KAAK,CAAI,QAAmC;IACnD,OAAO,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AACnC,CAAC;AAED;;;;;GAKG;AACH,SAAS,OAAO,CAAI,QAAmC;IACrD,OAAO,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AACrC,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,IAAI,C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
package/api/Open.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Open.d.ts","sourceRoot":"","sources":["../../src/api/Open.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"Open.d.ts","sourceRoot":"","sources":["../../src/api/Open.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAA+B,MAAM,uCAAuC,CAAC;AAC9G,OAAO,EAAE,QAAQ,EAA0B,MAAM,sCAAsC,CAAC;AAExF,OAAO,EAAE,YAAY,EAAE,MAAM,8CAA8C,CAAC;AAE5E;;GAEG;AACH,MAAM,WAAW,IAAI;IAEnB;;;OAGG;IACH,IAAI,IAAI,SAAS,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,IAAI,GAAG,CAAC,MAAM,aAAa,CAAC,CAAC;AAE/D;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAAC,IAAI,CAAC,CAEjE;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAc/C"}
|
package/api/Open.js
CHANGED
|
@@ -1,18 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.typeToOpen = typeToOpen;
|
|
5
|
-
const AutoClose_1 = require("@jonloucks/contracts-ts/api/AutoClose");
|
|
6
|
-
const AutoOpen_1 = require("@jonloucks/contracts-ts/api/AutoOpen");
|
|
7
|
-
const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
1
|
+
import { fromType as typeToAutoClose } from "@jonloucks/contracts-ts/api/AutoClose";
|
|
2
|
+
import { guard as guardAutoOpen } from "@jonloucks/contracts-ts/api/AutoOpen";
|
|
3
|
+
import { guardFunctions, isFunction } from "@jonloucks/contracts-ts/api/Types";
|
|
8
4
|
/**
|
|
9
5
|
* Duck-typing check for Open interface.
|
|
10
6
|
*
|
|
11
7
|
* @param value the value to check
|
|
12
8
|
* @returns true if the value implements Open, false otherwise
|
|
13
9
|
*/
|
|
14
|
-
function guard(value) {
|
|
15
|
-
return
|
|
10
|
+
export function guard(value) {
|
|
11
|
+
return guardFunctions(value, 'open');
|
|
16
12
|
}
|
|
17
13
|
/**
|
|
18
14
|
* Convert an OpenType to an Open instance.
|
|
@@ -20,8 +16,8 @@ function guard(value) {
|
|
|
20
16
|
* @param type the OpenType to convert
|
|
21
17
|
* @return the Open instance
|
|
22
18
|
*/
|
|
23
|
-
function typeToOpen(type) {
|
|
24
|
-
if ((
|
|
19
|
+
export function typeToOpen(type) {
|
|
20
|
+
if (guardAutoOpen(type)) {
|
|
25
21
|
return {
|
|
26
22
|
open: () => type.autoOpen()
|
|
27
23
|
};
|
|
@@ -29,9 +25,9 @@ function typeToOpen(type) {
|
|
|
29
25
|
else if (guard(type)) {
|
|
30
26
|
return type;
|
|
31
27
|
}
|
|
32
|
-
else if (
|
|
28
|
+
else if (isFunction(type)) {
|
|
33
29
|
return {
|
|
34
|
-
open: () =>
|
|
30
|
+
open: () => typeToAutoClose(type())
|
|
35
31
|
};
|
|
36
32
|
}
|
|
37
33
|
else {
|
package/api/Open.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Open.js","sourceRoot":"","sources":["../../src/api/Open.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Open.js","sourceRoot":"","sources":["../../src/api/Open.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,QAAQ,IAAI,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAC9G,OAAO,EAAY,KAAK,IAAI,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACxF,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAoB/E;;;;;GAKG;AACH,MAAM,UAAU,KAAK,CAAC,KAAc;IAClC,OAAO,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACvC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,IAAc;IACvC,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,OAAO;YACL,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE;SAC5B,CAAA;IACH,CAAC;SAAM,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;SAAM,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5B,OAAO;YACL,IAAI,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;SACpC,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;AACH,CAAC"}
|
package/api/Promisor.d.ts
CHANGED
|
@@ -32,22 +32,26 @@ export interface Promisor<T> {
|
|
|
32
32
|
* @returns true if the instance is a Promisor, false otherwise
|
|
33
33
|
*/
|
|
34
34
|
export declare function guard<T>(instance: unknown): instance is RequiredType<Promisor<T>>;
|
|
35
|
+
/**
|
|
36
|
+
* A Function that can be converted to a Promisor
|
|
37
|
+
*/
|
|
38
|
+
export type Method<T> = (() => OptionalType<T>);
|
|
35
39
|
/**
|
|
36
40
|
* A type that can be converted to a Promisor
|
|
37
41
|
*/
|
|
38
|
-
export type
|
|
42
|
+
export type Type<T> = (new () => T) | Promisor<T> | Method<T> | T | null | undefined;
|
|
39
43
|
/**
|
|
40
|
-
* Convert a
|
|
44
|
+
* Convert a Type to a Promisor
|
|
41
45
|
*
|
|
42
46
|
* @param type the type to convert
|
|
43
47
|
* @returns the Promisor
|
|
44
48
|
*/
|
|
45
|
-
export declare function
|
|
49
|
+
export declare function fromType<T>(type: Type<T>): RequiredType<Promisor<T>>;
|
|
46
50
|
/**
|
|
47
51
|
* Unwrap a Promisor to get the original type.
|
|
48
52
|
*
|
|
49
53
|
* @param promisor the Promisor to unwrap
|
|
50
|
-
* @returns the original
|
|
54
|
+
* @returns the original Promisor Type
|
|
51
55
|
*/
|
|
52
|
-
export declare function
|
|
56
|
+
export declare function unwrap<T>(promisor: OptionalType<Promisor<T>>): OptionalType<Type<T>>;
|
|
53
57
|
//# sourceMappingURL=Promisor.d.ts.map
|
package/api/Promisor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Promisor.d.ts","sourceRoot":"","sources":["../../src/api/Promisor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAA+C,MAAM,mCAAmC,CAAC;AAG5H;;;;;GAKG;AACH,MAAM,WAAW,QAAQ,CAAC,CAAC;IAEzB;;;OAGG;IACH,MAAM,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;IAE1B;;;;;OAKG;IACH,cAAc,IAAI,MAAM,CAAC;IAEzB;;;;;OAKG;IACH,cAAc,IAAI,MAAM,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAEjF;AAED;;GAEG;AACH,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"Promisor.d.ts","sourceRoot":"","sources":["../../src/api/Promisor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAA+C,MAAM,mCAAmC,CAAC;AAG5H;;;;;GAKG;AACH,MAAM,WAAW,QAAQ,CAAC,CAAC;IAEzB;;;OAGG;IACH,MAAM,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;IAE1B;;;;;OAKG;IACH,cAAc,IAAI,MAAM,CAAC;IAEzB;;;;;OAKG;IACH,cAAc,IAAI,MAAM,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAEjF;AAED;;GAEG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;AAErF;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAYpE;AA+BD;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAQpF"}
|
package/api/Promisor.js
CHANGED
|
@@ -1,50 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.guard = guard;
|
|
4
|
-
exports.typeToPromisor = typeToPromisor;
|
|
5
|
-
exports.unwrapPromisorType = unwrapPromisorType;
|
|
6
|
-
const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
7
|
-
const Checks_1 = require("@jonloucks/contracts-ts/auxiliary/Checks");
|
|
1
|
+
import { guardFunctions, isConstructor, isNotPresent } from "@jonloucks/contracts-ts/api/Types";
|
|
2
|
+
import { presentCheck } from "@jonloucks/contracts-ts/auxiliary/Checks";
|
|
8
3
|
/**
|
|
9
4
|
* Check if an instance is a Promisor
|
|
10
5
|
* @param instance the instance to check
|
|
11
6
|
* @returns true if the instance is a Promisor, false otherwise
|
|
12
7
|
*/
|
|
13
|
-
function guard(instance) {
|
|
14
|
-
return
|
|
8
|
+
export function guard(instance) {
|
|
9
|
+
return guardFunctions(instance, 'demand', 'incrementUsage', 'decrementUsage');
|
|
15
10
|
}
|
|
16
11
|
/**
|
|
17
|
-
* Convert a
|
|
12
|
+
* Convert a Type to a Promisor
|
|
18
13
|
*
|
|
19
14
|
* @param type the type to convert
|
|
20
15
|
* @returns the Promisor
|
|
21
16
|
*/
|
|
22
|
-
function
|
|
23
|
-
if (
|
|
24
|
-
return
|
|
17
|
+
export function fromType(type) {
|
|
18
|
+
if (isNotPresent(type)) {
|
|
19
|
+
return wrap(type, () => type); // supplier of null or undefined
|
|
25
20
|
}
|
|
26
|
-
else if (
|
|
27
|
-
return
|
|
21
|
+
else if (isConstructor(type)) {
|
|
22
|
+
return wrap(type, () => new type()); // supplier of new instance
|
|
28
23
|
}
|
|
29
24
|
else if (guard(type)) {
|
|
30
25
|
return type; // already a Promisor
|
|
31
26
|
}
|
|
32
27
|
else if (typeof type === 'function') {
|
|
33
|
-
return
|
|
28
|
+
return wrap(type, type); // supplier function
|
|
34
29
|
}
|
|
35
30
|
else {
|
|
36
|
-
return
|
|
31
|
+
return wrap(type, () => type); // instance of T, runtime type-guard happens in demand
|
|
37
32
|
}
|
|
38
33
|
}
|
|
39
34
|
/**
|
|
40
35
|
* Create a simple inline Promisor from a demand function
|
|
41
36
|
*
|
|
42
|
-
* @param type the
|
|
37
|
+
* @param type the promisor type
|
|
43
38
|
* @param demand the demand function
|
|
44
39
|
* @returns the Promisor
|
|
45
40
|
*/
|
|
46
|
-
function
|
|
47
|
-
const validDemand =
|
|
41
|
+
function wrap(type, demand) {
|
|
42
|
+
const validDemand = presentCheck(demand, "Promisor demand function must be present.");
|
|
48
43
|
let usageCount = 0;
|
|
49
44
|
return {
|
|
50
45
|
demand: validDemand,
|
|
@@ -57,10 +52,10 @@ function wrapPromisor(type, demand) {
|
|
|
57
52
|
* Unwrap a Promisor to get the original type.
|
|
58
53
|
*
|
|
59
54
|
* @param promisor the Promisor to unwrap
|
|
60
|
-
* @returns the original
|
|
55
|
+
* @returns the original Promisor Type
|
|
61
56
|
*/
|
|
62
|
-
function
|
|
63
|
-
if (
|
|
57
|
+
export function unwrap(promisor) {
|
|
58
|
+
if (isNotPresent(promisor)) {
|
|
64
59
|
return promisor;
|
|
65
60
|
}
|
|
66
61
|
if ('unwrapPromisorType' in promisor && typeof promisor.unwrapPromisorType === 'function') {
|
package/api/Promisor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Promisor.js","sourceRoot":"","sources":["../../src/api/Promisor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Promisor.js","sourceRoot":"","sources":["../../src/api/Promisor.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAC5H,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AAiCxE;;;;GAIG;AACH,MAAM,UAAU,KAAK,CAAI,QAAiB;IACxC,OAAO,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;AAChF,CAAC;AAYD;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAI,IAAa;IACvC,IAAI,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC;QACvB,OAAO,IAAI,CAAI,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,gCAAgC;IACpE,CAAC;SAAM,IAAI,aAAa,CAAI,IAAI,CAAC,EAAE,CAAC;QAClC,OAAO,IAAI,CAAI,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,2BAA2B;IACrE,CAAC;SAAM,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC,CAAC,qBAAqB;IACpC,CAAC;SAAM,IAAI,OAAO,IAAI,KAAK,UAAU,EAAE,CAAC;QACtC,OAAO,IAAI,CAAI,IAAI,EAAE,IAAiB,CAAC,CAAC,CAAC,oBAAoB;IAC/D,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,CAAI,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,sDAAsD;IAC1F,CAAC;AACH,CAAC;AAaD;;;;;;GAMG;AACH,SAAS,IAAI,CAAI,IAAa,EAAE,MAA6B;IAC3D,MAAM,WAAW,GAAG,YAAY,CAAC,MAAM,EAAE,2CAA2C,CAAC,CAAC;IACtF,IAAI,UAAU,GAAW,CAAC,CAAC;IAC3B,OAAO;QACL,MAAM,EAAE,WAAW;QACnB,cAAc,EAAE,GAAG,EAAE,CAAC,EAAE,UAAU;QAClC,cAAc,EAAE,GAAG,EAAE,CAAC,EAAE,UAAU;QAClC,kBAAkB,EAAE,GAAG,EAAE,CAAC,IAAI;KAC/B,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAI,QAAmC;IAC3D,IAAI,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC3B,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,IAAI,oBAAoB,IAAI,QAAQ,IAAI,OAAO,QAAQ,CAAC,kBAAkB,KAAK,UAAU,EAAE,CAAC;QAC1F,OAAO,QAAQ,CAAC,kBAAkB,EAAE,CAAC;IACvC,CAAC;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC"}
|
package/api/PromisorFactory.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Contract } from "@jonloucks/contracts-ts/api/Contract";
|
|
2
|
-
import { Promisor, PromisorType } from "@jonloucks/contracts-ts/api/Promisor";
|
|
3
|
-
import { OptionalType, RequiredType
|
|
2
|
+
import { Promisor, Type as PromisorType } from "@jonloucks/contracts-ts/api/Promisor";
|
|
3
|
+
import { OptionalType, RequiredType } from "@jonloucks/contracts-ts/api/Types";
|
|
4
|
+
import { Type as TransformType } from "@jonloucks/contracts-ts/auxiliary/Transform";
|
|
4
5
|
/**
|
|
5
6
|
* Helper methods for creating and chaining Promisors used for Contracts.bind().
|
|
6
7
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PromisorFactory.d.ts","sourceRoot":"","sources":["../../src/api/PromisorFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"PromisorFactory.d.ts","sourceRoot":"","sources":["../../src/api/PromisorFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAEtF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,mCAAmC,CAAC;AAC/F,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,6CAA6C,CAAC;AACpF;;GAEG;AACH,MAAM,WAAW,eAAe;IAE9B;;;;;;OAMG;IACH,WAAW,CAAC,CAAC,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAExE;;;;;;;;OAQG;IACH,eAAe,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAEzE;;;;;;;OAOG;IACH,eAAe,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAEzE;;;;;;;;;OASG;IACH,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;CAC7G;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,YAAY,CAAC,eAAe,CAAC,CAElF;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAI7C,CAAC"}
|
package/api/PromisorFactory.js
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.CONTRACT = void 0;
|
|
4
|
-
exports.guard = guard;
|
|
5
|
-
const RatifiedContract_1 = require("@jonloucks/contracts-ts/api/RatifiedContract");
|
|
6
|
-
const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
1
|
+
import { create as createContract } from "@jonloucks/contracts-ts/api/RatifiedContract";
|
|
2
|
+
import { guardFunctions } from "@jonloucks/contracts-ts/api/Types";
|
|
7
3
|
/**
|
|
8
4
|
* Type guard for PromisorFactory
|
|
9
5
|
*
|
|
10
6
|
* @param value the value to check
|
|
11
7
|
* @return true if value is PromisorFactory, false otherwise
|
|
12
8
|
*/
|
|
13
|
-
function guard(instance) {
|
|
14
|
-
return
|
|
9
|
+
export function guard(instance) {
|
|
10
|
+
return guardFunctions(instance, 'createExtractor', 'createLifeCycle', 'createSingleton', 'createValue');
|
|
15
11
|
}
|
|
16
12
|
/**
|
|
17
13
|
* The Contract for PromisorFactory implementation.
|
|
18
14
|
*/
|
|
19
|
-
|
|
15
|
+
export const CONTRACT = createContract({
|
|
20
16
|
test: guard,
|
|
21
17
|
name: "PromisorFactory",
|
|
22
18
|
typeName: "PromisorFactory"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PromisorFactory.js","sourceRoot":"","sources":["../../src/api/PromisorFactory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PromisorFactory.js","sourceRoot":"","sources":["../../src/api/PromisorFactory.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAA8B,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAkD/F;;;;;GAKG;AACH,MAAM,UAAU,KAAK,CAAC,QAAiB;IACrC,OAAO,cAAc,CAAC,QAAQ,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,aAAa,CAAC,CAAC;AAC1G,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAA8B,cAAc,CAAC;IAChE,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,iBAAiB;IACvB,QAAQ,EAAE,iBAAiB;CAC5B,CAAC,CAAC"}
|
package/api/RatifiedContract.js
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
3
2
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
4
3
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
5
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
6
5
|
};
|
|
7
6
|
var _a, _RatifiedContract_SECRET, _RatifiedContract_secret;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
exports.isRatifiableConfig = isRatifiableConfig;
|
|
12
|
-
const BasicContract_1 = require("@jonloucks/contracts-ts/api/BasicContract");
|
|
13
|
-
const ContractException_1 = require("@jonloucks/contracts-ts/api/ContractException");
|
|
14
|
-
const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
7
|
+
import { BasicContract } from "@jonloucks/contracts-ts/api/BasicContract";
|
|
8
|
+
import { ContractException } from "@jonloucks/contracts-ts/api/ContractException";
|
|
9
|
+
import { isNotPresent, isPresent } from "@jonloucks/contracts-ts/api/Types";
|
|
15
10
|
/**
|
|
16
11
|
* A RatifiedContract is a Contract that has been verified to have either a test or cast function.
|
|
17
12
|
* This ensures that the contract can actually perform some form of validation or transformation.
|
|
@@ -21,7 +16,7 @@ const Types_1 = require("@jonloucks/contracts-ts/api/Types");
|
|
|
21
16
|
* @param config the configuration for the RatifiedContract
|
|
22
17
|
* @returns the created RatifiedContract
|
|
23
18
|
*/
|
|
24
|
-
function create(config) {
|
|
19
|
+
export function create(config) {
|
|
25
20
|
return RatifiedContract.create(config);
|
|
26
21
|
}
|
|
27
22
|
/**
|
|
@@ -29,7 +24,7 @@ function create(config) {
|
|
|
29
24
|
* @param instance the instance to check
|
|
30
25
|
* @returns true if the instance is a RatifiedContract, false otherwise
|
|
31
26
|
*/
|
|
32
|
-
function isRatifiedContract(instance) {
|
|
27
|
+
export function isRatifiedContract(instance) {
|
|
33
28
|
return RatifiedContract.isRatifiedContract(instance);
|
|
34
29
|
}
|
|
35
30
|
/**
|
|
@@ -38,8 +33,8 @@ function isRatifiedContract(instance) {
|
|
|
38
33
|
* @param config the configuration to check
|
|
39
34
|
* @returns true if the configuration is ratifiable, false otherwise
|
|
40
35
|
*/
|
|
41
|
-
function isRatifiableConfig(config) {
|
|
42
|
-
return
|
|
36
|
+
export function isRatifiableConfig(config) {
|
|
37
|
+
return isPresent(config) && isPresent(config.test);
|
|
43
38
|
}
|
|
44
39
|
/**
|
|
45
40
|
* A RatifiedContract is a Contract that has been verified to have either a test or cast function.
|
|
@@ -47,7 +42,7 @@ function isRatifiableConfig(config) {
|
|
|
47
42
|
*
|
|
48
43
|
* @param <T> the type of deliverable for this Contract
|
|
49
44
|
*/
|
|
50
|
-
class RatifiedContract extends
|
|
45
|
+
class RatifiedContract extends BasicContract {
|
|
51
46
|
/**
|
|
52
47
|
* Create a contract derived from the given configuration
|
|
53
48
|
*
|
|
@@ -59,7 +54,7 @@ class RatifiedContract extends BasicContract_1.BasicContract {
|
|
|
59
54
|
return new _a(config);
|
|
60
55
|
}
|
|
61
56
|
static isRatifiedContract(instance) {
|
|
62
|
-
if (
|
|
57
|
+
if (isNotPresent(instance)) {
|
|
63
58
|
return false;
|
|
64
59
|
}
|
|
65
60
|
try {
|
|
@@ -82,7 +77,7 @@ class RatifiedContract extends BasicContract_1.BasicContract {
|
|
|
82
77
|
*/
|
|
83
78
|
integrityCheck() {
|
|
84
79
|
if (__classPrivateFieldGet(this, _RatifiedContract_secret, "f") !== __classPrivateFieldGet(_a, _a, "f", _RatifiedContract_SECRET)) {
|
|
85
|
-
throw new
|
|
80
|
+
throw new ContractException('Integrity violation detected. This is not permitted.');
|
|
86
81
|
}
|
|
87
82
|
}
|
|
88
83
|
constructor(config) {
|
|
@@ -95,7 +90,7 @@ class RatifiedContract extends BasicContract_1.BasicContract {
|
|
|
95
90
|
if (isRatifiableConfig(config)) {
|
|
96
91
|
return config;
|
|
97
92
|
}
|
|
98
|
-
throw new
|
|
93
|
+
throw new ContractException("RatifiedContract requires either a test or cast function must be present.");
|
|
99
94
|
}
|
|
100
95
|
}
|
|
101
96
|
_a = RatifiedContract, _RatifiedContract_secret = new WeakMap();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RatifiedContract.js","sourceRoot":"","sources":["../../src/api/RatifiedContract.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RatifiedContract.js","sourceRoot":"","sources":["../../src/api/RatifiedContract.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAA8B,YAAY,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAExG;;;;;;;;GAQG;AACH,MAAM,UAAU,MAAM,CAAI,MAA8B;IACtD,OAAO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