Commit f743d02 authored Jul 24, 2023 Verified
1 parent 0dde2ff commit f743d02 Copy full SHA for f743d02
File tree 10 files changed +36
-23
lines changed
10 files changed +36
-23
lines changed Original file line number Diff line number Diff line change 1
- import { commandRpcPath , HttpMethod } from "@eventual/core" ;
1
+ import { commandRpcPath , HttpMethod } from "@eventual/core/constants " ;
2
2
import { getRequestHandler } from "./request-handler/factory.js" ;
3
3
import {
4
4
BeforeRequest ,
Original file line number Diff line number Diff line change 2
2
* .d.ts
3
3
node_modules
4
4
lib
5
- ! internal /*
5
+ ! internal /*
6
+ ! constants /*
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Alias to the internal module for CJS imports.
3
+ */
4
+ export * from "../lib/cjs/constants.js" ;
Original file line number Diff line number Diff line change 9
9
"./internal" : {
10
10
"import" : " ./lib/esm/internal/index.js" ,
11
11
"require" : " ./lib/cjs/internal/index.js"
12
+ },
13
+ "./constants" : {
14
+ "import" : " ./lib/esm/constants.js" ,
15
+ "require" : " ./lib/cjs/constants.js"
12
16
}
13
17
},
14
18
"main" : " ./lib/cjs/index.js" ,
Original file line number Diff line number Diff line change
1
+ export * from "./http/command-rpc-path.js" ;
2
+ export type * from "./http-method.js" ;
Original file line number Diff line number Diff line change
1
+ import type { AnyCommand } from "./command.js" ;
2
+
3
+ export function isDefaultNamespaceCommand <
4
+ C extends Pick < AnyCommand , "name" | "namespace" >
5
+ > ( command : C ) : command is C & { namespace : undefined } {
6
+ return ! command . namespace ;
7
+ }
8
+
9
+ /**
10
+ * Formats the RPC Rest path for a command.
11
+ *
12
+ * rpc[/namespace]/name
13
+ */
14
+ export function commandRpcPath (
15
+ command : Pick < AnyCommand , "name" | "namespace" >
16
+ ) {
17
+ return `rpc${
18
+ isDefaultNamespaceCommand ( command ) ? "" : `/${ command . namespace } `
19
+ } ${ command . name . startsWith ( "/" ) ? "" : "/" } ${ command . name } `;
20
+ }
Original file line number Diff line number Diff line change @@ -7,25 +7,6 @@ import type { ServiceContext } from "../service.js";
7
7
import type { Middleware } from "./middleware.js" ;
8
8
import type { ParsePath } from "./path.js" ;
9
9
10
- export function isDefaultNamespaceCommand <
11
- C extends Pick < AnyCommand , "name" | "namespace" >
12
- > ( command : C ) : command is C & { namespace : undefined } {
13
- return ! command . namespace ;
14
- }
15
-
16
- /**
17
- * Formats the RPC Rest path for a command.
18
- *
19
- * rpc[/namespace]/name
20
- */
21
- export function commandRpcPath (
22
- command : Pick < AnyCommand , "name" | "namespace" >
23
- ) {
24
- return `rpc${
25
- isDefaultNamespaceCommand ( command ) ? "" : `/${ command . namespace } `
26
- } ${ command . name . startsWith ( "/" ) ? "" : "/" } ${ command . name } `;
27
- }
28
-
29
10
export interface CommandContext {
30
11
service : ServiceContext ;
31
12
}
Original file line number Diff line number Diff line change 1
1
export * from "./api.js" ;
2
2
export * from "./command.js" ;
3
+ export * from "./command-rpc-path.js" ;
3
4
export * from "./error.js" ;
4
5
export * from "./middleware.js" ;
5
6
export * from "./request-response.js" ;
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ export function getEventualResource<Kind extends ResourceKind>(
74
74
export function getEventualResources < Kind extends ResourceKind > (
75
75
resourceKind : Kind
76
76
) : Map < string , ResourceOfKind < Kind > > {
77
- return globalThis . _eventual . resources [ resourceKind ] ?? new Map ( ) ;
77
+ return ( globalThis . _eventual . resources [ resourceKind ] ??= new Map ( ) ) ;
78
78
}
79
79
80
80
/**
Original file line number Diff line number Diff line change 1
1
import type openapi from "openapi3-ts" ;
2
- import { commandRpcPath } from "../http/command.js" ;
2
+ import { commandRpcPath } from "../http/command-rpc-path .js" ;
3
3
import type { CommandSpec } from "./service-spec.js" ;
4
4
5
5
export interface OpenAPISpecOptions {
You can’t perform that action at this time.
0 commit comments