@oneaddress/conformance 3.1.0 → 3.3.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.
package/dist/plan.d.ts ADDED
@@ -0,0 +1,52 @@
1
+ /**
2
+ * How big a conformance run will be, BEFORE it runs.
3
+ *
4
+ * ── WHY THIS IS ITS OWN MODULE WITH NO IMPORTS ─────────────────────────────
5
+ *
6
+ * The only caller that needs it is the partner portal's Testing card, which is
7
+ * a `'use client'` React component. `checks.ts` reaches `node:crypto` and
8
+ * `@oneaddress/crypto` on the first line, so importing the planner from there
9
+ * drags a key-agreement implementation into the browser bundle to answer a
10
+ * question about arithmetic. This file imports NOTHING, deliberately, and must
11
+ * stay that way: the next person to need a constant from `checks.ts` here
12
+ * should copy the constant, not add the import.
13
+ *
14
+ * `checks.ts` re-exports it so server-side callers keep one import.
15
+ */
16
+ /**
17
+ * Which NON-kind checks a given option set will produce, in run order.
18
+ *
19
+ * ── WHY THIS EXISTS AND WHY IT IS GUARDED BY EXECUTION ─────────────────────
20
+ *
21
+ * The partner portal's Testing card has to say how many checks it is about to
22
+ * run, before it runs them. It did that with `const BASE_CHECK_COUNT = 8` and
23
+ * two conditionals typed into the component, under a comment warning that the
24
+ * number "is the kind that gets reintroduced by the next optional check unless
25
+ * the number is derived rather than typed". It then stayed 8 while the suite
26
+ * the card now calls has eleven unconditional checks, so the card promised ten
27
+ * and ran fifteen.
28
+ *
29
+ * A PLANNER IS A SECOND ENCODING OF THE SUITE AND WOULD DRIFT TOO, so it is not
30
+ * trusted: `src/__tests__/planner-matches-run.test.ts` EXECUTES the suite
31
+ * against a stub receiver and asserts this function's output equals the
32
+ * non-kind ids the run actually produced, for every combination of the gates.
33
+ * A check added without a line here fails that test rather than quietly
34
+ * mis-sizing the card.
35
+ *
36
+ * KIND CHECKS ARE DELIBERATELY NOT COUNTED. How many there are depends on what
37
+ * the RECEIVER declares on its first acknowledgement, which is not known until
38
+ * check-1 has run. The card says "plus the update-kind checks your receiver's
39
+ * own declaration drives" instead of guessing, which is the honest form.
40
+ */
41
+ declare function plannedCoreCheckIds(opts: {
42
+ /** The partner has a registered encryption key. */
43
+ hasKey?: boolean;
44
+ /** `partners.verifies_account_reference` resolved to true. */
45
+ verifiesAccountReference?: boolean;
46
+ /** The receiver declared it handles key-crossover siblings. */
47
+ supportsKeyCrossover?: boolean;
48
+ /** A customer-app base URL was supplied, adding the pull-API checks. */
49
+ hasCustomerUrl?: boolean;
50
+ }): string[];
51
+
52
+ export { plannedCoreCheckIds };
package/dist/plan.js ADDED
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/plan.ts
21
+ var plan_exports = {};
22
+ __export(plan_exports, {
23
+ plannedCoreCheckIds: () => plannedCoreCheckIds
24
+ });
25
+ module.exports = __toCommonJS(plan_exports);
26
+ function plannedCoreCheckIds(opts) {
27
+ const ids = [
28
+ "check-1",
29
+ "check-2",
30
+ "check-3",
31
+ "check-4",
32
+ "check-5",
33
+ "check-6",
34
+ "check-7",
35
+ "check-8",
36
+ "check-9",
37
+ "check-10"
38
+ ];
39
+ if (opts.hasKey) ids.push("check-11");
40
+ if (opts.verifiesAccountReference && opts.hasKey) ids.push("check-14");
41
+ if (opts.supportsKeyCrossover && opts.hasKey) ids.push("check-15");
42
+ ids.push("check-16");
43
+ if (opts.hasCustomerUrl) ids.push("check-12", "check-13");
44
+ return ids;
45
+ }
46
+ // Annotate the CommonJS export names for ESM import in node:
47
+ 0 && (module.exports = {
48
+ plannedCoreCheckIds
49
+ });
package/package.json CHANGED
@@ -1,15 +1,19 @@
1
1
  {
2
2
  "name": "@oneaddress/conformance",
3
- "version": "3.1.0",
3
+ "version": "3.3.0",
4
4
  "description": "Conformance test tool for OneAddress partner integrations",
5
5
  "license": "Apache-2.0",
6
6
  "bin": {
7
7
  "oneaddress-conformance": "./dist/index.js"
8
8
  },
9
- "files": ["LICENSE", "dist", "README.md"],
9
+ "files": [
10
+ "LICENSE",
11
+ "dist",
12
+ "README.md"
13
+ ],
10
14
  "scripts": {
11
- "build": "tsup",
12
- "prepare": "tsup",
15
+ "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsup",
16
+ "prepare": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsup",
13
17
  "type-check": "tsc --noEmit"
14
18
  },
15
19
  "publishConfig": {