@apifuse/provider-sdk 2.2.0-beta.53 → 2.2.0-beta.55
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 +8 -0
- package/dist/cli/migrate-operation-declaration.d.ts +5 -1
- package/dist/cli/migrate-operation-declaration.js +645 -46
- package/dist/runtime/auth-flow.d.ts +1 -0
- package/dist/runtime/auth-flow.js +2 -0
- package/dist/runtime/trace.d.ts +7 -0
- package/dist/runtime/trace.js +24 -1
- package/dist/server/serve-implementation.d.ts +4 -0
- package/dist/server/serve-implementation.js +576 -321
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-ambiguous-a.ts.txt +3 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-ambiguous-b.ts.txt +3 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-ambiguous-barrel.ts.txt +2 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-ambiguous-index.ts.txt +3 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-computed.ts.txt +6 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-cycle-a.ts.txt +1 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-cycle-b.ts.txt +1 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-cycle-index.ts.txt +3 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-daiso-barrel.ts.txt +7 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-daiso-catalog.ts.txt +19 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-daiso-docs.ts.txt +6 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-daiso-index.ts.txt +3 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-daiso-stores.ts.txt +8 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-indirect-config.ts.txt +5 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-nonstatic.ts.txt +4 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-package-index.ts.txt +3 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-reexport-index.ts.txt +3 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-reexport-leaf.ts.txt +10 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-reexport-one.ts.txt +1 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-reexport-two.ts.txt +1 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-star-package-barrel.ts.txt +2 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-star-package-index.ts.txt +3 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-star-package-leaf.ts.txt +3 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/factory-duplicate-provider.ts.txt +11 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/factory-id-unresolved.ts.txt +7 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/factory-one-to-many.ts.txt +18 -0
- package/src/cli/__tests__/fixtures/migrate-operation-declaration/factory-one-to-one.ts.txt +13 -0
- package/src/cli/migrate-operation-declaration.ts +844 -49
- package/src/runtime/auth-flow.ts +3 -0
- package/src/runtime/trace.ts +37 -1
- package/src/server/serve-implementation.ts +759 -586
- package/src/types.ts +1 -0
package/dist/types.d.ts
CHANGED
|
@@ -1748,6 +1748,7 @@ export interface FlowContext {
|
|
|
1748
1748
|
externalRef?: string;
|
|
1749
1749
|
tenantId: string;
|
|
1750
1750
|
providerId: string;
|
|
1751
|
+
trace: TraceContext;
|
|
1751
1752
|
http: HttpClient;
|
|
1752
1753
|
/** Durable connection-scoped runtime state. Present when the host runtime
|
|
1753
1754
|
* supplies one; auth ceremonies must fail closed when absent rather than
|
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { registry } from "./cycle-b";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { registry } from "./cycle-a";
|
package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-daiso-catalog.ts.txt
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OPERATION_DOCS } from "./docs";
|
|
2
|
+
|
|
3
|
+
export const catalogOperations = {
|
|
4
|
+
"browse-catalog": {
|
|
5
|
+
docs: { ...OPERATION_DOCS.catalog },
|
|
6
|
+
descriptionKey: "operations.browseCatalog.description",
|
|
7
|
+
annotations: { readOnly: true },
|
|
8
|
+
inputExamples: [{ scenario: "Browse the catalog", input: {} }],
|
|
9
|
+
input: InputSchema,
|
|
10
|
+
output: OutputSchema,
|
|
11
|
+
handler,
|
|
12
|
+
},
|
|
13
|
+
"search-products": {
|
|
14
|
+
annotations: { readOnly: true },
|
|
15
|
+
input: InputSchema,
|
|
16
|
+
output: OutputSchema,
|
|
17
|
+
handler,
|
|
18
|
+
},
|
|
19
|
+
};
|
package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-reexport-one.ts.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { registry } from "./barrel-two.js";
|
package/src/cli/__tests__/fixtures/migrate-operation-declaration/discovery-reexport-two.ts.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { registry } from "./leaf";
|
package/src/cli/__tests__/fixtures/migrate-operation-declaration/factory-duplicate-provider.ts.txt
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function makePingOperation() {
|
|
2
|
+
return defineOperation<ProviderContext>()({
|
|
3
|
+
annotations: { readOnly: true },
|
|
4
|
+
input: InputSchema,
|
|
5
|
+
output: OutputSchema,
|
|
6
|
+
handler,
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const first = buildProvider({ operations: { ping: makePingOperation() } });
|
|
11
|
+
export default buildProvider({ operations: { ping: makePingOperation() } });
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function makeSearchOperation(kind: string) {
|
|
2
|
+
return defineOperation<ProviderContext>()({
|
|
3
|
+
annotations: { readOnly: true },
|
|
4
|
+
inputExamples: [{ scenario: "Search items", input: { kind } }],
|
|
5
|
+
input: InputSchema,
|
|
6
|
+
output: OutputSchema,
|
|
7
|
+
handler,
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default buildProvider({
|
|
12
|
+
operations: {
|
|
13
|
+
"used-goods-search": makeSearchOperation("used"),
|
|
14
|
+
"realty-search-listings": makeSearchOperation("realty"),
|
|
15
|
+
"jobs-search": makeSearchOperation("jobs"),
|
|
16
|
+
"cars-search": makeSearchOperation("cars"),
|
|
17
|
+
},
|
|
18
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function makeSearchOperation(kind: string) {
|
|
2
|
+
return defineOperation<ProviderContext>()({
|
|
3
|
+
annotations: { readOnly: true },
|
|
4
|
+
inputExamples: [{ scenario: "Search items", input: { kind } }],
|
|
5
|
+
input: InputSchema,
|
|
6
|
+
output: OutputSchema,
|
|
7
|
+
handler,
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default buildProvider({
|
|
12
|
+
operations: { "search-items": makeSearchOperation("items") },
|
|
13
|
+
});
|