@apifuse/provider-sdk 2.1.0-beta.2 → 2.1.0-beta.21

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.
Files changed (231) hide show
  1. package/AUTHORING.md +330 -8
  2. package/CHANGELOG.md +89 -1
  3. package/README.md +64 -17
  4. package/SUBMISSION.md +86 -0
  5. package/bin/apifuse-check.ts +60 -6
  6. package/bin/apifuse-dev.ts +58 -8
  7. package/bin/apifuse-pack-check.ts +32 -2
  8. package/bin/apifuse-pack-smoke.ts +133 -6
  9. package/bin/apifuse-perf.ts +142 -49
  10. package/bin/apifuse-record.ts +182 -104
  11. package/bin/apifuse-submit-check.ts +3243 -0
  12. package/bin/apifuse.ts +1 -1
  13. package/dist/auth.d.ts +76 -0
  14. package/dist/auth.js +436 -0
  15. package/dist/ceremonies/index.d.ts +41 -0
  16. package/dist/ceremonies/index.js +490 -0
  17. package/dist/choice-token.d.ts +24 -0
  18. package/dist/choice-token.js +74 -0
  19. package/dist/cli/commands.d.ts +10 -0
  20. package/dist/cli/commands.js +80 -0
  21. package/dist/cli/create.d.ts +47 -0
  22. package/dist/cli/create.js +777 -0
  23. package/dist/cli/templates/provider/.dockerignore.tpl +22 -0
  24. package/dist/cli/templates/provider/.gitignore.tpl +22 -0
  25. package/dist/cli/templates/provider/AGENTS.md.tpl +87 -0
  26. package/dist/cli/templates/provider/CLAUDE.md.tpl +1 -0
  27. package/dist/cli/templates/provider/Dockerfile.tpl +7 -0
  28. package/dist/cli/templates/provider/README.md.tpl +163 -0
  29. package/dist/cli/templates/provider/dev.ts.tpl +5 -0
  30. package/dist/cli/templates/provider/domain/README.md.tpl +3 -0
  31. package/dist/cli/templates/provider/index.test.ts.tpl +13 -0
  32. package/dist/cli/templates/provider/index.ts.tpl +15 -0
  33. package/dist/cli/templates/provider/mappers/README.md.tpl +3 -0
  34. package/dist/cli/templates/provider/meta.ts.tpl +7 -0
  35. package/dist/cli/templates/provider/operations/index.ts.tpl +5 -0
  36. package/dist/cli/templates/provider/operations/ping.ts.tpl +24 -0
  37. package/dist/cli/templates/provider/schemas/ping.ts.tpl +24 -0
  38. package/dist/cli/templates/provider/skills/fixtures-and-recording/SKILL.md.tpl +58 -0
  39. package/dist/cli/templates/provider/skills/health-checks-and-fail-closed/SKILL.md.tpl +65 -0
  40. package/dist/cli/templates/provider/skills/normalization-standards/SKILL.md.tpl +57 -0
  41. package/dist/cli/templates/provider/skills/pagination-and-counts/SKILL.md.tpl +52 -0
  42. package/dist/cli/templates/provider/skills/upstream-contract-verification/SKILL.md.tpl +45 -0
  43. package/dist/cli/templates/provider/skills/upstream-notes/README.md.tpl +13 -0
  44. package/dist/cli/templates/provider/start.ts.tpl +5 -0
  45. package/dist/cli/templates/provider/upstream/README.md.tpl +3 -0
  46. package/dist/config/loader.d.ts +107 -0
  47. package/dist/config/loader.js +935 -0
  48. package/dist/contract-json.d.ts +9 -0
  49. package/dist/contract-json.js +51 -0
  50. package/dist/contract-serialization.d.ts +4 -0
  51. package/dist/contract-serialization.js +78 -0
  52. package/dist/contract-types.d.ts +49 -0
  53. package/dist/contract-types.js +1 -0
  54. package/dist/contract.d.ts +6 -0
  55. package/dist/contract.js +156 -0
  56. package/dist/define.d.ts +100 -0
  57. package/dist/define.js +1383 -0
  58. package/dist/dev.d.ts +9 -0
  59. package/dist/dev.js +15 -0
  60. package/dist/errors.d.ts +59 -0
  61. package/dist/errors.js +97 -0
  62. package/dist/i18n/catalog.d.ts +29 -0
  63. package/dist/i18n/catalog.js +159 -0
  64. package/dist/i18n/index.d.ts +2 -0
  65. package/dist/i18n/index.js +2 -0
  66. package/dist/i18n/keys.d.ts +10 -0
  67. package/dist/i18n/keys.js +34 -0
  68. package/dist/index.d.ts +42 -0
  69. package/dist/index.js +38 -0
  70. package/dist/lint.d.ts +74 -0
  71. package/dist/lint.js +729 -0
  72. package/dist/observability.d.ts +5 -0
  73. package/dist/observability.js +39 -0
  74. package/dist/provider.d.ts +11 -0
  75. package/dist/provider.js +9 -0
  76. package/dist/public-schema-field-lint.d.ts +2 -0
  77. package/dist/public-schema-field-lint.js +158 -0
  78. package/dist/recipes/gov-api.d.ts +19 -0
  79. package/dist/recipes/gov-api.js +72 -0
  80. package/dist/recipes/rest-api.d.ts +21 -0
  81. package/dist/recipes/rest-api.js +115 -0
  82. package/dist/runtime/auth-flow.d.ts +14 -0
  83. package/dist/runtime/auth-flow.js +46 -0
  84. package/dist/runtime/browser.d.ts +25 -0
  85. package/dist/runtime/browser.js +1237 -0
  86. package/dist/runtime/cache.d.ts +10 -0
  87. package/dist/runtime/cache.js +372 -0
  88. package/dist/runtime/choice.d.ts +15 -0
  89. package/dist/runtime/choice.js +435 -0
  90. package/dist/runtime/credential.d.ts +8 -0
  91. package/dist/runtime/credential.js +61 -0
  92. package/dist/runtime/env.d.ts +2 -0
  93. package/dist/runtime/env.js +10 -0
  94. package/dist/runtime/executor.d.ts +16 -0
  95. package/dist/runtime/executor.js +51 -0
  96. package/dist/runtime/http.d.ts +8 -0
  97. package/dist/runtime/http.js +726 -0
  98. package/dist/runtime/insights.d.ts +9 -0
  99. package/dist/runtime/insights.js +324 -0
  100. package/dist/runtime/instrumentation.d.ts +8 -0
  101. package/dist/runtime/instrumentation.js +269 -0
  102. package/dist/runtime/key-derivation.d.ts +24 -0
  103. package/dist/runtime/key-derivation.js +73 -0
  104. package/dist/runtime/keyring.d.ts +25 -0
  105. package/dist/runtime/keyring.js +93 -0
  106. package/dist/runtime/namespace.d.ts +9 -0
  107. package/dist/runtime/namespace.js +19 -0
  108. package/dist/runtime/otlp.d.ts +39 -0
  109. package/dist/runtime/otlp.js +103 -0
  110. package/dist/runtime/perf.d.ts +12 -0
  111. package/dist/runtime/perf.js +52 -0
  112. package/dist/runtime/prevalidate.d.ts +12 -0
  113. package/dist/runtime/prevalidate.js +173 -0
  114. package/dist/runtime/provider.d.ts +2 -0
  115. package/dist/runtime/provider.js +11 -0
  116. package/dist/runtime/proxy-errors.d.ts +21 -0
  117. package/dist/runtime/proxy-errors.js +83 -0
  118. package/dist/runtime/proxy-telemetry.d.ts +8 -0
  119. package/dist/runtime/proxy-telemetry.js +174 -0
  120. package/dist/runtime/redis.d.ts +17 -0
  121. package/dist/runtime/redis.js +82 -0
  122. package/dist/runtime/request-options.d.ts +3 -0
  123. package/dist/runtime/request-options.js +42 -0
  124. package/dist/runtime/state.d.ts +17 -0
  125. package/dist/runtime/state.js +344 -0
  126. package/dist/runtime/stealth.d.ts +21 -0
  127. package/dist/runtime/stealth.js +980 -0
  128. package/dist/runtime/stt.d.ts +22 -0
  129. package/dist/runtime/stt.js +480 -0
  130. package/dist/runtime/trace.d.ts +26 -0
  131. package/dist/runtime/trace.js +142 -0
  132. package/dist/runtime/waterfall.d.ts +12 -0
  133. package/dist/runtime/waterfall.js +147 -0
  134. package/dist/schema.d.ts +74 -0
  135. package/dist/schema.js +243 -0
  136. package/dist/serve.d.ts +1 -0
  137. package/dist/serve.js +1 -0
  138. package/dist/server/index.d.ts +3 -0
  139. package/dist/server/index.js +2 -0
  140. package/dist/server/serve.d.ts +64 -0
  141. package/dist/server/serve.js +1118 -0
  142. package/dist/server/types.d.ts +136 -0
  143. package/dist/server/types.js +86 -0
  144. package/dist/stealth/profiles.d.ts +4 -0
  145. package/dist/stealth/profiles.js +259 -0
  146. package/dist/stream.d.ts +44 -0
  147. package/dist/stream.js +151 -0
  148. package/dist/testing/helpers.d.ts +23 -0
  149. package/dist/testing/helpers.js +95 -0
  150. package/dist/testing/index.d.ts +2 -0
  151. package/dist/testing/index.js +2 -0
  152. package/dist/testing/run.d.ts +34 -0
  153. package/dist/testing/run.js +307 -0
  154. package/dist/types.d.ts +1467 -0
  155. package/dist/types.js +61 -0
  156. package/dist/utils/date.d.ts +6 -0
  157. package/dist/utils/date.js +101 -0
  158. package/dist/utils/parse.d.ts +16 -0
  159. package/dist/utils/parse.js +51 -0
  160. package/dist/utils/text.d.ts +4 -0
  161. package/dist/utils/text.js +14 -0
  162. package/dist/utils/transform.d.ts +8 -0
  163. package/dist/utils/transform.js +48 -0
  164. package/package.json +57 -29
  165. package/src/auth.ts +786 -0
  166. package/src/ceremonies/index.ts +8 -2
  167. package/src/choice-token.ts +165 -0
  168. package/src/cli/commands.ts +34 -11
  169. package/src/cli/create.ts +254 -128
  170. package/src/cli/templates/provider/.dockerignore.tpl +22 -0
  171. package/src/cli/templates/provider/.gitignore.tpl +22 -0
  172. package/src/cli/templates/provider/AGENTS.md.tpl +87 -0
  173. package/src/cli/templates/provider/CLAUDE.md.tpl +1 -0
  174. package/src/cli/templates/provider/README.md.tpl +87 -7
  175. package/src/cli/templates/provider/dev.ts.tpl +1 -1
  176. package/src/cli/templates/provider/domain/README.md.tpl +3 -0
  177. package/src/cli/templates/provider/index.ts.tpl +5 -47
  178. package/src/cli/templates/provider/mappers/README.md.tpl +3 -0
  179. package/src/cli/templates/provider/meta.ts.tpl +7 -0
  180. package/src/cli/templates/provider/operations/index.ts.tpl +5 -0
  181. package/src/cli/templates/provider/operations/ping.ts.tpl +24 -0
  182. package/src/cli/templates/provider/schemas/ping.ts.tpl +24 -0
  183. package/src/cli/templates/provider/skills/fixtures-and-recording/SKILL.md.tpl +58 -0
  184. package/src/cli/templates/provider/skills/health-checks-and-fail-closed/SKILL.md.tpl +65 -0
  185. package/src/cli/templates/provider/skills/normalization-standards/SKILL.md.tpl +57 -0
  186. package/src/cli/templates/provider/skills/pagination-and-counts/SKILL.md.tpl +52 -0
  187. package/src/cli/templates/provider/skills/upstream-contract-verification/SKILL.md.tpl +45 -0
  188. package/src/cli/templates/provider/skills/upstream-notes/README.md.tpl +13 -0
  189. package/src/cli/templates/provider/start.ts.tpl +1 -1
  190. package/src/cli/templates/provider/upstream/README.md.tpl +3 -0
  191. package/src/config/loader.ts +1224 -9
  192. package/src/contract-json.ts +75 -0
  193. package/src/contract-serialization.ts +89 -0
  194. package/src/contract-types.ts +52 -0
  195. package/src/contract.ts +216 -0
  196. package/src/define.ts +1820 -70
  197. package/src/errors.ts +27 -0
  198. package/src/i18n/catalog.ts +277 -0
  199. package/src/i18n/index.ts +2 -0
  200. package/src/i18n/keys.ts +64 -0
  201. package/src/index.ts +189 -9
  202. package/src/lint.ts +580 -73
  203. package/src/observability.ts +41 -0
  204. package/src/provider.ts +131 -4
  205. package/src/public-schema-field-lint.ts +237 -0
  206. package/src/runtime/auth-flow.ts +9 -0
  207. package/src/runtime/browser.ts +1054 -51
  208. package/src/runtime/cache.ts +528 -0
  209. package/src/runtime/choice.ts +760 -0
  210. package/src/runtime/executor.ts +32 -3
  211. package/src/runtime/http.ts +980 -195
  212. package/src/runtime/insights.ts +11 -11
  213. package/src/runtime/instrumentation.ts +12 -4
  214. package/src/runtime/key-derivation.ts +1 -1
  215. package/src/runtime/keyring.ts +4 -3
  216. package/src/runtime/proxy-errors.ts +132 -0
  217. package/src/runtime/proxy-telemetry.ts +253 -0
  218. package/src/runtime/redis.ts +116 -0
  219. package/src/runtime/request-options.ts +66 -0
  220. package/src/runtime/state.ts +563 -0
  221. package/src/runtime/stealth.ts +1336 -0
  222. package/src/runtime/stt.ts +629 -0
  223. package/src/runtime/trace.ts +1 -1
  224. package/src/schema.ts +363 -1
  225. package/src/server/serve.ts +1192 -75
  226. package/src/server/types.ts +37 -0
  227. package/src/stream.ts +210 -0
  228. package/src/testing/run.ts +40 -6
  229. package/src/types.ts +1283 -59
  230. package/src/runtime/tls.ts +0 -434
  231. package/src/types/playwright-stealth.d.ts +0 -9
