@deliverd/sdk 0.42.0 → 0.42.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev.d.ts +7 -0
- package/dist/dev.d.ts.map +1 -1
- package/dist/dev.js +27 -1
- package/dist/released.d.ts +1 -1
- package/dist/released.d.ts.map +1 -1
- package/dist/released.js +1576 -0
- package/package.json +1 -1
- package/src/dev.ts +31 -1
- package/src/released.ts +1576 -0
package/dist/dev.d.ts
CHANGED
|
@@ -52,6 +52,13 @@ export interface DevelopmentOptions {
|
|
|
52
52
|
/** Print what the approver would have seen. Default true. */
|
|
53
53
|
log?: boolean;
|
|
54
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Where development mode points when you want a real person to answer: a
|
|
57
|
+
* free account. Tagged so the site can count sign-ups that came from here.
|
|
58
|
+
*/
|
|
59
|
+
export declare const DEVELOPMENT_SIGN_UP_URL = "https://deliverd.dev/sign-up?utm_source=devmode&utm_medium=sdk&utm_campaign=typescript";
|
|
60
|
+
/** For tests: show the hint again. */
|
|
61
|
+
export declare function resetDevelopmentHint(): void;
|
|
55
62
|
/**
|
|
56
63
|
* A `fetch` that serves the approvals, reviews and collections APIs from memory.
|
|
57
64
|
*
|
package/dist/dev.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../src/dev.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAYb,MAAM,YAAY,CAAC;AAIpB;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;AAE7F,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,OAAO,CAAC,EAAE,kBAAkB,GAAG,CAAC,CAAC,OAAO,EAAE,YAAY,KAAK,kBAAkB,CAA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dev.js
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
import { assessCounts, DEFAULT_SCREEN_POLICY, describeCounts } from "./data-screen.js";
|
|
2
2
|
import { applyPurview } from "./purview-rules.js";
|
|
3
3
|
const DEFAULT_QUESTION = "Has this been through staging?";
|
|
4
|
+
/**
|
|
5
|
+
* Where development mode points when you want a real person to answer: a
|
|
6
|
+
* free account. Tagged so the site can count sign-ups that came from here.
|
|
7
|
+
*/
|
|
8
|
+
export const DEVELOPMENT_SIGN_UP_URL = "https://deliverd.dev/sign-up?utm_source=devmode&utm_medium=sdk&utm_campaign=typescript";
|
|
9
|
+
let hinted = false;
|
|
10
|
+
/**
|
|
11
|
+
* One line, once per process, after the first simulated approval: how to
|
|
12
|
+
* have a real person answer. Not in CI (nobody reads it there) and off with
|
|
13
|
+
* `DELIVERD_DEV_HINT=0`.
|
|
14
|
+
*/
|
|
15
|
+
function hintOnce() {
|
|
16
|
+
if (hinted)
|
|
17
|
+
return;
|
|
18
|
+
hinted = true;
|
|
19
|
+
const env = typeof process !== "undefined" ? process.env : {};
|
|
20
|
+
if (env.DELIVERD_DEV_HINT === "0" || env.CI)
|
|
21
|
+
return;
|
|
22
|
+
console.log(` Ready for a real person to answer on their phone? Free account, no card: ${DEVELOPMENT_SIGN_UP_URL}\n`);
|
|
23
|
+
}
|
|
24
|
+
/** For tests: show the hint again. */
|
|
25
|
+
export function resetDevelopmentHint() {
|
|
26
|
+
hinted = false;
|
|
27
|
+
}
|
|
4
28
|
let counter = 0;
|
|
5
29
|
/**
|
|
6
30
|
* A `fetch` that serves the approvals, reviews and collections APIs from memory.
|
|
@@ -90,8 +114,10 @@ export function developmentFetch(options = {}) {
|
|
|
90
114
|
outcome,
|
|
91
115
|
options,
|
|
92
116
|
});
|
|
93
|
-
if (options.log !== false)
|
|
117
|
+
if (options.log !== false) {
|
|
94
118
|
announce(data, outcome);
|
|
119
|
+
hintOnce();
|
|
120
|
+
}
|
|
95
121
|
return json(data, 201);
|
|
96
122
|
}
|
|
97
123
|
const match = /^\/approvals\/([^/]+)(\/answers|\/cancel)?$/.exec(path);
|
package/dist/released.d.ts
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
* **Add the version here when you publish it, not before.** An entry is a
|
|
44
44
|
* claim that `npm install @deliverd/sdk@x` works today.
|
|
45
45
|
*/
|
|
46
|
-
export declare const PUBLISHED_TO_NPM: readonly ["0.1.0", "0.2.0", "0.3.0", "0.4.0", "0.5.0", "0.6.0", "0.6.1", "0.6.2", "0.7.0", "0.7.1", "0.8.0", "0.8.1", "0.8.2", "0.9.0", "0.10.0", "0.11.0", "0.11.1", "0.12.0", "0.13.0", "0.14.0", "0.15.0", "0.16.0", "0.17.0", "0.18.0", "0.19.0", "0.20.0", "0.21.0", "0.22.0", "0.23.0", "0.24.0", "0.24.1", "0.25.0", "0.25.1", "0.26.0", "0.27.0", "0.28.0", "0.29.0", "0.30.0", "0.31.0", "0.32.0", "0.33.0", "0.34.0", "0.35.0", "0.36.0", "0.37.0", "0.38.0", "0.39.0", "0.39.1", "0.40.0", "0.41.0"];
|
|
46
|
+
export declare const PUBLISHED_TO_NPM: readonly ["0.1.0", "0.2.0", "0.3.0", "0.4.0", "0.5.0", "0.6.0", "0.6.1", "0.6.2", "0.7.0", "0.7.1", "0.8.0", "0.8.1", "0.8.2", "0.9.0", "0.10.0", "0.11.0", "0.11.1", "0.12.0", "0.13.0", "0.14.0", "0.15.0", "0.16.0", "0.17.0", "0.18.0", "0.19.0", "0.20.0", "0.21.0", "0.22.0", "0.23.0", "0.24.0", "0.24.1", "0.25.0", "0.25.1", "0.26.0", "0.27.0", "0.28.0", "0.29.0", "0.30.0", "0.31.0", "0.32.0", "0.33.0", "0.34.0", "0.35.0", "0.36.0", "0.37.0", "0.38.0", "0.39.0", "0.39.1", "0.40.0", "0.41.0", "0.42.0"];
|
|
47
47
|
/**
|
|
48
48
|
* A fingerprint of what each *published* version recorded.
|
|
49
49
|
*
|
package/dist/released.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"released.d.ts","sourceRoot":"","sources":["../src/released.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"released.d.ts","sourceRoot":"","sources":["../src/released.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,gBAAgB,2fAoDnB,CAAC;AAEX;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAqIzC,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CA4l8CtD,CAAC"}
|