create-zuplo-api 6.73.29 → 6.73.30
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/README.md +11 -2
- package/dist/index.js +9 -9
- package/dist/templates/ai-gateway/config/policies.json +8 -8
- package/dist/templates/ai-gateway/env.example +0 -13
- package/dist/templates/default/docs/public/banner-dark.svg +1 -0
- package/dist/templates/default/docs/public/banner.svg +1 -0
- package/dist/templates/default/modules/hello-world.ts +2 -2
- package/dist/templates/default/modules/zuplo.runtime.ts +14 -2
- package/dist/templates/default-empty/docs/public/banner-dark.svg +1 -0
- package/dist/templates/default-empty/docs/public/banner.svg +1 -0
- package/dist/templates/default-empty/modules/hello-world.ts +2 -2
- package/dist/templates/default-empty/modules/zuplo.runtime.ts +14 -2
- package/package.json +1 -1
- package/dist/templates/default/eslint.config.js +0 -7
- package/dist/templates/default/prettierrc.json +0 -1
- package/dist/templates/default-empty/eslint.config.js +0 -7
- package/dist/templates/default-empty/prettierrc.json +0 -1
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"export": "AkamaiAIFirewallV2InboundPolicy",
|
|
76
76
|
"module": "$import(@zuplo/runtime)",
|
|
77
77
|
"options": {
|
|
78
|
-
"configurationId": "
|
|
79
|
-
"api-key": "
|
|
78
|
+
"configurationId": "",
|
|
79
|
+
"api-key": ""
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
"name": "akamai-ai-firewall-v2-inbound",
|
|
@@ -87,9 +87,9 @@
|
|
|
87
87
|
"export": "CometOpikTracingV2InboundPolicy",
|
|
88
88
|
"module": "$import(@zuplo/runtime)",
|
|
89
89
|
"options": {
|
|
90
|
-
"apiKey": "
|
|
91
|
-
"projectName": "
|
|
92
|
-
"workspace": "
|
|
90
|
+
"apiKey": "",
|
|
91
|
+
"projectName": "",
|
|
92
|
+
"workspace": ""
|
|
93
93
|
}
|
|
94
94
|
},
|
|
95
95
|
"name": "comet-opik-tracing-v2-inbound",
|
|
@@ -100,9 +100,9 @@
|
|
|
100
100
|
"export": "GalileoTracingV2InboundPolicy",
|
|
101
101
|
"module": "$import(@zuplo/runtime)",
|
|
102
102
|
"options": {
|
|
103
|
-
"apiKey": "
|
|
104
|
-
"projectId": "
|
|
105
|
-
"logStreamId": "
|
|
103
|
+
"apiKey": "",
|
|
104
|
+
"projectId": "",
|
|
105
|
+
"logStreamId": ""
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
108
|
"name": "galileo-tracing-v2-inbound",
|
|
@@ -4,16 +4,3 @@
|
|
|
4
4
|
# your Zuplo project (Settings -> Environment Variables) for deployed
|
|
5
5
|
# environments.
|
|
6
6
|
|
|
7
|
-
# akamai-ai-firewall-v2-inbound
|
|
8
|
-
AKAMAI_FIREWALL_CONFIGURATION_ID=
|
|
9
|
-
AKAMAI_FIREWALL_API_KEY=
|
|
10
|
-
|
|
11
|
-
# comet-opik-tracing-v2-inbound
|
|
12
|
-
OPIK_API_KEY=
|
|
13
|
-
OPIK_PROJECT_NAME=
|
|
14
|
-
OPIK_WORKSPACE=
|
|
15
|
-
|
|
16
|
-
# galileo-tracing-v2-inbound
|
|
17
|
-
GALILEO_API_KEY=
|
|
18
|
-
GALILEO_PROJECT_ID=
|
|
19
|
-
GALILEO_LOG_STREAM_ID=
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<svg width="757" height="270" viewBox="0 0 757 270" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<title>Zuplo API documentation banner</title>
|
|
2
3
|
<g clip-path="url(#clip0_162_322)">
|
|
3
4
|
<rect width="757" height="270" rx="8" fill="#181822"/>
|
|
4
5
|
<g filter="url(#filter0_f_162_322)">
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<svg width="757" height="270" viewBox="0 0 757 270" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<title>Zuplo API documentation banner</title>
|
|
2
3
|
<g clip-path="url(#clip0_162_213)">
|
|
3
4
|
<rect width="757" height="270" rx="8" fill="#FAFAFA"/>
|
|
4
5
|
<g filter="url(#filter0_f_162_213)">
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ZuploContext, ZuploRequest } from "@zuplo/runtime";
|
|
1
|
+
import type { ZuploContext, ZuploRequest } from "@zuplo/runtime";
|
|
2
2
|
|
|
3
3
|
export default async function (request: ZuploRequest, context: ZuploContext) {
|
|
4
4
|
/**
|
|
5
5
|
* Use the log property on context to enjoy
|
|
6
6
|
* logging magic when testing your API.
|
|
7
7
|
*/
|
|
8
|
-
context.log.info(`Hi, from inside your zup
|
|
8
|
+
context.log.info(`Hi, from inside your zup! You sent a ${request.method}.`);
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* If you want to proxy an API, you can simply
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OpenTelemetryPlugin } from "@zuplo/otel";
|
|
2
|
-
import { RuntimeExtensions } from "@zuplo/runtime";
|
|
2
|
+
import { environment, type RuntimeExtensions } from "@zuplo/runtime";
|
|
3
3
|
import { McpGatewayPlugin } from "@zuplo/runtime/mcp-gateway";
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -22,8 +22,20 @@ export function runtimeInit(runtime: RuntimeExtensions) {
|
|
|
22
22
|
// send traces to a third-party service such as Honeycomb, Grafana, and
|
|
23
23
|
// others. Docs: https://zuplo.com/docs/articles/opentelemetry
|
|
24
24
|
//
|
|
25
|
+
// `headSampler.ratio` is the share of requests that get traced. Your working
|
|
26
|
+
// copy traces everything so you see every request while you are building;
|
|
27
|
+
// every other stage (production, preview, and local dev) traces 10% to keep
|
|
28
|
+
// trace volume (and cost) down. Raise that ratio to 1 to trace everything.
|
|
29
|
+
//
|
|
25
30
|
// Remove this plugin if you are not using OpenTelemetry tracing.
|
|
26
|
-
|
|
31
|
+
const isWorkingCopy = environment.ZUPLO_ENVIRONMENT_STAGE === "working-copy";
|
|
32
|
+
runtime.addPlugin(
|
|
33
|
+
new OpenTelemetryPlugin({
|
|
34
|
+
sampling: {
|
|
35
|
+
headSampler: { ratio: isWorkingCopy ? 1 : 0.1 },
|
|
36
|
+
},
|
|
37
|
+
})
|
|
38
|
+
);
|
|
27
39
|
|
|
28
40
|
// --- Logging (optional) --------------------------------------------------
|
|
29
41
|
// Ship request logs to Datadog. Other log integrations (New Relic, Splunk,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<svg width="757" height="270" viewBox="0 0 757 270" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<title>Zuplo API documentation banner</title>
|
|
2
3
|
<g clip-path="url(#clip0_162_322)">
|
|
3
4
|
<rect width="757" height="270" rx="8" fill="#181822"/>
|
|
4
5
|
<g filter="url(#filter0_f_162_322)">
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<svg width="757" height="270" viewBox="0 0 757 270" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<title>Zuplo API documentation banner</title>
|
|
2
3
|
<g clip-path="url(#clip0_162_213)">
|
|
3
4
|
<rect width="757" height="270" rx="8" fill="#FAFAFA"/>
|
|
4
5
|
<g filter="url(#filter0_f_162_213)">
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ZuploContext, ZuploRequest } from "@zuplo/runtime";
|
|
1
|
+
import type { ZuploContext, ZuploRequest } from "@zuplo/runtime";
|
|
2
2
|
|
|
3
3
|
export default async function (request: ZuploRequest, context: ZuploContext) {
|
|
4
4
|
/**
|
|
5
5
|
* Use the log property on context to enjoy
|
|
6
6
|
* logging magic when testing your API.
|
|
7
7
|
*/
|
|
8
|
-
context.log.info(`Hi, from inside your zup
|
|
8
|
+
context.log.info(`Hi, from inside your zup! You sent a ${request.method}.`);
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* If you want to proxy an API, you can simply
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OpenTelemetryPlugin } from "@zuplo/otel";
|
|
2
|
-
import { RuntimeExtensions } from "@zuplo/runtime";
|
|
2
|
+
import { environment, type RuntimeExtensions } from "@zuplo/runtime";
|
|
3
3
|
import { McpGatewayPlugin } from "@zuplo/runtime/mcp-gateway";
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -22,8 +22,20 @@ export function runtimeInit(runtime: RuntimeExtensions) {
|
|
|
22
22
|
// send traces to a third-party service such as Honeycomb, Grafana, and
|
|
23
23
|
// others. Docs: https://zuplo.com/docs/articles/opentelemetry
|
|
24
24
|
//
|
|
25
|
+
// `headSampler.ratio` is the share of requests that get traced. Your working
|
|
26
|
+
// copy traces everything so you see every request while you are building;
|
|
27
|
+
// every other stage (production, preview, and local dev) traces 10% to keep
|
|
28
|
+
// trace volume (and cost) down. Raise that ratio to 1 to trace everything.
|
|
29
|
+
//
|
|
25
30
|
// Remove this plugin if you are not using OpenTelemetry tracing.
|
|
26
|
-
|
|
31
|
+
const isWorkingCopy = environment.ZUPLO_ENVIRONMENT_STAGE === "working-copy";
|
|
32
|
+
runtime.addPlugin(
|
|
33
|
+
new OpenTelemetryPlugin({
|
|
34
|
+
sampling: {
|
|
35
|
+
headSampler: { ratio: isWorkingCopy ? 1 : 0.1 },
|
|
36
|
+
},
|
|
37
|
+
})
|
|
38
|
+
);
|
|
27
39
|
|
|
28
40
|
// --- Logging (optional) --------------------------------------------------
|
|
29
41
|
// Ship request logs to Datadog. Other log integrations (New Relic, Splunk,
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|