@@ -8,7 +8,12 @@ import {
8
8
  TurnValidationError,
9
9
  ValidationError,
10
10
  } from "../errors";
11
- import type { AuthFlowDefinition, AuthTurn, FlowContext } from "../types";
11
+ import type {
12
+ AuthFlowDefinition,
13
+ AuthFlowInputHandler,
14
+ AuthTurn,
15
+ FlowContext,
16
+ } from "../types";
12
17
 
13
18
  type TurnKind =
14
19
  | "abort"
@@ -21,7 +26,7 @@ type TurnKind =
21
26
  | "redirect"
22
27
  | "retry";
23
28
 
24
- type CeremonyHandler = AuthFlowDefinition["start"];
29
+ type CeremonyHandler = AuthFlowInputHandler;
25
30
 
26
31
  type JsonObject = Record<string, unknown>;
27
32
 
@@ -44,6 +49,7 @@ const authTurnSchema = {
44
49
  additionalProperties: true,
45
50
  },
46
51
  hint: { type: "string" },
52
+ hintKey: { type: "string" },
47
53
  timing: {
48
54
  type: "object",
49
55
  additionalProperties: false,
@@ -0,0 +1,165 @@
1
+ import {
2
+ createCipheriv,
3
+ createDecipheriv,
4
+ createHash,
5
+ createHmac,
6
+ randomBytes,
7
+ timingSafeEqual,
8
+ } from "node:crypto";
9
+
10
+ export type ProviderChoiceTokenPayload = Record<string, unknown>;
11
+
12
+ export type ProviderChoiceTokenErrorReason =
13
+ | "invalid_shape"
14
+ | "invalid_signature"
15
+ | "invalid_payload"
16
+ | "invalid_binding"
17
+ | "stale";
18
+
19
+ export class ProviderChoiceTokenError extends Error {
20
+ readonly reason: ProviderChoiceTokenErrorReason;
21
+
22
+ constructor(reason: ProviderChoiceTokenErrorReason, message: string) {
23
+ super(message);
24
+ this.name = "ProviderChoiceTokenError";
25
+ this.reason = reason;
26
+ }
27
+ }
28
+
29
+ export interface CreateProviderChoiceTokenOptions<
30
+ TPayload extends ProviderChoiceTokenPayload,
31
+ > {
32
+ prefix: string;
33
+ payload: TPayload;
34
+ secret: string;
35
+ }
36
+
37
+ export interface ParseProviderChoiceTokenOptions {
38
+ token: string;
39
+ prefix: string;
40
+ secret: string;
41
+ }
42
+
43
+ export interface FreshProviderChoiceIssuedAtOptions {
44
+ ttlMs: number;
45
+ nowMs?: number;
46
+ futureToleranceMs?: number;
47
+ }
48
+
49
+ export function createProviderChoiceToken<
50
+ TPayload extends ProviderChoiceTokenPayload,
51
+ >(options: CreateProviderChoiceTokenOptions<TPayload>): string {
52
+ const iv = randomBytes(12);
53
+ const cipher = createCipheriv(
54
+ "aes-256-gcm",
55
+ choiceEncryptionKey(options.secret),
56
+ iv,
57
+ );
58
+ const encryptedPayload = Buffer.concat([
59
+ cipher.update(JSON.stringify(options.payload), "utf8"),
60
+ cipher.final(),
61
+ ]).toString("base64url");
62
+ const authTag = cipher.getAuthTag().toString("base64url");
63
+ const encodedIv = iv.toString("base64url");
64
+ const signature = signProviderChoiceTokenBody(
65
+ `${options.prefix}.${encodedIv}.${encryptedPayload}.${authTag}`,
66
+ options.secret,
67
+ );
68
+ return `${options.prefix}.${encodedIv}.${encryptedPayload}.${authTag}.${signature}`;
69
+ }
70
+
71
+ export function parseProviderChoiceToken(
72
+ options: ParseProviderChoiceTokenOptions,
73
+ ): ProviderChoiceTokenPayload {
74
+ const [
75
+ actualPrefix,
76
+ encodedIv,
77
+ encryptedPayload,
78
+ authTag,
79
+ signature,
80
+ ...extra
81
+ ] = options.token.split(".");
82
+ if (
83
+ actualPrefix !== options.prefix ||
84
+ !encodedIv ||
85
+ !encryptedPayload ||
86
+ !authTag ||
87
+ !signature ||
88
+ extra.length > 0
89
+ ) {
90
+ throw new ProviderChoiceTokenError(
91
+ "invalid_shape",
92
+ "Provider choice token shape is invalid.",
93
+ );
94
+ }
95
+
96
+ const signedBody = `${options.prefix}.${encodedIv}.${encryptedPayload}.${authTag}`;
97
+ const expectedSignature = signProviderChoiceTokenBody(
98
+ signedBody,
99
+ options.secret,
100
+ );
101
+ const actualBuffer = Buffer.from(signature);
102
+ const expectedBuffer = Buffer.from(expectedSignature);
103
+ if (
104
+ actualBuffer.length !== expectedBuffer.length ||
105
+ !timingSafeEqual(actualBuffer, expectedBuffer)
106
+ ) {
107
+ throw new ProviderChoiceTokenError(
108
+ "invalid_signature",
109
+ "Provider choice token signature is invalid.",
110
+ );
111
+ }
112
+
113
+ try {
114
+ const decipher = createDecipheriv(
115
+ "aes-256-gcm",
116
+ choiceEncryptionKey(options.secret),
117
+ Buffer.from(encodedIv, "base64url"),
118
+ );
119
+ decipher.setAuthTag(Buffer.from(authTag, "base64url"));
120
+ const decrypted = Buffer.concat([
121
+ decipher.update(Buffer.from(encryptedPayload, "base64url")),
122
+ decipher.final(),
123
+ ]).toString("utf8");
124
+ const parsed = JSON.parse(decrypted);
125
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
126
+ throw new Error("payload is not an object");
127
+ }
128
+ return Object.fromEntries(Object.entries(parsed));
129
+ } catch {
130
+ throw new ProviderChoiceTokenError(
131
+ "invalid_payload",
132
+ "Provider choice token payload is invalid.",
133
+ );
134
+ }
135
+ }
136
+
137
+ export function assertFreshProviderChoiceIssuedAt(
138
+ issuedAtMs: unknown,
139
+ options: FreshProviderChoiceIssuedAtOptions,
140
+ ): number {
141
+ const parsed =
142
+ typeof issuedAtMs === "number" ? issuedAtMs : Number(issuedAtMs);
143
+ const nowMs = options.nowMs ?? Date.now();
144
+ const futureToleranceMs = options.futureToleranceMs ?? 30_000;
145
+ if (
146
+ !Number.isFinite(parsed) ||
147
+ parsed <= 0 ||
148
+ nowMs - parsed > options.ttlMs ||
149
+ parsed - nowMs > futureToleranceMs
150
+ ) {
151
+ throw new ProviderChoiceTokenError(
152
+ "stale",
153
+ "Provider choice token is stale.",
154
+ );
155
+ }
156
+ return parsed;
157
+ }
158
+
159
+ function choiceEncryptionKey(secret: string): Buffer {
160
+ return createHash("sha256").update(secret).digest();
161
+ }
162
+
163
+ function signProviderChoiceTokenBody(body: string, secret: string): string {
164
+ return createHmac("sha256", secret).update(body).digest("base64url");
165
+ }
@@ -2,6 +2,8 @@ export type ApifuseCommandName =
2
2
  | "create"
