@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/package.json
CHANGED
package/src/dev.ts
CHANGED
|
@@ -73,6 +73,33 @@ export interface DevelopmentOptions {
|
|
|
73
73
|
|
|
74
74
|
const DEFAULT_QUESTION = "Has this been through staging?";
|
|
75
75
|
|
|
76
|
+
/**
|
|
77
|
+
* Where development mode points when you want a real person to answer: a
|
|
78
|
+
* free account. Tagged so the site can count sign-ups that came from here.
|
|
79
|
+
*/
|
|
80
|
+
export const DEVELOPMENT_SIGN_UP_URL =
|
|
81
|
+
"https://deliverd.dev/sign-up?utm_source=devmode&utm_medium=sdk&utm_campaign=typescript";
|
|
82
|
+
|
|
83
|
+
let hinted = false;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* One line, once per process, after the first simulated approval: how to
|
|
87
|
+
* have a real person answer. Not in CI (nobody reads it there) and off with
|
|
88
|
+
* `DELIVERD_DEV_HINT=0`.
|
|
89
|
+
*/
|
|
90
|
+
function hintOnce(): void {
|
|
91
|
+
if (hinted) return;
|
|
92
|
+
hinted = true;
|
|
93
|
+
const env = typeof process !== "undefined" ? process.env : {};
|
|
94
|
+
if (env.DELIVERD_DEV_HINT === "0" || env.CI) return;
|
|
95
|
+
console.log(` Ready for a real person to answer on their phone? Free account, no card: ${DEVELOPMENT_SIGN_UP_URL}\n`);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** For tests: show the hint again. */
|
|
99
|
+
export function resetDevelopmentHint(): void {
|
|
100
|
+
hinted = false;
|
|
101
|
+
}
|
|
102
|
+
|
|
76
103
|
let counter = 0;
|
|
77
104
|
|
|
78
105
|
interface Stored {
|
|
@@ -176,7 +203,10 @@ export function developmentFetch(options: DevelopmentOptions = {}): typeof globa
|
|
|
176
203
|
outcome,
|
|
177
204
|
options,
|
|
178
205
|
});
|
|
179
|
-
if (options.log !== false)
|
|
206
|
+
if (options.log !== false) {
|
|
207
|
+
announce(data, outcome);
|
|
208
|
+
hintOnce();
|
|
209
|
+
}
|
|
180
210
|
return json(data, 201);
|
|
181
211
|
}
|
|
182
212
|
|