zudoku 0.71.3 → 0.71.5

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/cli/cli.js CHANGED
@@ -3794,7 +3794,7 @@ import {
3794
3794
  // package.json
3795
3795
  var package_default = {
3796
3796
  name: "zudoku",
3797
- version: "0.71.2",
3797
+ version: "0.71.4",
3798
3798
  type: "module",
3799
3799
  sideEffects: [
3800
3800
  "**/*.css",
@@ -10,4 +10,5 @@ export type { MDXImport } from "./lib/plugins/markdown/index.js";
10
10
  export { defaultLanguages } from "./lib/shiki.js";
11
11
  export { cn } from "./lib/ui/util.js";
12
12
  export { joinUrl } from "./lib/util/joinUrl.js";
13
+ export { type ProblemJson, throwIfProblemJson, } from "./lib/util/problemJson.js";
13
14
  export type { MdxComponentsType } from "./lib/util/MdxComponents.js";
@@ -0,0 +1,10 @@
1
+ export type ProblemJson = {
2
+ type: string;
3
+ title?: string;
4
+ status?: number;
5
+ detail?: string;
6
+ instance?: string;
7
+ [extension: string]: unknown;
8
+ };
9
+ export declare const getProblemJson: (response: Response) => Promise<ProblemJson | undefined>;
10
+ export declare const throwIfProblemJson: (response: Response) => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.71.3",
3
+ "version": "0.71.5",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "**/*.css",
package/src/app/main.css CHANGED
@@ -340,6 +340,10 @@
340
340
  }
341
341
 
342
342
  @layer utilities {
343
+ .stepper {
344
+ @apply my-4;
345
+ }
346
+
343
347
  .stepper > ol {
344
348
  --bullet-size: 1.75rem;
345
349
  --line-spacing: 0.25rem;
package/src/index.ts CHANGED
@@ -26,4 +26,8 @@ export type { MDXImport } from "./lib/plugins/markdown/index.js";
26
26
  export { defaultLanguages } from "./lib/shiki.js";
27
27
  export { cn } from "./lib/ui/util.js";
28
28
  export { joinUrl } from "./lib/util/joinUrl.js";
29
+ export {
30
+ type ProblemJson,
31
+ throwIfProblemJson,
32
+ } from "./lib/util/problemJson.js";
29
33
  export type { MdxComponentsType } from "./lib/util/MdxComponents.js";
@@ -10,6 +10,7 @@ import type {
10
10
  import type { ZudokuContext } from "../../core/ZudokuContext.js";
11
11
  import invariant from "../../util/invariant.js";
12
12
  import { joinUrl } from "../../util/joinUrl.js";
13
+ import { throwIfProblemJson } from "../../util/problemJson.js";
13
14
  import { SettingsApiKeys } from "./SettingsApiKeys.js";
14
15
 
15
16
  const DEFAULT_GATEWAY_URL = "https://api.zuploedge.com";
@@ -70,24 +71,6 @@ export interface ApiConsumer {
70
71
  key?: ApiKey;
71
72
  }
72
73
 
73
- const parseJsonSafe = async (response: Response) => {
74
- try {
75
- return await response.json();
76
- } catch {
77
- return;
78
- }
79
- };
80
-
81
- const throwIfProblemJson = async (response: Response) => {
82
- const contentType = response.headers.get("content-type");
83
- if (!response.ok && contentType?.includes("application/problem+json")) {
84
- const data = await parseJsonSafe(response);
85
- if (data.type && data.title) {
86
- throw new Error(data.detail ?? data.title);
87
- }
88
- }
89
- };
90
-
91
74
  const developerHintOptions = {
92
75
  developerHint:
93
76
  "This project is not linked to a Zuplo deployment. Run `zuplo link` to get started with API Keys.",
@@ -193,7 +193,8 @@ export const enrichWithZuploData = ({
193
193
  (policy) =>
194
194
  inboundPolicies.includes(policy.name) &&
195
195
  (policy.handler.export === "ApiAuthKeyInboundPolicy" ||
196
- policy.handler.export === "ApiKeyInboundPolicy") &&
196
+ policy.handler.export === "ApiKeyInboundPolicy" ||
197
+ policy.handler.export === "MonetizationInboundPolicy") &&
197
198
  !policy.handler.options
198
199
  ?.disableAutomaticallyAddingKeyHeaderToOpenApi,
199
200
  ) ?? [];
@@ -225,7 +226,8 @@ export const enrichWithZuploData = ({
225
226
  policiesConfig.policies?.some(
226
227
  (policy) =>
227
228
  policy.handler.export === "ApiAuthKeyInboundPolicy" ||
228
- policy.handler.export === "ApiKeyInboundPolicy",
229
+ policy.handler.export === "ApiKeyInboundPolicy" ||
230
+ policy.handler.export === "MonetizationInboundPolicy",
229
231
  )
230
232
  ) {
231
233
  if (!schema.components) schema.components = {};