3
3
  | "dev"
4
4
  | "check"
5
+ | "submit-check"
6
+ | "bounty-check"
5
7
  | "record"
6
8
  | "test"
7
9
  | "perf";
@@ -22,11 +24,9 @@ export const COMMAND_MANIFEST: Record<
22
24
  name: "create",
23
25
  summary:
24
26
  "Scaffold a provider, install dependencies, run baseline validation, and print the next local-dev command.",
25
- usage:
26
- "apifuse create <provider-name> [--preset standalone|monorepo] [--json] [--dry-run]",
27
+ usage: "apifuse create <provider-name> [--json] [--dry-run]",
27
28
  examples: [
28
29
  "apifuse create weather-provider",
29
- "apifuse create weather-provider --preset monorepo",
30
30
  "apifuse create --config ./apifuse.create.json --json",
31
31
  ],
32
32
  modulePath: "./apifuse-create",
@@ -36,24 +36,43 @@ export const COMMAND_MANIFEST: Record<
36
36
  summary:
37
37
  "Start the local provider dev server with the standard provider server contract.",
38
38
  usage: "apifuse dev [path]",
39
- examples: ["apifuse dev .", "apifuse dev providers/airkorea"],
39
+ examples: ["apifuse dev .", "apifuse dev providers/korea-air-quality"],
40
40
  modulePath: "./apifuse-dev",
