@nucypher/taco 0.6.0-alpha.3 → 0.7.0-alpha.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.
Files changed (99) hide show
  1. package/dist/cjs/conditions/base/address-allowlist.d.ts +10 -0
  2. package/dist/cjs/conditions/base/address-allowlist.js +19 -0
  3. package/dist/cjs/conditions/base/address-allowlist.js.map +1 -0
  4. package/dist/cjs/conditions/base/index.d.ts +2 -0
  5. package/dist/cjs/conditions/base/index.js +3 -1
  6. package/dist/cjs/conditions/base/index.js.map +1 -1
  7. package/dist/cjs/conditions/base/signing.d.ts +10 -0
  8. package/dist/cjs/conditions/base/signing.js +32 -0
  9. package/dist/cjs/conditions/base/signing.js.map +1 -0
  10. package/dist/cjs/conditions/condition-factory.js +8 -0
  11. package/dist/cjs/conditions/condition-factory.js.map +1 -1
  12. package/dist/cjs/conditions/context/context.d.ts +4 -0
  13. package/dist/cjs/conditions/context/context.js +28 -3
  14. package/dist/cjs/conditions/context/context.js.map +1 -1
  15. package/dist/cjs/conditions/schemas/address-allowlist.d.ts +16 -0
  16. package/dist/cjs/conditions/schemas/address-allowlist.js +20 -0
  17. package/dist/cjs/conditions/schemas/address-allowlist.js.map +1 -0
  18. package/dist/cjs/conditions/schemas/common.d.ts +1 -0
  19. package/dist/cjs/conditions/schemas/common.js +16 -3
  20. package/dist/cjs/conditions/schemas/common.js.map +1 -1
  21. package/dist/cjs/conditions/schemas/contract.d.ts +21 -18
  22. package/dist/cjs/conditions/schemas/export-for-zod-doc-gen.d.ts +2 -0
  23. package/dist/cjs/conditions/schemas/export-for-zod-doc-gen.js +3 -0
  24. package/dist/cjs/conditions/schemas/export-for-zod-doc-gen.js.map +1 -1
  25. package/dist/cjs/conditions/schemas/json-api.d.ts +47 -14
  26. package/dist/cjs/conditions/schemas/json-api.js +16 -2
  27. package/dist/cjs/conditions/schemas/json-api.js.map +1 -1
  28. package/dist/cjs/conditions/schemas/json-rpc.d.ts +48 -13
  29. package/dist/cjs/conditions/schemas/json-rpc.js +16 -2
  30. package/dist/cjs/conditions/schemas/json-rpc.js.map +1 -1
  31. package/dist/cjs/conditions/schemas/jwt.d.ts +2 -4
  32. package/dist/cjs/conditions/schemas/return-value-test.d.ts +28 -12
  33. package/dist/cjs/conditions/schemas/return-value-test.js +19 -5
  34. package/dist/cjs/conditions/schemas/return-value-test.js.map +1 -1
  35. package/dist/cjs/conditions/schemas/rpc.d.ts +18 -12
  36. package/dist/cjs/conditions/schemas/signing.d.ts +12 -0
  37. package/dist/cjs/conditions/schemas/signing.js +204 -0
  38. package/dist/cjs/conditions/schemas/signing.js.map +1 -0
  39. package/dist/cjs/conditions/schemas/time.d.ts +16 -8
  40. package/dist/cjs/conditions/schemas/utils.js +6 -1
  41. package/dist/cjs/conditions/schemas/utils.js.map +1 -1
  42. package/dist/cjs/index.d.ts +1 -0
  43. package/dist/cjs/index.js +3 -1
  44. package/dist/cjs/index.js.map +1 -1
  45. package/dist/cjs/sign.d.ts +24 -0
  46. package/dist/cjs/sign.js +88 -0
  47. package/dist/cjs/sign.js.map +1 -0
  48. package/dist/cjs/types.d.ts +1 -0
  49. package/dist/es/conditions/base/address-allowlist.d.ts +10 -0
  50. package/dist/es/conditions/base/address-allowlist.js +15 -0
  51. package/dist/es/conditions/base/address-allowlist.js.map +1 -0
  52. package/dist/es/conditions/base/index.d.ts +2 -0
  53. package/dist/es/conditions/base/index.js +2 -0
  54. package/dist/es/conditions/base/index.js.map +1 -1
  55. package/dist/es/conditions/base/signing.d.ts +10 -0
  56. package/dist/es/conditions/base/signing.js +20 -0
  57. package/dist/es/conditions/base/signing.js.map +1 -0
  58. package/dist/es/conditions/condition-factory.js +8 -0
  59. package/dist/es/conditions/condition-factory.js.map +1 -1
  60. package/dist/es/conditions/context/context.d.ts +4 -0
  61. package/dist/es/conditions/context/context.js +27 -2
  62. package/dist/es/conditions/context/context.js.map +1 -1
  63. package/dist/es/conditions/schemas/address-allowlist.d.ts +16 -0
  64. package/dist/es/conditions/schemas/address-allowlist.js +17 -0
  65. package/dist/es/conditions/schemas/address-allowlist.js.map +1 -0
  66. package/dist/es/conditions/schemas/common.d.ts +1 -0
  67. package/dist/es/conditions/schemas/common.js +15 -2
  68. package/dist/es/conditions/schemas/common.js.map +1 -1
  69. package/dist/es/conditions/schemas/contract.d.ts +21 -18
  70. package/dist/es/conditions/schemas/export-for-zod-doc-gen.d.ts +2 -0
  71. package/dist/es/conditions/schemas/export-for-zod-doc-gen.js +3 -0
  72. package/dist/es/conditions/schemas/export-for-zod-doc-gen.js.map +1 -1
  73. package/dist/es/conditions/schemas/json-api.d.ts +47 -14
  74. package/dist/es/conditions/schemas/json-api.js +17 -3
  75. package/dist/es/conditions/schemas/json-api.js.map +1 -1
  76. package/dist/es/conditions/schemas/json-rpc.d.ts +48 -13
  77. package/dist/es/conditions/schemas/json-rpc.js +17 -3
  78. package/dist/es/conditions/schemas/json-rpc.js.map +1 -1
  79. package/dist/es/conditions/schemas/jwt.d.ts +2 -4
  80. package/dist/es/conditions/schemas/return-value-test.d.ts +28 -12
  81. package/dist/es/conditions/schemas/return-value-test.js +19 -5
  82. package/dist/es/conditions/schemas/return-value-test.js.map +1 -1
  83. package/dist/es/conditions/schemas/rpc.d.ts +18 -12
  84. package/dist/es/conditions/schemas/signing.d.ts +12 -0
  85. package/dist/es/conditions/schemas/signing.js +201 -0
  86. package/dist/es/conditions/schemas/signing.js.map +1 -0
  87. package/dist/es/conditions/schemas/time.d.ts +16 -8
  88. package/dist/es/conditions/schemas/utils.js +6 -1
  89. package/dist/es/conditions/schemas/utils.js.map +1 -1
  90. package/dist/es/index.d.ts +1 -0
  91. package/dist/es/index.js +1 -0
  92. package/dist/es/index.js.map +1 -1
  93. package/dist/es/sign.d.ts +24 -0
  94. package/dist/es/sign.js +85 -0
  95. package/dist/es/sign.js.map +1 -0
  96. package/dist/es/types.d.ts +1 -0
  97. package/dist/tsconfig.cjs.tsbuildinfo +1 -1
  98. package/dist/tsconfig.es.tsbuildinfo +1 -1
  99. package/package.json +5 -4
