inngest 2.7.2 → 3.0.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/CHANGELOG.md +46 -0
- package/api/api.js +4 -4
- package/api/schema.d.ts +54 -6
- package/api/schema.d.ts.map +1 -1
- package/api/schema.js +17 -7
- package/api/schema.js.map +1 -1
- package/cloudflare.d.ts +6 -3
- package/cloudflare.d.ts.map +1 -1
- package/cloudflare.js +19 -41
- package/cloudflare.js.map +1 -1
- package/components/EventSchemas.d.ts +1 -12
- package/components/EventSchemas.d.ts.map +1 -1
- package/components/EventSchemas.js.map +1 -1
- package/components/Inngest.d.ts +44 -57
- package/components/Inngest.d.ts.map +1 -1
- package/components/Inngest.js +47 -26
- package/components/Inngest.js.map +1 -1
- package/components/InngestCommHandler.d.ts +156 -198
- package/components/InngestCommHandler.d.ts.map +1 -1
- package/components/InngestCommHandler.js +311 -305
- package/components/InngestCommHandler.js.map +1 -1
- package/components/InngestFunction.d.ts +9 -82
- package/components/InngestFunction.d.ts.map +1 -1
- package/components/InngestFunction.js +21 -413
- package/components/InngestFunction.js.map +1 -1
- package/components/InngestMiddleware.d.ts +37 -26
- package/components/InngestMiddleware.d.ts.map +1 -1
- package/components/InngestMiddleware.js +1 -3
- package/components/InngestMiddleware.js.map +1 -1
- package/components/InngestStepTools.d.ts +69 -37
- package/components/InngestStepTools.d.ts.map +1 -1
- package/components/InngestStepTools.js +34 -95
- package/components/InngestStepTools.js.map +1 -1
- package/components/NonRetriableError.d.ts.map +1 -1
- package/components/NonRetriableError.js +1 -0
- package/components/NonRetriableError.js.map +1 -1
- package/components/RetryAfterError.d.ts +38 -0
- package/components/RetryAfterError.d.ts.map +1 -0
- package/components/RetryAfterError.js +42 -0
- package/components/RetryAfterError.js.map +1 -0
- package/components/execution/InngestExecution.d.ts +72 -0
- package/components/execution/InngestExecution.d.ts.map +1 -0
- package/components/execution/InngestExecution.js +23 -0
- package/components/execution/InngestExecution.js.map +1 -0
- package/components/execution/v0.d.ts +114 -0
- package/components/execution/v0.d.ts.map +1 -0
- package/components/execution/v0.js +394 -0
- package/components/execution/v0.js.map +1 -0
- package/components/execution/v1.d.ts +88 -0
- package/components/execution/v1.d.ts.map +1 -0
- package/components/execution/v1.js +673 -0
- package/components/execution/v1.js.map +1 -0
- package/deno/fresh.d.ts +3 -3
- package/deno/fresh.d.ts.map +1 -1
- package/deno/fresh.js +17 -38
- package/deno/fresh.js.map +1 -1
- package/digitalocean.d.ts +5 -5
- package/digitalocean.d.ts.map +1 -1
- package/digitalocean.js +14 -46
- package/digitalocean.js.map +1 -1
- package/edge.d.ts +5 -5
- package/edge.d.ts.map +1 -1
- package/edge.js +16 -38
- package/edge.js.map +1 -1
- package/express.d.ts +7 -3
- package/express.d.ts.map +1 -1
- package/express.js +38 -45
- package/express.js.map +1 -1
- package/fastify.d.ts +8 -3
- package/fastify.d.ts.map +1 -1
- package/fastify.js +37 -47
- package/fastify.js.map +1 -1
- package/h3.d.ts +4 -3
- package/h3.d.ts.map +1 -1
- package/h3.js +18 -45
- package/h3.js.map +1 -1
- package/helpers/ServerTiming.d.ts.map +1 -1
- package/helpers/ServerTiming.js +2 -1
- package/helpers/ServerTiming.js.map +1 -1
- package/helpers/consts.d.ts +23 -9
- package/helpers/consts.d.ts.map +1 -1
- package/helpers/consts.js +31 -13
- package/helpers/consts.js.map +1 -1
- package/helpers/devserver.d.ts +0 -34
- package/helpers/devserver.d.ts.map +1 -1
- package/helpers/devserver.js.map +1 -1
- package/helpers/env.d.ts +14 -6
- package/helpers/env.d.ts.map +1 -1
- package/helpers/env.js +4 -4
- package/helpers/env.js.map +1 -1
- package/helpers/errors.d.ts +37 -2
- package/helpers/errors.d.ts.map +1 -1
- package/helpers/errors.js +66 -15
- package/helpers/errors.js.map +1 -1
- package/helpers/functions.d.ts +52 -5
- package/helpers/functions.d.ts.map +1 -1
- package/helpers/functions.js +121 -22
- package/helpers/functions.js.map +1 -1
- package/helpers/promises.d.ts +45 -0
- package/helpers/promises.d.ts.map +1 -1
- package/helpers/promises.js +69 -1
- package/helpers/promises.js.map +1 -1
- package/helpers/strings.d.ts +6 -1
- package/helpers/strings.d.ts.map +1 -1
- package/helpers/strings.js +7 -2
- package/helpers/strings.js.map +1 -1
- package/helpers/types.d.ts +5 -17
- package/helpers/types.d.ts.map +1 -1
- package/index.d.ts +4 -2
- package/index.d.ts.map +1 -1
- package/index.js +5 -1
- package/index.js.map +1 -1
- package/lambda.d.ts +10 -8
- package/lambda.d.ts.map +1 -1
- package/lambda.js +48 -72
- package/lambda.js.map +1 -1
- package/next.d.ts +11 -5
- package/next.d.ts.map +1 -1
- package/next.js +84 -103
- package/next.js.map +1 -1
- package/nuxt.d.ts +3 -3
- package/nuxt.d.ts.map +1 -1
- package/nuxt.js +5 -6
- package/nuxt.js.map +1 -1
- package/package.json +5 -4
- package/redwood.d.ts +4 -3
- package/redwood.d.ts.map +1 -1
- package/redwood.js +22 -48
- package/redwood.js.map +1 -1
- package/remix.d.ts +7 -5
- package/remix.d.ts.map +1 -1
- package/remix.js +15 -36
- package/remix.js.map +1 -1
- package/types.d.ts +126 -220
- package/types.d.ts.map +1 -1
- package/types.js +24 -45
- package/types.js.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/helpers/scalar.d.ts +0 -8
- package/helpers/scalar.d.ts.map +0 -1
- package/helpers/scalar.js +0 -19
- package/helpers/scalar.js.map +0 -1
package/fastify.js
CHANGED
|
@@ -1,55 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.serve = exports.
|
|
3
|
+
exports.serve = exports.frameworkName = void 0;
|
|
4
4
|
const InngestCommHandler_1 = require("./components/InngestCommHandler");
|
|
5
|
-
|
|
6
|
-
exports.name = "fastify";
|
|
5
|
+
exports.frameworkName = "fastify";
|
|
7
6
|
/**
|
|
8
7
|
* Serve and register any declared functions with Inngest, making them available
|
|
9
8
|
* to be triggered by events.
|
|
10
9
|
*
|
|
11
10
|
* @public
|
|
12
11
|
*/
|
|
13
|
-
const serve = (
|
|
14
|
-
const handler = new InngestCommHandler_1.InngestCommHandler(exports.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return {
|
|
41
|
-
isIntrospection: Object.hasOwnProperty.call(req.query, consts_1.queryKeys.Introspect),
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
}, (actionRes, _req, reply) => {
|
|
47
|
-
for (const [name, value] of Object.entries(actionRes.headers)) {
|
|
48
|
-
void reply.header(name, value);
|
|
49
|
-
}
|
|
50
|
-
void reply.code(actionRes.status);
|
|
51
|
-
return reply.send(actionRes.body);
|
|
52
|
-
});
|
|
12
|
+
const serve = (options) => {
|
|
13
|
+
const handler = new InngestCommHandler_1.InngestCommHandler(Object.assign(Object.assign({ frameworkName: exports.frameworkName }, options), { handler: (req, reply) => {
|
|
14
|
+
return {
|
|
15
|
+
body: () => req.body,
|
|
16
|
+
headers: (key) => {
|
|
17
|
+
const header = req.headers[key];
|
|
18
|
+
return Array.isArray(header) ? header[0] : header;
|
|
19
|
+
},
|
|
20
|
+
method: () => req.method,
|
|
21
|
+
url: () => {
|
|
22
|
+
const hostname = req.headers["host"];
|
|
23
|
+
const protocol = (hostname === null || hostname === void 0 ? void 0 : hostname.includes("://"))
|
|
24
|
+
? ""
|
|
25
|
+
: `${req.protocol}://`;
|
|
26
|
+
const url = new URL(req.url, `${protocol}${hostname || ""}`);
|
|
27
|
+
return url;
|
|
28
|
+
},
|
|
29
|
+
queryString: (key) => req.query[key],
|
|
30
|
+
transformResponse: ({ body, status, headers }) => {
|
|
31
|
+
for (const [name, value] of Object.entries(headers)) {
|
|
32
|
+
void reply.header(name, value);
|
|
33
|
+
}
|
|
34
|
+
void reply.code(status);
|
|
35
|
+
return reply.send(body);
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
} }));
|
|
53
39
|
return handler.createHandler();
|
|
54
40
|
};
|
|
55
41
|
exports.serve = serve;
|
|
@@ -61,14 +47,18 @@ exports.serve = serve;
|
|
|
61
47
|
*/
|
|
62
48
|
const fastifyPlugin = ((fastify, options, done) => {
|
|
63
49
|
var _a;
|
|
50
|
+
if (!(options === null || options === void 0 ? void 0 : options.client)) {
|
|
51
|
+
throw new Error("Inngest `client` is required when serving with Fastify plugin");
|
|
52
|
+
}
|
|
53
|
+
if (!(options === null || options === void 0 ? void 0 : options.functions)) {
|
|
54
|
+
throw new Error("Inngest `functions` are required when serving with Fastify plugin");
|
|
55
|
+
}
|
|
64
56
|
try {
|
|
65
|
-
|
|
66
|
-
const handler = (0, exports.serve)(options.client, options.functions, options.options);
|
|
57
|
+
const handler = (0, exports.serve)(Object.assign({ client: options === null || options === void 0 ? void 0 : options.client, functions: options === null || options === void 0 ? void 0 : options.functions }, options === null || options === void 0 ? void 0 : options.options));
|
|
67
58
|
fastify.route({
|
|
68
59
|
method: ["GET", "POST", "PUT"],
|
|
69
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
70
60
|
handler,
|
|
71
|
-
url: ((_a = options.options) === null || _a === void 0 ? void 0 : _a.servePath) || "/api/inngest",
|
|
61
|
+
url: ((_a = options === null || options === void 0 ? void 0 : options.options) === null || _a === void 0 ? void 0 : _a.servePath) || "/api/inngest",
|
|
72
62
|
});
|
|
73
63
|
done();
|
|
74
64
|
}
|
package/fastify.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fastify.js","sourceRoot":"","sources":["../src/fastify.ts"],"names":[],"mappings":";;;AAMA,wEAGyC;
|
|
1
|
+
{"version":3,"file":"fastify.js","sourceRoot":"","sources":["../src/fastify.ts"],"names":[],"mappings":";;;AAMA,wEAGyC;AAI5B,QAAA,aAAa,GAA2B,SAAS,CAAC;AAU/D;;;;;GAKG;AACI,MAAM,KAAK,GAAG,CAAC,OAA4B,EAAE,EAAE;IACpD,MAAM,OAAO,GAAG,IAAI,uCAAkB,+BACpC,aAAa,EAAb,qBAAa,IACV,OAAO,KACV,OAAO,EAAE,CACP,GAAwE,EACxE,KAAmB,EACnB,EAAE;YACF,OAAO;gBACL,IAAI,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI;gBACpB,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;oBACf,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;oBAChC,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;gBACpD,CAAC;gBACD,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM;gBACxB,GAAG,EAAE,GAAG,EAAE;oBACR,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;oBACrC,MAAM,QAAQ,GAAG,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,QAAQ,CAAC,KAAK,CAAC;wBACxC,CAAC,CAAC,EAAE;wBACJ,CAAC,CAAC,GAAG,GAAG,CAAC,QAAQ,KAAK,CAAC;oBAEzB,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,QAAQ,GAAG,QAAQ,IAAI,EAAE,EAAE,CAAC,CAAC;oBAE7D,OAAO,GAAG,CAAC;gBACb,CAAC;gBACD,WAAW,EAAE,CAAC,GAAG,EAAE,EAA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B,OAAO;YACP,GAAG,EAAE,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,0CAAE,SAAS,KAAI,cAAc;SACnD,CAAC,CAAC;QAEH,IAAI,EAAE,CAAC;KACR;IAAC,OAAO,GAAG,EAAE;QACZ,IAAI,CAAC,GAAY,CAAC,CAAC;KACpB;AACH,CAAC,CAAuD,CAAC;AAEzD,kBAAe,aAAa,CAAC"}
|
package/h3.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type H3Event } from "h3";
|
|
2
|
+
import { type ServeHandlerOptions } from "./components/InngestCommHandler";
|
|
2
3
|
import { type SupportedFrameworkName } from "./types";
|
|
3
|
-
export declare const
|
|
4
|
+
export declare const frameworkName: SupportedFrameworkName;
|
|
4
5
|
/**
|
|
5
6
|
* In h3, serve and register any declared functions with Inngest, making
|
|
6
7
|
* them available to be triggered by events.
|
|
7
8
|
*
|
|
8
9
|
* @public
|
|
9
10
|
*/
|
|
10
|
-
export declare const serve:
|
|
11
|
+
export declare const serve: (options: ServeHandlerOptions) => (event: H3Event<import("h3").EventHandlerRequest>) => Promise<void>;
|
|
11
12
|
//# sourceMappingURL=h3.d.ts.map
|
package/h3.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"h3.d.ts","sourceRoot":"","sources":["../src/h3.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"h3.d.ts","sourceRoot":"","sources":["../src/h3.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,OAAO,EACb,MAAM,IAAI,CAAC;AACZ,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,eAAO,MAAM,aAAa,EAAE,sBAA6B,CAAC;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,KAAK,YAAa,mBAAmB,wEA4BjD,CAAC"}
|
package/h3.js
CHANGED
|
@@ -1,59 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.serve = exports.
|
|
3
|
+
exports.serve = exports.frameworkName = void 0;
|
|
4
4
|
const h3_1 = require("h3");
|
|
5
5
|
const InngestCommHandler_1 = require("./components/InngestCommHandler");
|
|
6
|
-
const consts_1 = require("./helpers/consts");
|
|
7
6
|
const env_1 = require("./helpers/env");
|
|
8
|
-
exports.
|
|
7
|
+
exports.frameworkName = "h3";
|
|
9
8
|
/**
|
|
10
9
|
* In h3, serve and register any declared functions with Inngest, making
|
|
11
10
|
* them available to be triggered by events.
|
|
12
11
|
*
|
|
13
12
|
* @public
|
|
14
13
|
*/
|
|
15
|
-
const serve = (
|
|
16
|
-
const handler = new InngestCommHandler_1.InngestCommHandler(exports.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
data: await (0, h3_1.readBody)(event),
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
register: () => {
|
|
36
|
-
var _a;
|
|
37
|
-
if (method === "PUT") {
|
|
38
|
-
return {
|
|
39
|
-
deployId: (_a = query[consts_1.queryKeys.DeployId]) === null || _a === void 0 ? void 0 : _a.toString(),
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
view: () => {
|
|
44
|
-
if (method === "GET") {
|
|
45
|
-
return {
|
|
46
|
-
isIntrospection: query && consts_1.queryKeys.Introspect in query,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
}, (actionRes, event) => {
|
|
52
|
-
const { res } = event.node;
|
|
53
|
-
res.statusCode = actionRes.status;
|
|
54
|
-
(0, h3_1.setHeaders)(event, actionRes.headers);
|
|
55
|
-
return (0, h3_1.send)(event, actionRes.body);
|
|
56
|
-
});
|
|
14
|
+
const serve = (options) => {
|
|
15
|
+
const handler = new InngestCommHandler_1.InngestCommHandler(Object.assign(Object.assign({ frameworkName: exports.frameworkName }, options), { handler: (event) => {
|
|
16
|
+
return {
|
|
17
|
+
body: () => (0, h3_1.readBody)(event),
|
|
18
|
+
headers: (key) => (0, h3_1.getHeader)(event, key),
|
|
19
|
+
method: () => event.method,
|
|
20
|
+
url: () => new URL(String(event.path), `${(0, env_1.processEnv)("NODE_ENV") === "development" ? "http" : "https"}://${String((0, h3_1.getHeader)(event, "host"))}`),
|
|
21
|
+
queryString: (key) => String((0, h3_1.getQuery)(event)[key]),
|
|
22
|
+
transformResponse: (actionRes) => {
|
|
23
|
+
const { res } = event.node;
|
|
24
|
+
res.statusCode = actionRes.status;
|
|
25
|
+
(0, h3_1.setHeaders)(event, actionRes.headers);
|
|
26
|
+
return (0, h3_1.send)(event, actionRes.body);
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
} }));
|
|
57
30
|
return handler.createHandler();
|
|
58
31
|
};
|
|
59
32
|
exports.serve = serve;
|
package/h3.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"h3.js","sourceRoot":"","sources":["../src/h3.ts"],"names":[],"mappings":";;;AAAA,2BAOY;AACZ,wEAGyC;AACzC,
|
|
1
|
+
{"version":3,"file":"h3.js","sourceRoot":"","sources":["../src/h3.ts"],"names":[],"mappings":";;;AAAA,2BAOY;AACZ,wEAGyC;AACzC,uCAA2C;AAG9B,QAAA,aAAa,GAA2B,IAAI,CAAC;AAE1D;;;;;GAKG;AACI,MAAM,KAAK,GAAG,CAAC,OAA4B,EAAE,EAAE;IACpD,MAAM,OAAO,GAAG,IAAI,uCAAkB,+BACpC,aAAa,EAAb,qBAAa,IACV,OAAO,KACV,OAAO,EAAE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ts","sourceRoot":"","sources":["../../src/helpers/ServerTiming.ts"],"names":[],"mappings":"AAUA;;;;;;GAMG;AACH,qBAAa,YAAY;;IAGvB;;;OAGG;IACI,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,IAAI;IA4B5D;;;;;;;;OAQG;IACI,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAO/C;;;;;OAKG;IACU,IAAI,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,EACzD,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,CAAC,EACL,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IAUlC;;OAEG;IACI,SAAS,IAAI,MAAM;CA+B3B"}
|
package/helpers/ServerTiming.js
CHANGED
|
@@ -7,6 +7,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
7
7
|
var _ServerTiming_timings;
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.ServerTiming = void 0;
|
|
10
|
+
const promises_1 = require("./promises");
|
|
10
11
|
/**
|
|
11
12
|
* A class to manage timing functions and arbitrary periods of time before
|
|
12
13
|
* generating a `Server-Timing` header for use in HTTP responses.
|
|
@@ -66,7 +67,7 @@ class ServerTiming {
|
|
|
66
67
|
async wrap(name, fn, description) {
|
|
67
68
|
const stop = this.start(name, description);
|
|
68
69
|
try {
|
|
69
|
-
return (await
|
|
70
|
+
return (await (0, promises_1.runAsPromise)(fn));
|
|
70
71
|
}
|
|
71
72
|
finally {
|
|
72
73
|
stop();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServerTiming.js","sourceRoot":"","sources":["../../src/helpers/ServerTiming.ts"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{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YAEb,OAAO,CAAC,GAAG,GAAG,EAAE,KAAK,CAAC,CAAC;QACzB,CAAC,EACD,EAAE,CACH,CAAC;QAEF,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;CACF;AAzGD,oCAyGC"}
|
package/helpers/consts.d.ts
CHANGED
|
@@ -10,15 +10,25 @@
|
|
|
10
10
|
export declare enum queryKeys {
|
|
11
11
|
FnId = "fnId",
|
|
12
12
|
StepId = "stepId",
|
|
13
|
-
Introspect = "introspect",
|
|
14
13
|
DeployId = "deployId"
|
|
15
14
|
}
|
|
16
15
|
export declare enum envKeys {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
InngestSigningKey = "INNGEST_SIGNING_KEY",
|
|
17
|
+
InngestEventKey = "INNGEST_EVENT_KEY",
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Removed in v3. Use {@link InngestBaseUrl} instead.
|
|
20
|
+
*/
|
|
21
|
+
InngestDevServerUrl = "INNGEST_DEVSERVER_URL",
|
|
22
|
+
InngestEnvironment = "INNGEST_ENV",
|
|
23
|
+
InngestBaseUrl = "INNGEST_BASE_URL",
|
|
24
|
+
InngestServeHost = "INNGEST_SERVE_HOST",
|
|
25
|
+
InngestServePath = "INNGEST_SERVE_PATH",
|
|
26
|
+
InngestLogLevel = "INNGEST_LOG_LEVEL",
|
|
27
|
+
InngestStreaming = "INNGEST_STREAMING",
|
|
21
28
|
BranchName = "BRANCH_NAME",
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated Removed in v3. Use {@link InngestBaseUrl} instead.
|
|
31
|
+
*/
|
|
22
32
|
InngestApiBaseUrl = "INNGEST_API_BASE_URL",
|
|
23
33
|
/**
|
|
24
34
|
* The git branch of the commit the deployment was triggered by. Example:
|
|
@@ -76,9 +86,7 @@ export declare enum envKeys {
|
|
|
76
86
|
RailwayEnvironment = "RAILWAY_ENVIRONMENT"
|
|
77
87
|
}
|
|
78
88
|
export declare enum prodEnvKeys {
|
|
79
|
-
|
|
80
|
-
VercelEnvKey = "VERCEL_ENV",
|
|
81
|
-
NetlifyEnvKey = "CONTEXT"
|
|
89
|
+
VercelEnvKey = "VERCEL_ENV"
|
|
82
90
|
}
|
|
83
91
|
/**
|
|
84
92
|
* Keys for accessing headers included in requests from Inngest to run
|
|
@@ -95,8 +103,12 @@ export declare enum headerKeys {
|
|
|
95
103
|
Environment = "x-inngest-env",
|
|
96
104
|
Platform = "x-inngest-platform",
|
|
97
105
|
Framework = "x-inngest-framework",
|
|
98
|
-
NoRetry = "x-inngest-no-retry"
|
|
106
|
+
NoRetry = "x-inngest-no-retry",
|
|
107
|
+
RequestVersion = "x-inngest-req-version",
|
|
108
|
+
RetryAfter = "retry-after"
|
|
99
109
|
}
|
|
110
|
+
export declare const defaultInngestBaseUrl = "https://api.inngest.com/";
|
|
111
|
+
export declare const defaultInngestEventBaseUrl = "https://inn.gs/";
|
|
100
112
|
export declare const defaultDevServerHost = "http://127.0.0.1:8288/";
|
|
101
113
|
/**
|
|
102
114
|
* Events that Inngest may send internally that can be used to trigger
|
|
@@ -111,4 +123,6 @@ export declare enum internalEvents {
|
|
|
111
123
|
*/
|
|
112
124
|
FunctionFailed = "inngest/function.failed"
|
|
113
125
|
}
|
|
126
|
+
export declare const logPrefix: string;
|
|
127
|
+
export declare const debugPrefix = "inngest";
|
|
114
128
|
//# sourceMappingURL=consts.d.ts.map
|
package/helpers/consts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../src/helpers/consts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../src/helpers/consts.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,oBAAY,SAAS;IACnB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,QAAQ,aAAa;CACtB;AAED,oBAAY,OAAO;IACjB,iBAAiB,w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this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.internalEvents = exports.defaultDevServerHost = exports.headerKeys = exports.prodEnvKeys = exports.envKeys = exports.queryKeys = void 0;
|
|
6
|
+
exports.debugPrefix = exports.logPrefix = exports.internalEvents = exports.defaultDevServerHost = exports.defaultInngestEventBaseUrl = exports.defaultInngestBaseUrl = exports.headerKeys = exports.prodEnvKeys = exports.envKeys = exports.queryKeys = void 0;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
4
8
|
/**
|
|
5
9
|
* Keys for accessing query parameters included in requests from Inngest to run
|
|
6
10
|
* functions.
|
|
@@ -14,16 +18,26 @@ var queryKeys;
|
|
|
14
18
|
(function (queryKeys) {
|
|
15
19
|
queryKeys["FnId"] = "fnId";
|
|
16
20
|
queryKeys["StepId"] = "stepId";
|
|
17
|
-
queryKeys["Introspect"] = "introspect";
|
|
18
21
|
queryKeys["DeployId"] = "deployId";
|
|
19
|
-
})(queryKeys
|
|
22
|
+
})(queryKeys || (exports.queryKeys = queryKeys = {}));
|
|
20
23
|
var envKeys;
|
|
21
24
|
(function (envKeys) {
|
|
22
|
-
envKeys["
|
|
23
|
-
envKeys["
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
envKeys["InngestSigningKey"] = "INNGEST_SIGNING_KEY";
|
|
26
|
+
envKeys["InngestEventKey"] = "INNGEST_EVENT_KEY";
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated Removed in v3. Use {@link InngestBaseUrl} instead.
|
|
29
|
+
*/
|
|
30
|
+
envKeys["InngestDevServerUrl"] = "INNGEST_DEVSERVER_URL";
|
|
31
|
+
envKeys["InngestEnvironment"] = "INNGEST_ENV";
|
|
32
|
+
envKeys["InngestBaseUrl"] = "INNGEST_BASE_URL";
|
|
33
|
+
envKeys["InngestServeHost"] = "INNGEST_SERVE_HOST";
|
|
34
|
+
envKeys["InngestServePath"] = "INNGEST_SERVE_PATH";
|
|
35
|
+
envKeys["InngestLogLevel"] = "INNGEST_LOG_LEVEL";
|
|
36
|
+
envKeys["InngestStreaming"] = "INNGEST_STREAMING";
|
|
26
37
|
envKeys["BranchName"] = "BRANCH_NAME";
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Removed in v3. Use {@link InngestBaseUrl} instead.
|
|
40
|
+
*/
|
|
27
41
|
envKeys["InngestApiBaseUrl"] = "INNGEST_API_BASE_URL";
|
|
28
42
|
/**
|
|
29
43
|
* The git branch of the commit the deployment was triggered by. Example:
|
|
@@ -79,13 +93,11 @@ var envKeys;
|
|
|
79
93
|
* {@link https://docs.railway.app/develop/variables#railway-provided-variables}
|
|
80
94
|
*/
|
|
81
95
|
envKeys["RailwayEnvironment"] = "RAILWAY_ENVIRONMENT";
|
|
82
|
-
})(envKeys
|
|
96
|
+
})(envKeys || (exports.envKeys = envKeys = {}));
|
|
83
97
|
var prodEnvKeys;
|
|
84
98
|
(function (prodEnvKeys) {
|
|
85
|
-
prodEnvKeys["NodeEnvKey"] = "NODE_ENV";
|
|
86
99
|
prodEnvKeys["VercelEnvKey"] = "VERCEL_ENV";
|
|
87
|
-
|
|
88
|
-
})(prodEnvKeys = exports.prodEnvKeys || (exports.prodEnvKeys = {}));
|
|
100
|
+
})(prodEnvKeys || (exports.prodEnvKeys = prodEnvKeys = {}));
|
|
89
101
|
/**
|
|
90
102
|
* Keys for accessing headers included in requests from Inngest to run
|
|
91
103
|
* functions.
|
|
@@ -103,7 +115,11 @@ var headerKeys;
|
|
|
103
115
|
headerKeys["Platform"] = "x-inngest-platform";
|
|
104
116
|
headerKeys["Framework"] = "x-inngest-framework";
|
|
105
117
|
headerKeys["NoRetry"] = "x-inngest-no-retry";
|
|
106
|
-
|
|
118
|
+
headerKeys["RequestVersion"] = "x-inngest-req-version";
|
|
119
|
+
headerKeys["RetryAfter"] = "retry-after";
|
|
120
|
+
})(headerKeys || (exports.headerKeys = headerKeys = {}));
|
|
121
|
+
exports.defaultInngestBaseUrl = "https://api.inngest.com/";
|
|
122
|
+
exports.defaultInngestEventBaseUrl = "https://inn.gs/";
|
|
107
123
|
exports.defaultDevServerHost = "http://127.0.0.1:8288/";
|
|
108
124
|
/**
|
|
109
125
|
* Events that Inngest may send internally that can be used to trigger
|
|
@@ -118,5 +134,7 @@ var internalEvents;
|
|
|
118
134
|
* will contain the original event and the error that caused the failure.
|
|
119
135
|
*/
|
|
120
136
|
internalEvents["FunctionFailed"] = "inngest/function.failed";
|
|
121
|
-
})(internalEvents
|
|
137
|
+
})(internalEvents || (exports.internalEvents = internalEvents = {}));
|
|
138
|
+
exports.logPrefix = chalk_1.default.magenta.bold("[Inngest]");
|
|
139
|
+
exports.debugPrefix = "inngest";
|
|
122
140
|
//# sourceMappingURL=consts.js.map
|
package/helpers/consts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/helpers/consts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/helpers/consts.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B;;;;;;;;GAQG;AACH,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,0BAAa,CAAA;IACb,8BAAiB,CAAA;IACjB,kCAAqB,CAAA;AACvB,CAAC,EAJW,SAAS,yBAAT,SAAS,QAIpB;AAED,IAAY,OAqFX;AArFD,WAAY,OAAO;IACjB,oDAAyC,CAAA;IACzC,gDAAqC,CAAA;IAErC;;OAEG;IACH,wDAA6C,CAAA;IAC7C,6CAAkC,CAAA;IAClC,8CAAmC,CAAA;IACnC,kDAAuC,CAAA;IACvC,kDAAuC,CAAA;IACvC,gDAAqC,CAAA;IACrC,iDAAsC,CAAA;IAEtC,qCAA0B,CAAA;IAE1B;;OAEG;IACH,qDAA0C,CAAA;IAE1C;;;;;OAKG;IACH,iDAAsC,CAAA;IAEtC;;OAEG;IACH,8BAAmB,CAAA;IAEnB;;;;;OAKG;IACH,oDAAyC,CAAA;IAEzC;;OAEG;IACH,yCAA8B,CAAA;IAE9B;;;;OAIG;IACH,mCAAwB,CAAA;IAExB;;OAEG;IACH,gCAAqB,CAAA;IAErB;;;;OAIG;IACH,6CAAkC,CAAA;IAElC;;OAEG;IACH,8BAAmB,CAAA;IAEnB;;;;OAIG;IACH,+CAAoC,CAAA;IAEpC;;;;OAIG;IACH,qDAA0C,CAAA;AAC5C,CAAC,EArFW,OAAO,uBAAP,OAAO,QAqFlB;AAED,IAAY,WAEX;AAFD,WAAY,WAAW;IACrB,0CAA2B,CAAA;AAC7B,CAAC,EAFW,WAAW,2BAAX,WAAW,QAEtB;AAED;;;;;;;;GAQG;AACH,IAAY,UASX;AATD,WAAY,UAAU;IACpB,+CAAiC,CAAA;IACjC,0CAA4B,CAAA;IAC5B,2CAA6B,CAAA;IAC7B,6CAA+B,CAAA;IAC/B,+CAAiC,CAAA;IACjC,4CAA8B,CAAA;IAC9B,sDAAwC,CAAA;IACxC,wCAA0B,CAAA;AAC5B,CAAC,EATW,UAAU,0BAAV,UAAU,QASrB;AAEY,QAAA,qBAAqB,GAAG,0BAA0B,CAAC;AACnD,QAAA,0BAA0B,GAAG,iBAAiB,CAAC;AAC/C,QAAA,oBAAoB,GAAG,wBAAwB,CAAC;AAE7D;;;;;GAKG;AACH,IAAY,cAMX;AAND,WAAY,cAAc;IACxB;;;OAGG;IACH,4DAA0C,CAAA;AAC5C,CAAC,EANW,cAAc,8BAAd,cAAc,QAMzB;AAEY,QAAA,SAAS,GAAG,eAAK,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAE5C,QAAA,WAAW,GAAG,SAAS,CAAC"}
|
package/helpers/devserver.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type FunctionConfig } from "../types";
|
|
2
1
|
/**
|
|
3
2
|
* A simple type map that we can transparently use `fetch` later without having
|
|
4
3
|
* to fall in to the self-referencing `const fetch: typeof fetch = ...` which
|
|
@@ -22,38 +21,5 @@ export declare const devServerAvailable: (host: string | undefined, fetch: Fetch
|
|
|
22
21
|
* @example devServerUrl("http://localhost:8288/", "/your-path")
|
|
23
22
|
*/
|
|
24
23
|
export declare const devServerUrl: (host?: string, pathname?: string) => URL;
|
|
25
|
-
export type InfoResponse = {
|
|
26
|
-
version: string;
|
|
27
|
-
startOpts: {
|
|
28
|
-
sdkURLs: string[];
|
|
29
|
-
};
|
|
30
|
-
authed: boolean;
|
|
31
|
-
workspaces: {
|
|
32
|
-
prod: WorkspaceResponse;
|
|
33
|
-
test: WorkspaceResponse;
|
|
34
|
-
};
|
|
35
|
-
functions: FunctionConfig[];
|
|
36
|
-
handlers: SDKHandler[];
|
|
37
|
-
};
|
|
38
|
-
type WorkspaceResponse = {
|
|
39
|
-
signingKey: string;
|
|
40
|
-
eventKeys: Array<{
|
|
41
|
-
name: string;
|
|
42
|
-
key: string;
|
|
43
|
-
}>;
|
|
44
|
-
};
|
|
45
|
-
type SDKHandler = {
|
|
46
|
-
functionIDs: Array<string>;
|
|
47
|
-
createdAt: string;
|
|
48
|
-
updatedAt: string;
|
|
49
|
-
errors: Array<string>;
|
|
50
|
-
sdk: {
|
|
51
|
-
url: string;
|
|
52
|
-
language: string;
|
|
53
|
-
version: string;
|
|
54
|
-
framework?: string;
|
|
55
|
-
app: string;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
24
|
export {};
|
|
59
25
|
//# sourceMappingURL=devserver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devserver.d.ts","sourceRoot":"","sources":["../../src/helpers/devserver.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"devserver.d.ts","sourceRoot":"","sources":["../../src/helpers/devserver.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,KAAK,MAAM,GAAG,OAAO,KAAK,CAAC;AAE3B;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,oCAUtB,MAAM,KACZ,QAAQ,OAAO,CASjB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,UACjB,MAAM,wBAEX,GAEF,CAAC"}
|
package/helpers/devserver.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devserver.js","sourceRoot":"","sources":["../../src/helpers/devserver.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"devserver.js","sourceRoot":"","sources":["../../src/helpers/devserver.ts"],"names":[],"mappings":";;;AAAA,qCAAgD;AAShD;;;;;GAKG;AACI,MAAM,kBAAkB,GAAG,KAAK;AACrC;;;GAGG;AACH,OAAe,6BAAoB;AAEnC;;GAEG;AACH,KAAa,EACK,EAAE;IACpB,IAAI;QACF,MAAM,GAAG,GAAG,IAAA,oBAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACvC,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC3C,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;KACb;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,KAAK,CAAC;KACd;AACH,CAAC,CAAC;AApBW,QAAA,kBAAkB,sBAoB7B;AAEF;;;;;;;;GAQG;AACI,MAAM,YAAY,GAAG,CAC1B,OAAe,6BAAoB,EACnC,QAAQ,GAAG,EAAE,EACR,EAAE;IACP,OAAO,IAAI,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC;AAC3E,CAAC,CAAC;AALW,QAAA,YAAY,gBAKvB"}
|
package/helpers/env.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { type Inngest } from "../components/Inngest";
|
|
2
2
|
import { type SupportedFrameworkName } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export type Env = Record<string, EnvValue>;
|
|
7
|
+
/**
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export type EnvValue = string | undefined;
|
|
3
11
|
/**
|
|
4
12
|
* devServerHost returns the dev server host by searching for the INNGEST_DEVSERVER_URL
|
|
5
13
|
* environment variable (plus project prefixces for eg. react, such as REACT_APP_INNGEST_DEVSERVER_URL).
|
|
@@ -8,7 +16,7 @@ import { type SupportedFrameworkName } from "../types";
|
|
|
8
16
|
*
|
|
9
17
|
* @example devServerHost()
|
|
10
18
|
*/
|
|
11
|
-
export declare const devServerHost: (env?:
|
|
19
|
+
export declare const devServerHost: (env?: Env) => EnvValue;
|
|
12
20
|
/**
|
|
13
21
|
* Returns `true` if we're running in production or on a platform, based off of
|
|
14
22
|
* either passed environment variables or `process.env`.
|
|
@@ -26,8 +34,8 @@ export declare const isProd: (env?: Record<string, unknown>) => boolean;
|
|
|
26
34
|
* This could be used to determine if we're on a branch deploy or not, though it
|
|
27
35
|
* should be noted that we don't know if this is the default branch or not.
|
|
28
36
|
*/
|
|
29
|
-
export declare const getEnvironmentName: (env?:
|
|
30
|
-
export declare const processEnv: (key: string) =>
|
|
37
|
+
export declare const getEnvironmentName: (env?: Env) => EnvValue;
|
|
38
|
+
export declare const processEnv: (key: string) => EnvValue;
|
|
31
39
|
/**
|
|
32
40
|
* allProcessEnv returns the current process environment variables, or an empty
|
|
33
41
|
* object if they cannot be read, making sure we support environments other than
|
|
@@ -36,7 +44,7 @@ export declare const processEnv: (key: string) => string | undefined;
|
|
|
36
44
|
* Using this ensures we don't dangerously access `process.env` in environments
|
|
37
45
|
* where it may not be defined, such as Deno or the browser.
|
|
38
46
|
*/
|
|
39
|
-
export declare const allProcessEnv: () =>
|
|
47
|
+
export declare const allProcessEnv: () => Env;
|
|
40
48
|
/**
|
|
41
49
|
* Generate a standardised set of headers based on input and environment
|
|
42
50
|
* variables.
|
|
@@ -49,7 +57,7 @@ export declare const inngestHeaders: (opts?: {
|
|
|
49
57
|
* default source. Useful for platforms where environment variables are passed
|
|
50
58
|
* in alongside requests.
|
|
51
59
|
*/
|
|
52
|
-
env?:
|
|
60
|
+
env?: Env;
|
|
53
61
|
/**
|
|
54
62
|
* The framework name to use in the `X-Inngest-Framework` header. This is not
|
|
55
63
|
* always available, hence being optional.
|
|
@@ -78,7 +86,7 @@ export declare const inngestHeaders: (opts?: {
|
|
|
78
86
|
* We run a check directly related to the platform we believe we're running on,
|
|
79
87
|
* usually based on environment variables.
|
|
80
88
|
*/
|
|
81
|
-
export declare const platformSupportsStreaming: (framework: SupportedFrameworkName, env?:
|
|
89
|
+
export declare const platformSupportsStreaming: (framework: SupportedFrameworkName, env?: Env) => boolean;
|
|
82
90
|
/**
|
|
83
91
|
* Given a potential fetch function, return the fetch function to use based on
|
|
84
92
|
* this and the environment.
|
package/helpers/env.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/helpers/env.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAKvD
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/helpers/env.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAKvD;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAE1C;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,SAAS,GAAG,KAAqB,QAgB1D,CAAC;AA+CF;;;GAGG;AACH,eAAO,MAAM,aAAa,SAInB,OAAO,MAAM,EAAE,OAAO,CAAC,KAC3B,OAIF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,MAAM,SAIZ,OAAO,MAAM,EAAE,OAAO,CAAC,KAC3B,OAIF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,SAAS,GAAG,KAAqB,QAc/D,CAAC;AAEF,eAAO,MAAM,UAAU,QAAS,MAAM,KAAG,QAExC,CAAC;AAMF;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,QAAO,GAsBhC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,UAAW;IACpC;;;;OAIG;IACH,GAAG,CAAC,EAAE,GAAG,CAAC;IAEV;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC,KAAG,OAAO,MAAM,EAAE,MAAM,CAgCxB,CAAC;AA2DF;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,cACzB,sBAAsB,QAC5B,GAAG,KACP,OAOF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,QAAQ,gBAAiB,YAAY,KAAG,YA4BpD,CAAC"}
|
package/helpers/env.js
CHANGED
|
@@ -26,9 +26,9 @@ const devServerHost = (env = (0, exports.allProcessEnv)()) => {
|
|
|
26
26
|
// text replacement instead of actually understanding the AST, despite webpack
|
|
27
27
|
// being fully capable of understanding the AST.
|
|
28
28
|
const values = [
|
|
29
|
-
env[consts_1.envKeys.
|
|
30
|
-
env[
|
|
31
|
-
env[
|
|
29
|
+
env[consts_1.envKeys.InngestBaseUrl],
|
|
30
|
+
env[`REACT_APP_${consts_1.envKeys.InngestBaseUrl}`],
|
|
31
|
+
env[`NEXT_PUBLIC_${consts_1.envKeys.InngestBaseUrl}`],
|
|
32
32
|
];
|
|
33
33
|
return values.find((a) => !!a);
|
|
34
34
|
};
|
|
@@ -100,7 +100,7 @@ const getEnvironmentName = (env = (0, exports.allProcessEnv)()) => {
|
|
|
100
100
|
* Order is important; more than one of these env vars may be set, so ensure
|
|
101
101
|
* that we check the most specific, most reliable env vars first.
|
|
102
102
|
*/
|
|
103
|
-
return (env[consts_1.envKeys.
|
|
103
|
+
return (env[consts_1.envKeys.InngestEnvironment] ||
|
|
104
104
|
env[consts_1.envKeys.BranchName] ||
|
|
105
105
|
env[consts_1.envKeys.VercelBranch] ||
|
|
106
106
|
env[consts_1.envKeys.NetlifyBranch] ||
|