41
41
  },
42
42
  check: {
43
43
  name: "check",
44
44
  summary: "Validate provider structure, metadata, fixtures, and schemas.",
45
45
  usage: "apifuse check [path]",
46
- examples: ["apifuse check .", "apifuse check providers/airkorea"],
46
+ examples: ["apifuse check .", "apifuse check providers/korea-air-quality"],
47
47
  modulePath: "./apifuse-check",
48
48
  },
49
+ "submit-check": {
50
+ name: "submit-check",
51
+ summary:
52
+ "Score provider bounty submission readiness and emit checklist evidence.",
53
+ usage:
54
+ "apifuse submit-check [path] [--tier bronze|silver|gold|diamond] [--json] [--markdown <path>] [--smoke-note <text>]",
55
+ examples: [
56
+ "apifuse submit-check .",
57
+ "apifuse submit-check . --tier silver --markdown submission-report.md",
58
+ ],
59
+ modulePath: "./apifuse-submit-check",
60
+ },
61
+ "bounty-check": {
62
+ name: "bounty-check",
63
+ summary: "Alias for submit-check.",
64
+ usage:
65
+ "apifuse bounty-check [path] [--tier bronze|silver|gold|diamond] [--json] [--markdown <path>] [--smoke-note <text>]",
66
+ examples: ["apifuse bounty-check . --markdown submission-report.md"],
67
+ modulePath: "./apifuse-submit-check",
68
+ },
49
69
  record: {
50
70
  name: "record",
51
71
  summary: "Call a provider operation and capture upstream raw fixture data.",
52
72
  usage:
53
73
  'apifuse record [path] --operation <operation> --params \'{"value":"hello"}\'',
54
74
  examples: [
55
- 'apifuse record . --operation ping --params \'{"value":"hello"}\'',
56
- 'apifuse record providers/airkorea --operation realtime --params \'{"stationName":"종로구"}\'',
75
+ 'apifuse record providers/korea-air-quality --operation realtime --params \'{"stationName":"종로구"}\'',
57
76
  ],
58
77
  modulePath: "./apifuse-record",
59
78
  },