@@ -0,0 +1,10 @@
1
+ import { Condition } from '../condition';
2
+ import { AddressAllowlistConditionProps, AddressAllowlistConditionType } from '../schemas/address-allowlist';
3
+ import { OmitConditionType } from '../shared';
4
+ export { AddressAllowlistConditionProps, AddressAllowlistConditionType };
5
+ /**
6
+ * A condition that checks if a wallet address is in a list of allowed addresses.
7
+ */
8
+ export declare class AddressAllowlistCondition extends Condition {
9
+ constructor(value: OmitConditionType<AddressAllowlistConditionProps>);
10
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddressAllowlistCondition = exports.AddressAllowlistConditionType = void 0;
4
+ const condition_1 = require("../condition");
5
+ const address_allowlist_1 = require("../schemas/address-allowlist");
6
+ Object.defineProperty(exports, "AddressAllowlistConditionType", { enumerable: true, get: function () { return address_allowlist_1.AddressAllowlistConditionType; } });
7
+ /**
8
+ * A condition that checks if a wallet address is in a list of allowed addresses.
9
+ */
10
+ class AddressAllowlistCondition extends condition_1.Condition {
11
+ constructor(value) {
12
+ super(address_allowlist_1.addressAllowlistConditionSchema, {
13
+ conditionType: address_allowlist_1.AddressAllowlistConditionType,
14
+ ...value,
15
+ });
16
+ }
17
+ }
18
+ exports.AddressAllowlistCondition = AddressAllowlistCondition;
19
+ //# sourceMappingURL=address-allowlist.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address-allowlist.js","sourceRoot":"","sources":["../../../../src/conditions/base/address-allowlist.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AACzC,oEAIsC;AAEG,8GAHvC,iDAA6B,OAGuC;AAEtE;;GAEG;AACH,MAAa,yBAA0B,SAAQ,qBAAS;IACtD,YAAY,KAAwD;QAClE,KAAK,CAAC,mDAA+B,EAAE;YACrC,aAAa,EAAE,iDAA6B;YAC5C,GAAG,KAAK;SACT,CAAC,CAAC;IACL,CAAC;CACF;AAPD,8DAOC"}
@@ -1,6 +1,8 @@
1
+ export * as addressAllowlist from './address-allowlist';
1
2
  export * as contract from './contract';
2
3
  export * as jsonApi from './json-api';
3
4
  export * as jsonRpc from './json-rpc';
4
5
  export * as jwt from './jwt';
5
6
  export * as rpc from './rpc';
7
+ export * as signing from './signing';
6
8
  export * as time from './time';
@@ -35,11 +35,13 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  };
36
36
  })();
37
37
  Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.time = exports.rpc = exports.jwt = exports.jsonRpc = exports.jsonApi = exports.contract = void 0;
38
+ exports.time = exports.signing = exports.rpc = exports.jwt = exports.jsonRpc = exports.jsonApi = exports.contract = exports.addressAllowlist = void 0;
39
+ exports.addressAllowlist = __importStar(require("./address-allowlist"));
39
40
  exports.contract = __importStar(require("./contract"));
40
41
  exports.jsonApi = __importStar(require("./json-api"));
41
42
  exports.jsonRpc = __importStar(require("./json-rpc"));
42
43
  exports.jwt = __importStar(require("./jwt"));
43
44
  exports.rpc = __importStar(require("./rpc"));
45
+ exports.signing = __importStar(require("./signing"));
44
46
  exports.time = __importStar(require("./time"));
