@uidu/client 3.6.0 → 3.7.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/CHANGELOG.md +9 -0
- package/codegen.ts +29 -7
- package/dist/declarations/src/cms.d.ts +8 -1
- package/dist/declarations/src/generated/index.d.ts +286 -16
- package/dist/declarations/src/help-center.d.ts +12 -1
- package/dist/declarations/src/index.d.ts +2 -2
- package/dist/uidu-client.cjs.dev.js +19 -1
- package/dist/uidu-client.cjs.prod.js +19 -1
- package/dist/uidu-client.esm.js +18 -2
- package/package.json +1 -1
- package/src/cms.ts +11 -0
- package/src/generated/index.ts +270 -16
- package/src/help-center.ts +16 -0
- package/src/index.ts +2 -1
- package/src/queries/cms/ListProjects.graphql +17 -0
- package/src/queries/help-center/ListChannels.graphql +17 -0
package/src/help-center.ts
CHANGED
|
@@ -3,7 +3,10 @@ import {
|
|
|
3
3
|
GetChannelDocument,
|
|
4
4
|
type GetChannelQuery,
|
|
5
5
|
type GetChannelQueryVariables,
|
|
6
|
+
ListChannelsDocument,
|
|
7
|
+
type ListChannelsQueryVariables,
|
|
6
8
|
} from './generated';
|
|
9
|
+
import { nodes } from './utils/relay';
|
|
7
10
|
|
|
8
11
|
export type Channel = NonNullable<
|
|
9
12
|
NonNullable<GetChannelQuery['currentWorkspace']>['channel']
|
|
@@ -16,3 +19,16 @@ export async function getChannel(
|
|
|
16
19
|
const result = await client.query(GetChannelDocument, variables);
|
|
17
20
|
return result.currentWorkspace?.channel ?? null;
|
|
18
21
|
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The workspace's help center channels. `isDefault` marks the one the
|
|
25
|
+
* workspace treats as its main channel — a caller that has no channel id
|
|
26
|
+
* configured should prefer it over the first row.
|
|
27
|
+
*/
|
|
28
|
+
export async function listChannels(
|
|
29
|
+
client: UiduClient,
|
|
30
|
+
variables: ListChannelsQueryVariables = {},
|
|
31
|
+
) {
|
|
32
|
+
const result = await client.query(ListChannelsDocument, variables);
|
|
33
|
+
return nodes(result.currentWorkspace?.channels);
|
|
34
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -40,6 +40,7 @@ export {
|
|
|
40
40
|
createPage,
|
|
41
41
|
createPageBlock,
|
|
42
42
|
createFieldValue,
|
|
43
|
+
listProjects,
|
|
43
44
|
} from './cms';
|
|
44
45
|
export type { Page, Template } from './cms';
|
|
45
46
|
|
|
@@ -98,7 +99,7 @@ export {
|
|
|
98
99
|
} from './forms';
|
|
99
100
|
export type { Form } from './forms';
|
|
100
101
|
|
|
101
|
-
export { getChannel } from './help-center';
|
|
102
|
+
export { getChannel, listChannels } from './help-center';
|
|
102
103
|
export type { Channel } from './help-center';
|
|
103
104
|
|
|
104
105
|
export { search } from './search';
|