@@ -61,17 +80,20 @@ export const COMMAND_MANIFEST: Record<
61
80
  name: "test",
62
81
  summary: "Run provider-focused tests and surface actionable failures.",
63
82
  usage: "apifuse test [path] [--json] [--verbose]",
64
- examples: ["apifuse test .", "apifuse test providers/airkorea --json"],
83
+ examples: [
84
+ "apifuse test .",
85
+ "apifuse test providers/korea-air-quality --json",
86
+ ],
65
87
  modulePath: "./apifuse-test",
66
88
  },
67
89
  perf: {
68
90
  name: "perf",
69
91
  summary:
70
92
  "Profile a provider operation and export latency/trace diagnostics.",
71
- usage: "apifuse perf <path> --operation <operation> [options]",
93
+ usage:
94
+ "apifuse perf <path> --operation <operation> [--params '<json>'] [options]",
72
95
  examples: [
73
- "apifuse perf . --operation ping",
74
- "apifuse perf providers/airkorea --operation realtime --runs 5",
96
+ 'apifuse perf providers/korea-air-quality --operation realtime --params \'{"stationName":"종로구"}\' --runs 5',
75
97
  ],
76
98
  modulePath: "./apifuse-perf",
77
99
  },
@@ -81,6 +103,7 @@ export const COMMAND_ORDER: ApifuseCommandName[] = [
81
103
  "create",
82
104
  "dev",
83
105
  "check",
106
+ "submit-check",
84
107
  "record",
85
108
  "test",
86
109
  "perf",