45
47
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/conditions/base/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,gDAAgD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhD,uDAAuC;AACvC,sDAAsC;AACtC,sDAAsC;AACtC,6CAA6B;AAC7B,6CAA6B;AAC7B,+CAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/conditions/base/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,gDAAgD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhD,wEAAwD;AACxD,uDAAuC;AACvC,sDAAsC;AACtC,sDAAsC;AACtC,6CAA6B;AAC7B,6CAA6B;AAC7B,qDAAqC;AACrC,+CAA+B"}
@@ -0,0 +1,10 @@
1
+ import { Condition } from '../condition';
2
+ import { SigningObjectAbiAttributeConditionProps, SigningObjectAttributeConditionProps } from '../schemas/signing';
3
+ import { OmitConditionType } from '../shared';
4
+ export { AbiCallValidationProps, abiCallValidationSchema, AbiParameterValidationProps, abiParameterValidationSchema, SIGNING_CONDITION_OBJECT_CONTEXT_VAR, SigningObjectAbiAttributeConditionProps, signingObjectAbiAttributeConditionSchema, SigningObjectAbiAttributeConditionType, SigningObjectAttributeConditionProps, signingObjectAttributeConditionSchema, SigningObjectAttributeConditionType, } from '../schemas/signing';
5
+ export declare class SigningObjectAttributeCondition extends Condition {
6
+ constructor(value: OmitConditionType<SigningObjectAttributeConditionProps>);
7
+ }
8
+ export declare class SigningObjectAbiAttributeCondition extends Condition {
9
+ constructor(value: OmitConditionType<SigningObjectAbiAttributeConditionProps>);
10
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SigningObjectAbiAttributeCondition = exports.SigningObjectAttributeCondition = exports.SigningObjectAttributeConditionType = exports.signingObjectAttributeConditionSchema = exports.SigningObjectAbiAttributeConditionType = exports.signingObjectAbiAttributeConditionSchema = exports.SIGNING_CONDITION_OBJECT_CONTEXT_VAR = exports.abiParameterValidationSchema = exports.abiCallValidationSchema = void 0;
4
+ const condition_1 = require("../condition");
5
+ const signing_1 = require("../schemas/signing");
6
+ var signing_2 = require("../schemas/signing");
7
+ Object.defineProperty(exports, "abiCallValidationSchema", { enumerable: true, get: function () { return signing_2.abiCallValidationSchema; } });
8
+ Object.defineProperty(exports, "abiParameterValidationSchema", { enumerable: true, get: function () { return signing_2.abiParameterValidationSchema; } });
9
+ Object.defineProperty(exports, "SIGNING_CONDITION_OBJECT_CONTEXT_VAR", { enumerable: true, get: function () { return signing_2.SIGNING_CONDITION_OBJECT_CONTEXT_VAR; } });
10
+ Object.defineProperty(exports, "signingObjectAbiAttributeConditionSchema", { enumerable: true, get: function () { return signing_2.signingObjectAbiAttributeConditionSchema; } });
11
+ Object.defineProperty(exports, "SigningObjectAbiAttributeConditionType", { enumerable: true, get: function () { return signing_2.SigningObjectAbiAttributeConditionType; } });
12
+ Object.defineProperty(exports, "signingObjectAttributeConditionSchema", { enumerable: true, get: function () { return signing_2.signingObjectAttributeConditionSchema; } });
13
+ Object.defineProperty(exports, "SigningObjectAttributeConditionType", { enumerable: true, get: function () { return signing_2.SigningObjectAttributeConditionType; } });
14
+ class SigningObjectAttributeCondition extends condition_1.Condition {
15
+ constructor(value) {
16
+ super(signing_1.signingObjectAttributeConditionSchema, {
17
+ conditionType: signing_1.SigningObjectAttributeConditionType,
18
+ ...value,
19
+ });
20
+ }
21
+ }
22
+ exports.SigningObjectAttributeCondition = SigningObjectAttributeCondition;
23
+ class SigningObjectAbiAttributeCondition extends condition_1.Condition {
24
+ constructor(value) {
25
+ super(signing_1.signingObjectAbiAttributeConditionSchema, {
26
+ conditionType: signing_1.SigningObjectAbiAttributeConditionType,
27
+ ...value,
28
+ });
29
+ }
30
+ }
31
+ exports.SigningObjectAbiAttributeCondition = SigningObjectAbiAttributeCondition;
32
+ //# sourceMappingURL=signing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signing.js","sourceRoot":"","sources":["../../../../src/conditions/base/signing.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AACzC,gDAO4B;AAG5B,8CAY4B;AAV1B,kHAAA,uBAAuB,OAAA;AAEvB,uHAAA,4BAA4B,OAAA;AAC5B,+HAAA,oCAAoC,OAAA;AAEpC,mIAAA,wCAAwC,OAAA;AACxC,iIAAA,sCAAsC,OAAA;AAEtC,gIAAA,qCAAqC,OAAA;AACrC,8HAAA,mCAAmC,OAAA;AAGrC,MAAa,+BAAgC,SAAQ,qBAAS;IAC5D,YAAY,KAA8D;QACxE,KAAK,CAAC,+CAAqC,EAAE;YAC3C,aAAa,EAAE,6CAAmC;YAClD,GAAG,KAAK;SACT,CAAC,CAAC;IACL,CAAC;CACF;AAPD,0EAOC;AAED,MAAa,kCAAmC,SAAQ,qBAAS;IAC/D,YACE,KAAiE;QAEjE,KAAK,CAAC,kDAAwC,EAAE;YAC9C,aAAa,EAAE,gDAAsC;YACrD,GAAG,KAAK;SACT,CAAC,CAAC;IACL,CAAC;CACF;AATD,gFASC"}
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ConditionFactory = void 0;
4
+ const address_allowlist_1 = require("./base/address-allowlist");
4
5
  const contract_1 = require("./base/contract");
5
6
  const json_api_1 = require("./base/json-api");
6
7
  const json_rpc_1 = require("./base/json-rpc");
7
8
  const jwt_1 = require("./base/jwt");
8
9
  const rpc_1 = require("./base/rpc");
10
+ const signing_1 = require("./base/signing");
9
11
  const time_1 = require("./base/time");
10
12
  const compound_condition_1 = require("./compound-condition");
11
13
  const if_then_else_condition_1 = require("./if-then-else-condition");
@@ -27,6 +29,12 @@ class ConditionFactory {
27
29
  return new json_rpc_1.JsonRpcCondition(props);
28
30
  case jwt_1.JWTConditionType:
29
31
  return new jwt_1.JWTCondition(props);
32
+ case address_allowlist_1.AddressAllowlistConditionType:
33
+ return new address_allowlist_1.AddressAllowlistCondition(props);
34
+ case signing_1.SigningObjectAttributeConditionType:
35
+ return new signing_1.SigningObjectAttributeCondition(props);
36
+ case signing_1.SigningObjectAbiAttributeConditionType:
37
+ return new signing_1.SigningObjectAbiAttributeCondition(props);
30
38
  // Logical Conditions
31
39
  case compound_condition_1.CompoundConditionType:
32
40
  return new compound_condition_1.CompoundCondition(props);
@@ -1 +1 @@
1
- {"version":3,"file":"condition-factory.js","sourceRoot":"","sources":["../../../src/conditions/condition-factory.ts"],"names":[],"mappings":";;;AAAA,8CAIyB;AACzB,8CAIyB;AACzB,8CAIyB;AACzB,oCAA+E;AAC/E,oCAA+E;AAC/E,sCAIqB;AACrB,6DAI8B;AAE9B,qEAIkC;AAClC,6CAIsB;AAEtB,MAAM,0BAA0B,GAAG,CAAC,IAAY,EAAE,EAAE,CAClD,2BAA2B,IAAI,EAAE,CAAC;AAEpC,MAAa,gBAAgB;IACpB,MAAM,CAAC,kBAAkB,CAAC,KAAqB;QACpD,QAAQ,KAAK,CAAC,aAAa,EAAE,CAAC;YAC5B,kBAAkB;YAClB,KAAK,sBAAgB;gBACnB,OAAO,IAAI,kBAAY,CAAC,KAA0B,CAAC,CAAC;YACtD,KAAK,wBAAiB;gBACpB,OAAO,IAAI,oBAAa,CAAC,KAA2B,CAAC,CAAC;YACxD,KAAK,gCAAqB;gBACxB,OAAO,IAAI,4BAAiB,CAAC,KAA+B,CAAC,CAAC;YAChE,KAAK,+BAAoB;gBACvB,OAAO,IAAI,2BAAgB,CAAC,KAA8B,CAAC,CAAC;YAC9D,KAAK,+BAAoB;gBACvB,OAAO,IAAI,2BAAgB,CAAC,KAA8B,CAAC,CAAC;YAC9D,KAAK,sBAAgB;gBACnB,OAAO,IAAI,kBAAY,CAAC,KAA0B,CAAC,CAAC;YACtD,qBAAqB;YACrB,KAAK,0CAAqB;gBACxB,OAAO,IAAI,sCAAiB,CAAC,KAA+B,CAAC,CAAC;YAChE,KAAK,oCAAuB;gBAC1B,OAAO,IAAI,gCAAmB,CAAC,KAAiC,CAAC,CAAC;YACpE,KAAK,gDAAuB;gBAC1B,OAAO,IAAI,4CAAmB,CAAC,KAAiC,CAAC,CAAC;YACpE;gBACE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;CACF;AA3BD,4CA2BC"}
1
+ {"version":3,"file":"condition-factory.js","sourceRoot":"","sources":["../../../src/conditions/condition-factory.ts"],"names":[],"mappings":";;;AAAA,gEAIkC;AAClC,8CAIyB;AACzB,8CAIyB;AACzB,8CAIyB;AACzB,oCAA+E;AAC/E,oCAA+E;AAC/E,4CAOwB;AACxB,sCAIqB;AACrB,6DAI8B;AAE9B,qEAIkC;AAClC,6CAIsB;AAEtB,M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1,9 +1,12 @@
1
1
  import { ThresholdMessageKit } from '@nucypher/nucypher-core';
2
+ import { Domain } from '@nucypher/shared';
2
3
  import { AuthProvider, AuthSignature } from '@nucypher/taco-auth';
4
+ import { ethers } from 'ethers';
3
5
  import { CoreContext } from '../../types';
4
6
  import { Condition } from '../condition';
5
7
  export type CustomContextParam = string | number | boolean | bigint | Uint8Array;
6
8
  export type ContextParam = CustomContextParam | AuthSignature;
9
+ export declare const AUTOMATICALLY_INJECTED_CONTEXT_PARAMS: string[];
7
10
  export declare const RESERVED_CONTEXT_PARAMS: string[];
8
11
  export declare class ConditionContext {
9
12
  requestedContextParameters: Set<string>;
@@ -25,4 +28,5 @@ export declare class ConditionContext {
25
28
  toCoreContext(): Promise<CoreContext>;
26
29
  toContextParameters: () => Promise<Record<string, ContextParam>>;
27
30
  static fromMessageKit(messageKit: ThresholdMessageKit): ConditionContext;
31
+ static forSigningCohort(provider: ethers.providers.JsonRpcProvider, domain: Domain, cohortId: number, chainId: number): Promise<ConditionContext>;
28
32
  }
@@ -1,11 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ConditionContext = exports.RESERVED_CONTEXT_PARAMS = void 0;
3
+ exports.ConditionContext = exports.RESERVED_CONTEXT_PARAMS = exports.AUTOMATICALLY_INJECTED_CONTEXT_PARAMS = void 0;
4
+ const shared_1 = require("@nucypher/shared");
4
5
  const taco_auth_1 = require("@nucypher/taco-auth");
6
+ const ethers_1 = require("ethers");
5
7
  const types_1 = require("../../types");
6
8
  const utils_1 = require("../../utils");
7
9
  const condition_expr_1 = require("../condition-expr");
8
10
  const const_1 = require("../const");
11
+ const signing_1 = require("../schemas/signing");
9
12
  const ERR_RESERVED_PARAM = (key) => `Cannot use reserved parameter name ${key} as custom parameter`;
10
13
  const ERR_INVALID_CUSTOM_PARAM = (key) => `Custom parameter ${key} must start with ${const_1.CONTEXT_PARAM_PREFIX}`;
11
14
  const ERR_AUTH_PROVIDER_REQUIRED = (key) => `No matching authentication provider to satisfy ${key} context variable in condition`;
@@ -13,6 +16,7 @@ const ERR_MISSING_CONTEXT_PARAMS = (params) => `Missing custom context parameter
13
16
  const ERR_UNKNOWN_CUSTOM_CONTEXT_PARAM = (param) => `Unknown custom context parameter: ${param}`;
14
17
  const ERR_INVALID_AUTH_PROVIDER_TYPE = (param, expected) => `Invalid AuthProvider type for ${param}; expected ${expected}`;
15
18
  const ERR_AUTH_PROVIDER_NOT_NEEDED_FOR_CONTEXT_PARAM = (param) => `AuthProvider not necessary for context parameter: ${param}`;
19
+ const ERR_AUTO_INJECTED_CONTEXT_PARAM = (param) => `Context parameter ${param} is automatically injected and cannot be set manually`;
16
20
  const EXPECTED_AUTH_PROVIDER_TYPES = {
17
21
  [taco_auth_1.USER_ADDRESS_PARAM_DEFAULT]: [
18
22
  taco_auth_1.EIP4361AuthProvider,
@@ -20,7 +24,14 @@ const EXPECTED_AUTH_PROVIDER_TYPES = {
20
24
  taco_auth_1.SingleSignOnEIP4361AuthProvider,
21
25
  ],
22
26
  };
23
- exports.RESERVED_CONTEXT_PARAMS = [taco_auth_1.USER_ADDRESS_PARAM_DEFAULT];
27
+ exports.AUTOMATICALLY_INJECTED_CONTEXT_PARAMS = [
28
+ // These context parameters are automatically injected on the node side.
29
+ signing_1.SIGNING_CONDITION_OBJECT_CONTEXT_VAR,
30
+ ];
31
+ exports.RESERVED_CONTEXT_PARAMS = [
32
+ taco_auth_1.USER_ADDRESS_PARAM_DEFAULT,
33
+ signing_1.SIGNING_CONDITION_OBJECT_CONTEXT_VAR,
34
+ ];
24
35
  class ConditionContext {
25
36
  requestedContextParameters;
26
37
  customContextParameters = {};
@@ -78,6 +89,9 @@ class ConditionContext {
78
89
  if (!ConditionContext.isContextParameter(customParam)) {
79
90
  throw new Error(ERR_INVALID_CUSTOM_PARAM(customParam));
80
91
  }
92
+ if (exports.AUTOMATICALLY_INJECTED_CONTEXT_PARAMS.includes(customParam)) {
93
+ throw new Error(ERR_AUTO_INJECTED_CONTEXT_PARAM(customParam));
94
+ }
81
95
  if (exports.RESERVED_CONTEXT_PARAMS.includes(customParam)) {
82
96
  throw new Error(ERR_RESERVED_PARAM(customParam));
83
97
  }
@@ -138,7 +152,9 @@ class ConditionContext {
138
152
  const properties = Object.keys(condition);
139
153
  properties.forEach((prop) => {
140
154
  this.findContextParameter(condition[prop]).forEach((contextVar) => {
141
- requestedParameters.add(contextVar);
155
+ if (!exports.AUTOMATICALLY_INJECTED_CONTEXT_PARAMS.includes(contextVar)) {
156
+ requestedParameters.add(contextVar);
157
+ }
142
158
  });
143
159
  });
144
160
  return requestedParameters;
@@ -177,6 +193,15 @@ class ConditionContext {
177
193
  const conditionExpr = condition_expr_1.ConditionExpression.fromCoreConditions(messageKit.acp.conditions);
178
194
  return new ConditionContext(conditionExpr.condition);
179
195
  }
196
+ static async forSigningCohort(provider, domain, cohortId, chainId) {
197
+ // get signing condition from SigningCoordinator contract
198
+ const cohortConditionHex = await shared_1.SigningCoordinatorAgent.getSigningCohortConditions(provider, domain, cohortId, chainId);
199
+ // Convert hex string to UTF-8 JSON string
200
+ const cohortConditionJson = ethers_1.ethers.utils.toUtf8String(cohortConditionHex);
201
+ const cohortCondition = new types_1.CoreConditions(cohortConditionJson);
202
+ const conditionExpr = condition_expr_1.ConditionExpression.fromCoreConditions(cohortCondition);
203
+ return new ConditionContext(conditionExpr.condition);
204
+ }
180
205
  }
181
206
  exports.ConditionContext = ConditionContext;
182
207
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../src/conditions/context/context.ts"],"names":[],"mappings":";;;AACA,mDAO6B;AAE7B,uCAA0D;AAC1D,uCAAqC;AAErC,sDAAwD;AACxD,oCAKkB;AAUlB,MAAM,kBAAkB,GAAG,CAAC,GAAW,EAAE,EAAE,CACzC,sCAAsC,GAAG,sBAAsB,CAAC;AAClE,MAAM,wBAAwB,GAAG,CAAC,GAAW,EAAE,EAAE,CA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,EAC1C,MAAc,EACd,QAAgB,EAChB,OAAe;QAEf,yDAAyD;QACzD,MAAM,kBAAkB,GACtB,MAAM,gCAAuB,CAAC,0BAA0B,CACtD,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,OAAO,CACR,CAAC;QAEJ,0CAA0C;QAC1C,MAAM,mBAAmB,GAAG,eAAM,CAAC,KAAK,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC;QAE1E,MAAM,eAAe,GAAG,IAAI,sBAAc,CAAC,mBAAmB,CAAC,CAAC;QAChE,MAAM,aAAa,GACjB,oCAAmB,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC;QAC1D,OAAO,IAAI,gBAAgB,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;IACvD,CAAC;CACF;AA1OD,4CA0OC"}
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ export declare const AddressAllowlistConditionType = "address-allowlist";
3
+ export declare const addressAllowlistConditionSchema: z.ZodObject<{} & {
4
+ conditionType: z.ZodLiteral<"address-allowlist">;
5
+ userAddress: z.ZodLiteral<":userAddress">;
6
+ addresses: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
7
+ }, "strict", z.ZodTypeAny, {
8
+ conditionType: "address-allowlist";
9
+ userAddress: ":userAddress";
10
+ addresses: string[];
11
+ }, {
12
+ conditionType: "address-allowlist";
13
+ userAddress: ":userAddress";
14
+ addresses: string[];
15
+ }>;
16
+ export type AddressAllowlistConditionProps = z.infer<typeof addressAllowlistConditionSchema>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addressAllowlistConditionSchema = exports.AddressAllowlistConditionType = void 0;
4
+ const shared_1 = require("@nucypher/shared");
5
+ const zod_1 = require("zod");
6
+ const common_1 = require("./common");
7
+ exports.AddressAllowlistConditionType = 'address-allowlist';
8
+ exports.addressAllowlistConditionSchema = common_1.baseConditionSchema
9
+ .extend({
10
+ conditionType: zod_1.z.literal(exports.AddressAllowlistConditionType),
11
+ userAddress: common_1.UserAddressSchema,
12
+ addresses: zod_1.z
13
+ .array(shared_1.EthAddressSchemaStrict)
14
+ .min(1, 'At least one address must be provided')
15
+ .max(25, 'A maximum of 25 addresses is allowed')
16
+ .describe('List of wallet addresses allowed to decrypt. Addresses should be provided in checksummed form.'),
17
+ })
18
+ .strict()
19
+ .describe('Address Allowlist Condition for allowing decryption for specific wallet addresses. It is very handy when combined with other conditions.');
20
+ //# sourceMappingURL=address-allowlist.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address-allowlist.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/address-allowlist.ts"],"names":[],"mappings":";;;AAAA,6CAA0D;AAC1D,6BAAwB;AAExB,qCAAkE;AAErD,QAAA,6BAA6B,GAAG,mBAAmB,CAAC;AAEpD,QAAA,+BAA+B,GAAG,4BAAmB;KAC/D,MAAM,CAAC;IACN,aAAa,EAAE,OAAC,CAAC,OAAO,CAAC,qCAA6B,CAAC;IACvD,WAAW,EAAE,0BAAiB;IAC9B,SAAS,EAAE,OAAC;SACT,KAAK,CAAC,+BAAsB,CAAC;SAC7B,GAAG,CAAC,CAAC,EAAE,uCAAuC,CAAC;SAC/C,GAAG,CAAC,EAAE,EAAE,sCAAsC,CAAC;SAC/C,QAAQ,CACP,gGAAgG,CACjG;CACJ,CAAC;KACD,MAAM,EAAE;KACR,QAAQ,CACP,0IAA0I,CAC3I,CAAC"}
@@ -11,4 +11,5 @@ export declare const baseConditionSchema: z.ZodObject<{
11
11
  declare function createUnionSchema<T extends readonly Primitive[]>(values: T): z.ZodNever | z.ZodLiteral<Primitive> | z.ZodUnion<[z.ZodLiteral<Primitive>, z.ZodLiteral<Primitive>, ...z.ZodLiteral<Primitive>[]]>;
12
12
  export default createUnionSchema;
13
13
  export declare const jsonPathSchema: z.ZodEffects<z.ZodString, string, string>;
14
+ export declare const jsonAuthorizationTypeSchema: z.ZodEnum<["Bearer", "Basic", "X-API-Key"]>;
14
15
  export declare const httpsURLSchema: z.ZodEffects<z.ZodString, string, string>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.httpsURLSchema = exports.jsonPathSchema = exports.baseConditionSchema = exports.UserAddressSchema = exports.plainStringSchema = void 0;
3
+ exports.httpsURLSchema = exports.jsonAuthorizationTypeSchema = exports.jsonPathSchema = exports.baseConditionSchema = exports.UserAddressSchema = exports.plainStringSchema = void 0;
4
4
  const jsonpath_1 = require("@astronautlabs/jsonpath");
5
5
  const taco_auth_1 = require("@nucypher/taco-auth");
6
6
  const zod_1 = require("zod");
@@ -19,7 +19,9 @@ exports.UserAddressSchema = zod_1.z
19
19
  .literal(taco_auth_1.USER_ADDRESS_PARAM_DEFAULT)
20
20
  .describe('This is a context variable that will be replaced at decryption time. It represents the Ethereum address of the requester attempting decryption.');
21
21
  exports.baseConditionSchema = zod_1.z.object({
22
- conditionType: zod_1.z.string(),
22
+ conditionType: zod_1.z
23
+ .string()
24
+ .describe('A unique identifier that indicates the condition variant in its serialized form. It is set automatically at every sub-class constructor when a new object is being created.'),
23
25
  });
24
26
  // Source: https://github.com/colinhacks/zod/issues/831#issuecomment-1063481764
25
27
  const createUnion = (values) => {
@@ -57,8 +59,19 @@ exports.jsonPathSchema = zod_1.z
57
59
  })
58
60
  .describe('A string containing either a valid JSON Path Expression, or a Context Parameter.');
59
61
  const validateHttpsURL = (url) => {
60
- return URL.canParse(url) && url.startsWith('https://');
62
+ try {
63
+ const parsedUrl = new URL(url);
64
+ // Check if the URL is valid and uses HTTPS
65
+ return parsedUrl.protocol === 'https:';
66
+ }
67
+ catch (e) {
68
+ // If URL constructor throws, the URL is invalid
69
+ return false;
70
+ }
61
71
  };
72
+ exports.jsonAuthorizationTypeSchema = zod_1.z
73
+ .enum(['Bearer', 'Basic', 'X-API-Key'])
74
+ .describe('The type of authorization to use when making the request.');
62
75
  // Use our own URL refinement check due to https://github.com/colinhacks/zod/issues/2236
63
76
  exports.httpsURLSchema = zod_1.z
64
77
  .string()
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/common.ts"],"names":[],"mappings":";;;AAAA,sDAAmD;AACnD,mDAAiE;AACjE,6BAA+C;AAE/C,oCAAsE;AAEtE,kEAAkE;AAClE,mDAAmD;AACtC,QAAA,iBAAiB,GAAG,OAAC;KAC/B,MAAM,EAAE;KACR,MAAM,CACL,CAAC,GAAG,EAAE,EAAE;IACN,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,4BAAoB,CAAC,CAAC;AAC/C,CAAC,EACD;IACE,OAAO,EAAE,+DAA+D,4BAAoB,GAAG;CAChG,CACF;KACA,QAAQ,CACP,yEAAyE,4BAAoB,KAAK,CACnG,CAAC;AAES,QAAA,iBAAiB,GAAG,OAAC;KAC/B,OAAO,CAAC,sCAA0B,CAAC;KACnC,QAAQ,CACP,iJAAiJ,CAClJ,CAAC;AAES,QAAA,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1C,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE;CAC1B,CAAC,CAAC;AAEH,+EAA+E;AAC/E,MAAM,WAAW,GAAG,CAGlB,MAAS,EACT,EAAE;IACF,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAIzD,CAAC;IACF,OAAO,OAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AAC9B,CAAC,CAAC;AAEF,SAAS,iBAAiB,CAAiC,MAAS;IAClE,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,OAAC,CAAC,KAAK,EAAE,CAAC;IACnB,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,OAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,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AAQ,CAAC,EAAE,CAAC;QACxC,kBAAkB;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,mBAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC;AAEW,QAAA,cAAc,GAAG,OAAC;KAC5B,MAAM,EAAE;KACR,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE;IACtC,OAAO,EAAE,6BAA6B;CACvC,CAAC;KACD,QAAQ,CACP,kFAAkF,CACnF,CAAC;AAEJ,MAAM,gBAAgB,GAAG,CAAC,GAAW,EAAW,EAAE;IAChD,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QAC/B,2CAA2C;QAC3C,OAAO,SAAS,CAAC,QAAQ,KAAK,QAAQ,CAAC;IACzC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,gDAAgD;QAChD,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC;AAEW,QAAA,2BAA2B,GAAG,OAAC;KACzC,IAAI,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;KACtC,QAAQ,CAAC,2DAA2D,CAAC,CAAC;AAEzE,wFAAwF;AAC3E,QAAA,cAAc,GAAG,OAAC;KAC5B,MAAM,EAAE;KACR,GAAG,EAAE;KACL,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE;IACtC,OAAO,EAAE,aAAa;CACvB,CAAC,CAAC"}
@@ -153,28 +153,31 @@ export declare const functionAbiSchema: z.ZodEffects<z.ZodEffects<z.ZodObject<{
153
153
  }>;
154
154
  export type FunctionAbiProps = z.infer<typeof functionAbiSchema>;
155
155
  export declare const ContractConditionType = "contract";
156
- export declare const contractConditionSchema: z.ZodEffects<z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
157
- conditionType: z.ZodString;
158
- }, {
159
- conditionType: z.ZodDefault<z.ZodLiteral<"rpc">>;
156
+ export declare const contractConditionSchema: z.ZodEffects<z.ZodObject<{
160
157
  chain: z.ZodNumber;
161
- method: z.ZodEnum<["eth_getBalance"]>;
162
- parameters: z.ZodUnion<[z.ZodTuple<[z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodLiteral<":userAddress">, z.ZodString]>, z.ZodUnion<[z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodEnum<["earliest", "finalized", "safe", "latest", "pending"]>]>, z.ZodString]>], null>, z.ZodTuple<[z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodLiteral<":userAddress">, z.ZodString]>], null>]>;
163
- returnValueTest: z.ZodObject<z.objectUtil.extendShape<{
158
+ returnValueTest: z.ZodEffects<z.ZodObject<{
164
159
  index: z.ZodOptional<z.ZodNumber>;
165
- comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!="]>;
166
- }, {
160
+ comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!=", "in", "!in"]>;
161
+ } & {
167
162
  value: z.ZodType<any, z.ZodTypeDef, any>;
168
- }>, "strip", z.ZodTypeAny, {
169
- comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
163
+ }, "strip", z.ZodTypeAny, {
164
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
170
165
  value?: any;
171
166
  index?: number | undefined;
172
167
  }, {
173
- comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
168
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
169
+ value?: any;
170
+ index?: number | undefined;
171
+ }>, {
172
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
173
+ value?: any;
174
+ index?: number | undefined;
175
+ }, {
176
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
174
177
  value?: any;
175
178
  index?: number | undefined;
176
179
  }>;
177
- }>, {
180
+ } & {
178
181
  conditionType: z.ZodDefault<z.ZodLiteral<"contract">>;
179
182
  contractAddress: z.ZodEffects<z.ZodString, string, string>;
180
183
  standardContractType: z.ZodOptional<z.ZodEnum<["ERC20", "ERC721"]>>;
@@ -319,13 +322,13 @@ export declare const contractConditionSchema: z.ZodEffects<z.ZodObject<z.objectU
319
322
  stateMutability: "view" | "pure";
320
323
  }>>;
321
324
  parameters: z.ZodArray<z.ZodType<any, z.ZodTypeDef, any>, "many">;
322
- }>, "strip", z.ZodTypeAny, {
325
+ }, "strip", z.ZodTypeAny, {
323
326
  conditionType: "contract";
324
327
  chain: number;
325
328
  method: string;
326
329
  parameters: any[];
327
330
  returnValueTest: {
328
- comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
331
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
329
332
  value?: any;
330
333
  index?: number | undefined;
331
334
  };
@@ -355,7 +358,7 @@ export declare const contractConditionSchema: z.ZodEffects<z.ZodObject<z.objectU
355
358
  method: string;
356
359
  parameters: any[];
357
360
  returnValueTest: {
358
- comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
361
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
359
362
  value?: any;
360
363
  index?: number | undefined;
361
364
  };
@@ -387,7 +390,7 @@ export declare const contractConditionSchema: z.ZodEffects<z.ZodObject<z.objectU
387
390
  method: string;
388
391
  parameters: any[];
389
392
  returnValueTest: {
390
- comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
393
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
391
394
  value?: any;
392
395
  index?: number | undefined;
393
396
  };
@@ -417,7 +420,7 @@ export declare const contractConditionSchema: z.ZodEffects<z.ZodObject<z.objectU
417
420
  method: string;
418
421
  parameters: any[];
419
422
  returnValueTest: {
420
- comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
423
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
421
424
  value?: any;
422
425
  index?: number | undefined;
423
426
  };
@@ -15,4 +15,6 @@ export * from './jwt';
15
15
  export * from './return-value-test';
16
16
  export * from './rpc';
17
17
  export * from './sequential';
18
+ export * from './signing';
18
19
  export * from './time';
20
+ export * from './address-allowlist';
@@ -33,5 +33,8 @@ __exportStar(require("./jwt"), exports);
33
33
  __exportStar(require("./return-value-test"), exports);
34
34
  __exportStar(require("./rpc"), exports);
35
35
  __exportStar(require("./sequential"), exports);
36
+ __exportStar(require("./signing"), exports);
36
37
  __exportStar(require("./time"), exports);
38
+ // ts-unused-exports:disable-next-line - this comment line is added to prevent lint from changing or objecting the export order.
39
+ __exportStar(require("./address-allowlist"), exports);
37
40
  //# sourceMappingURL=export-for-zod-doc-gen.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"export-for-zod-doc-gen.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/export-for-zod-doc-gen.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,gIAAgI;AAChI,2CAAyB;AACzB,4CAA0B;AAC1B,gIAAgI;AAChI,6CAA2B;AAC3B,6CAA2B;AAC3B,iDAA+B;AAC/B,6CAA2B;AAC3B,6CAA2B;AAC3B,wCAAsB;AACtB,sDAAoC;AACpC,wCAAsB;AACtB,+CAA6B;AAC7B,yCAAuB"}
1
+ {"version":3,"file":"export-for-zod-doc-gen.js","sourceRoot":"","sources":["../../../../src/conditions/schemas/export-for-zod-doc-gen.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,gIAAgI;AAChI,2CAAyB;AACzB,4CAA0B;AAC1B,gIAAgI;AAChI,6CAA2B;AAC3B,6CAA2B;AAC3B,iDAA+B;AAC/B,6CAA2B;AAC3B,6CAA2B;AAC3B,wCAAsB;AACtB,sDAAoC;AACpC,wCAAsB;AACtB,+CAA6B;AAC7B,4CAA0B;AAC1B,yCAAuB;AACvB,gIAAgI;AAChI,sDAAoC"}
@@ -1,48 +1,81 @@
1
1
  import { z } from 'zod';
2
2
  export declare const JsonApiConditionType = "json-api";
3
- export declare const jsonApiConditionSchema: z.ZodObject<z.objectUtil.extendShape<{
4
- conditionType: z.ZodString;
5
- }, {
3
+ export declare const jsonApiConditionSchema: z.ZodEffects<z.ZodObject<{} & {
6
4
  conditionType: z.ZodDefault<z.ZodLiteral<"json-api">>;
7
5
  endpoint: z.ZodEffects<z.ZodString, string, string>;
8
6
  parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
9
7
  query: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
10
8
  authorizationToken: z.ZodOptional<z.ZodString>;
11
- returnValueTest: z.ZodObject<z.objectUtil.extendShape<{
9
+ authorizationType: z.ZodOptional<z.ZodEnum<["Bearer", "Basic", "X-API-Key"]>>;
10
+ returnValueTest: z.ZodEffects<z.ZodObject<{
12
11
  index: z.ZodOptional<z.ZodNumber>;
13
- comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!="]>;
14
- }, {
12
+ comparator: z.ZodEnum<["==", ">", "<", ">=", "<=", "!=", "in", "!in"]>;
13
+ } & {
15
14
  value: z.ZodType<any, z.ZodTypeDef, any>;
16
- }>, "strip", z.ZodTypeAny, {
17
- comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
15
+ }, "strip", z.ZodTypeAny, {
16
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
17
+ value?: any;
18
+ index?: number | undefined;
19
+ }, {
20
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
21
+ value?: any;
22
+ index?: number | undefined;
23
+ }>, {
24
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
18
25
  value?: any;
19
26
  index?: number | undefined;
20
27
  }, {
21
- comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
28
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
22
29
  value?: any;
23
30
  index?: number | undefined;
24
31
  }>;
25
- }>, "strip", z.ZodTypeAny, {
32
+ }, "strip", z.ZodTypeAny, {
26
33
  conditionType: "json-api";
34
+ endpoint: string;
27
35
  returnValueTest: {
28
- comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
36
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
29
37
  value?: any;
30
38
  index?: number | undefined;
31
39
  };
40
+ query?: string | undefined;
41
+ authorizationToken?: string | undefined;
42
+ authorizationType?: "Bearer" | "Basic" | "X-API-Key" | undefined;
43
+ parameters?: Record<string, unknown> | undefined;
44
+ }, {
32
45
  endpoint: string;
46
+ returnValueTest: {
47
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
48
+ value?: any;
49
+ index?: number | undefined;
50
+ };
51
+ conditionType?: "json-api" | undefined;
52
+ query?: string | undefined;
53
+ authorizationToken?: string | undefined;
54
+ authorizationType?: "Bearer" | "Basic" | "X-API-Key" | undefined;
33
55
  parameters?: Record<string, unknown> | undefined;
56
+ }>, {
57
+ conditionType: "json-api";
58
+ endpoint: string;
59
+ returnValueTest: {
60
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
61
+ value?: any;
62
+ index?: number | undefined;
63
+ };
34
64
  query?: string | undefined;
35
65
  authorizationToken?: string | undefined;
66
+ authorizationType?: "Bearer" | "Basic" | "X-API-Key" | undefined;
67
+ parameters?: Record<string, unknown> | undefined;
36
68
  }, {
69
+ endpoint: string;
37
70
  returnValueTest: {
38
- comparator: "==" | ">" | "<" | ">=" | "<=" | "!=";
71
+ comparator: "==" | ">" | "<" | ">=" | "<=" | "!=" | "in" | "!in";
39
72
  value?: any;
40
73
  index?: number | undefined;
41
74
  };
42
- endpoint: string;
43
75
  conditionType?: "json-api" | undefined;
44
- parameters?: Record<string, unknown> | undefined;
45
76
  query?: string | undefined;
46
77
  authorizationToken?: string | undefined;
78
+ authorizationType?: "Bearer" | "Basic" | "X-API-Key" | undefined;
79
+ parameters?: Record<string, unknown> | undefined;
47
80
  }>;
48
81
  export type JsonApiConditionProps = z.infer<typeof jsonApiConditionSchema>;