@pithy-sh/core 0.7.1 → 0.7.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/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +1 -1
- package/dist/worker/identity.d.ts +14 -0
- package/dist/worker/identity.d.ts.map +1 -1
- package/dist/worker/identity.js +15 -1
- package/package.json +1 -1
- package/src/version.generated.ts +1 -1
- package/src/worker/identity.ts +15 -0
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
/** This package's npm name — the join key against a release feed. */
|
|
4
4
|
export declare const PACKAGE_NAME = "@pithy-sh/core";
|
|
5
5
|
/** This package's version, stamped from its own package.json at generation time. */
|
|
6
|
-
export declare const PACKAGE_VERSION = "0.7.
|
|
6
|
+
export declare const PACKAGE_VERSION = "0.7.2";
|
|
7
7
|
//# sourceMappingURL=version.generated.d.ts.map
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
/** This package's npm name — the join key against a release feed. */
|
|
5
5
|
const PACKAGE_NAME = "@pithy-sh/core";
|
|
6
6
|
/** This package's version, stamped from its own package.json at generation time. */
|
|
7
|
-
const PACKAGE_VERSION = "0.7.
|
|
7
|
+
const PACKAGE_VERSION = "0.7.2";
|
|
8
8
|
//#endregion
|
|
9
9
|
export { PACKAGE_NAME, PACKAGE_VERSION };
|
|
@@ -65,6 +65,20 @@ export declare const WORKER_VAR = "WORKER";
|
|
|
65
65
|
* silently absent in every scaffolded project.
|
|
66
66
|
*/
|
|
67
67
|
export declare const VERSION_METADATA_BINDING = "CF_VERSION_METADATA";
|
|
68
|
+
/**
|
|
69
|
+
* The service binding a Worker reaches **itself** through (#616).
|
|
70
|
+
*
|
|
71
|
+
* **A Worker cannot fetch its own hostname.** The subrequest leaves the isolate, loops back through the
|
|
72
|
+
* edge into the Worker it came from, and hangs until Cloudflare answers 522 — on a deployment where the
|
|
73
|
+
* same route answers `401` in 1.4s from outside. So a project that administers itself dispatches inside
|
|
74
|
+
* the runtime instead: `env.SELF.fetch(request)` reaches the same script with no edge hop.
|
|
75
|
+
*
|
|
76
|
+
* Like the three vars above, it is a name that has to be agreed rather than derived — the binding
|
|
77
|
+
* `pithy provision` writes into every stanza it generates for a project that declares
|
|
78
|
+
* `administersItself`, and the one an app reads off `env`. It lives here so neither side, in this
|
|
79
|
+
* repository or in a management client built on it, spells it a second way.
|
|
80
|
+
*/
|
|
81
|
+
export declare const SELF_BINDING = "SELF";
|
|
68
82
|
/** Where a Worker is running, as it can state about itself. Every field is `null` when unstamped. */
|
|
69
83
|
export interface WorkerIdentity {
|
|
70
84
|
/** The owning project, or `null` when the Worker carries no `PROJECT` var. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/worker/identity.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,qFAAqF;AACrF,eAAO,MAAM,WAAW,YAAY,CAAC;AAErC,2FAA2F;AAC3F,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAE7C;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB,wBAAwB,CAAC;AAEvD;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,WAAW,CAAC;AAEnC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,wBAAwB,wBAAwB,CAAC;AAE9D,qGAAqG;AACrG,MAAM,WAAW,cAAc;IAC7B,8EAA8E;IAC9E,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,wEAAwE;IACxE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,2EAA2E;IAC3E,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB;;;;;;;;OAQG;IACH,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,qBAAqB;IACpC,yGAAyG;IACzG,EAAE,EAAE,MAAM,GAAG,IAAI,CA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MAAM,WAAW,qBAAqB;IACpC,yGAAyG;IACzG,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB;;;;;;;OAOG;IACH,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAgBD;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,cAAc,CAW3D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,qBAAqB,CAazE;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAEzD"}
|
package/dist/worker/identity.js
CHANGED
|
@@ -66,6 +66,20 @@ const WORKER_VAR = "WORKER";
|
|
|
66
66
|
* silently absent in every scaffolded project.
|
|
67
67
|
*/
|
|
68
68
|
const VERSION_METADATA_BINDING = "CF_VERSION_METADATA";
|
|
69
|
+
/**
|
|
70
|
+
* The service binding a Worker reaches **itself** through (#616).
|
|
71
|
+
*
|
|
72
|
+
* **A Worker cannot fetch its own hostname.** The subrequest leaves the isolate, loops back through the
|
|
73
|
+
* edge into the Worker it came from, and hangs until Cloudflare answers 522 — on a deployment where the
|
|
74
|
+
* same route answers `401` in 1.4s from outside. So a project that administers itself dispatches inside
|
|
75
|
+
* the runtime instead: `env.SELF.fetch(request)` reaches the same script with no edge hop.
|
|
76
|
+
*
|
|
77
|
+
* Like the three vars above, it is a name that has to be agreed rather than derived — the binding
|
|
78
|
+
* `pithy provision` writes into every stanza it generates for a project that declares
|
|
79
|
+
* `administersItself`, and the one an app reads off `env`. It lives here so neither side, in this
|
|
80
|
+
* repository or in a management client built on it, spells it a second way.
|
|
81
|
+
*/
|
|
82
|
+
const SELF_BINDING = "SELF";
|
|
69
83
|
/** One binding field, or `null` for anything that is not a non-empty string. */
|
|
70
84
|
function carried(meta, field) {
|
|
71
85
|
const value = meta[field];
|
|
@@ -161,4 +175,4 @@ function workerVersion(env) {
|
|
|
161
175
|
return workerVersionMetadata(env).id;
|
|
162
176
|
}
|
|
163
177
|
//#endregion
|
|
164
|
-
export { ENVIRONMENT_VAR, PROJECT_VAR, VERSION_METADATA_BINDING, WORKER_ORIGIN_VAR, WORKER_VAR, workerIdentity, workerVersion, workerVersionMetadata };
|
|
178
|
+
export { ENVIRONMENT_VAR, PROJECT_VAR, SELF_BINDING, VERSION_METADATA_BINDING, WORKER_ORIGIN_VAR, WORKER_VAR, workerIdentity, workerVersion, workerVersionMetadata };
|
package/package.json
CHANGED
package/src/version.generated.ts
CHANGED
package/src/worker/identity.ts
CHANGED
|
@@ -72,6 +72,21 @@ export const WORKER_VAR = "WORKER";
|
|
|
72
72
|
*/
|
|
73
73
|
export const VERSION_METADATA_BINDING = "CF_VERSION_METADATA";
|
|
74
74
|
|
|
75
|
+
/**
|
|
76
|
+
* The service binding a Worker reaches **itself** through (#616).
|
|
77
|
+
*
|
|
78
|
+
* **A Worker cannot fetch its own hostname.** The subrequest leaves the isolate, loops back through the
|
|
79
|
+
* edge into the Worker it came from, and hangs until Cloudflare answers 522 — on a deployment where the
|
|
80
|
+
* same route answers `401` in 1.4s from outside. So a project that administers itself dispatches inside
|
|
81
|
+
* the runtime instead: `env.SELF.fetch(request)` reaches the same script with no edge hop.
|
|
82
|
+
*
|
|
83
|
+
* Like the three vars above, it is a name that has to be agreed rather than derived — the binding
|
|
84
|
+
* `pithy provision` writes into every stanza it generates for a project that declares
|
|
85
|
+
* `administersItself`, and the one an app reads off `env`. It lives here so neither side, in this
|
|
86
|
+
* repository or in a management client built on it, spells it a second way.
|
|
87
|
+
*/
|
|
88
|
+
export const SELF_BINDING = "SELF";
|
|
89
|
+
|
|
75
90
|
/** Where a Worker is running, as it can state about itself. Every field is `null` when unstamped. */
|
|
76
91
|
export interface WorkerIdentity {
|
|
77
92
|
/** The owning project, or `null` when the Worker carries no `PROJECT` var. */
|