@diagonal-hq/cli 0.5.0 → 0.6.0
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 +2 -0
- package/dist/cli.mjs +213 -31
- package/dist/index.d.ts +7 -0
- package/dist/sdk-contract.d.ts +24 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -157,6 +157,13 @@ export type PageAuthorizer =
|
|
|
157
157
|
};
|
|
158
158
|
|
|
159
159
|
export type PageDefinition = {
|
|
160
|
+
/**
|
|
161
|
+
* The page's identity, unique in the workspace: a camelCase name of at most
|
|
162
|
+
* 64 letters and digits that starts with a lowercase letter, such as
|
|
163
|
+
* `members`. Code links to the page as `Pages.<key>`. A file move keeps the
|
|
164
|
+
* key, and a key change is an identity change.
|
|
165
|
+
*/
|
|
166
|
+
key: string;
|
|
160
167
|
/** The URL pattern. Route parameters use `{name}`, for example `/members/{id}`. */
|
|
161
168
|
route: string;
|
|
162
169
|
/** The name in the admin. Defaults to the title. */
|
package/dist/sdk-contract.d.ts
CHANGED
|
@@ -1458,6 +1458,28 @@ type TaskNavigateOptions = {
|
|
|
1458
1458
|
preserveState?: boolean;
|
|
1459
1459
|
};
|
|
1460
1460
|
|
|
1461
|
+
type PageRefParams = Record<string, string | number>;
|
|
1462
|
+
|
|
1463
|
+
type PageRef<
|
|
1464
|
+
K extends string = string,
|
|
1465
|
+
P extends PageRefParams | undefined = PageRefParams | undefined
|
|
1466
|
+
> = {
|
|
1467
|
+
/** The page's key, from its `definePage` options. */
|
|
1468
|
+
readonly key: K;
|
|
1469
|
+
/** The page's id, or null when the page is not deployed or is paused. */
|
|
1470
|
+
readonly id: string | null;
|
|
1471
|
+
/** The deployed route pattern, e.g. `/members/{id}`, or null when the page is not deployed or is paused. */
|
|
1472
|
+
readonly route: string | null;
|
|
1473
|
+
/** The page's URL with `params` filled into the route, or null when the page has no route. */
|
|
1474
|
+
url(...args: undefined extends P ? [params?: P] : [params: P]): string | null;
|
|
1475
|
+
/** Navigate to the page with `params` filled into the route. A page without a route is ignored after a warning. */
|
|
1476
|
+
navigate(
|
|
1477
|
+
...args: undefined extends P
|
|
1478
|
+
? [params?: P, options?: TaskNavigateOptions]
|
|
1479
|
+
: [params: P, options?: TaskNavigateOptions]
|
|
1480
|
+
): void;
|
|
1481
|
+
};
|
|
1482
|
+
|
|
1461
1483
|
type SdkResourceReference = SdkResourceHandle | string | null | undefined;
|
|
1462
1484
|
|
|
1463
1485
|
type SdkResourceHandle = Omit<SdkResource, keyof SdkResourceOperations>;
|
|
@@ -13800,6 +13822,8 @@ declare namespace Sdk {
|
|
|
13800
13822
|
export type PageAliasCatalog = import("diagonal:sdk-internal").PageAliasCatalog;
|
|
13801
13823
|
export type PageReference = import("diagonal:sdk-internal").PageReference;
|
|
13802
13824
|
export type PageHandle = import("diagonal:sdk-internal").SdkPageHandle;
|
|
13825
|
+
export type PageRefParams = import("diagonal:sdk-internal").PageRefParams;
|
|
13826
|
+
export type PageRef<K extends string = string, P extends import("diagonal:sdk-internal").PageRefParams | undefined = import("diagonal:sdk-internal").PageRefParams | undefined> = import("diagonal:sdk-internal").PageRef<K, P>;
|
|
13803
13827
|
export type ResourceType<TRecord extends import("diagonal:sdk-internal").ResourceRecord = import("diagonal:sdk-internal").ResourceRecord, TRelations extends import("diagonal:sdk-internal").ResourceRelationCatalog = import("diagonal:sdk-internal").ResourceRelationCatalog> = import("diagonal:sdk-internal").SdkResourceType<TRecord, TRelations>;
|
|
13804
13828
|
export type ResourceRelationsFrom<TResource extends import("diagonal:sdk-internal").SdkResourceType> = import("diagonal:sdk-internal").ResourceRelationsFrom<TResource>;
|
|
13805
13829
|
export type ResourceRelationPath<TResource extends import("diagonal:sdk-internal").SdkResourceType> = import("diagonal:sdk-internal").SdkResourceRelationPath<TResource>;
|