@uidu/client 3.12.0 → 3.13.1

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 (71) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/declarations/src/actions.d.ts +10 -0
  3. package/dist/declarations/src/applications.d.ts +56 -3
  4. package/dist/declarations/src/benefit-enrollments.d.ts +5 -0
  5. package/dist/declarations/src/benefits.d.ts +5 -0
  6. package/dist/declarations/src/bookings.d.ts +22 -0
  7. package/dist/declarations/src/calls.d.ts +8 -0
  8. package/dist/declarations/src/campaigns.d.ts +12 -0
  9. package/dist/declarations/src/client.d.ts +13 -1
  10. package/dist/declarations/src/cms.d.ts +32 -0
  11. package/dist/declarations/src/contacts.d.ts +16 -0
  12. package/dist/declarations/src/courses.d.ts +23 -0
  13. package/dist/declarations/src/donations.d.ts +19 -0
  14. package/dist/declarations/src/events.d.ts +19 -0
  15. package/dist/declarations/src/forms.d.ts +19 -0
  16. package/dist/declarations/src/generated/index.d.ts +2893 -176
  17. package/dist/declarations/src/goals.d.ts +4 -0
  18. package/dist/declarations/src/help-center.d.ts +4 -0
  19. package/dist/declarations/src/index.d.ts +3 -3
  20. package/dist/declarations/src/kb.d.ts +15 -0
  21. package/dist/declarations/src/models.d.ts +54 -0
  22. package/dist/declarations/src/mutations.d.ts +175 -1
  23. package/dist/declarations/src/notes.d.ts +4 -0
  24. package/dist/declarations/src/people.d.ts +8 -0
  25. package/dist/declarations/src/search.d.ts +7 -0
  26. package/dist/declarations/src/sites.d.ts +23 -1
  27. package/dist/declarations/src/spaces.d.ts +4 -0
  28. package/dist/declarations/src/stories.d.ts +11 -0
  29. package/dist/declarations/src/system.d.ts +4 -0
  30. package/dist/declarations/src/tasks.d.ts +4 -0
  31. package/dist/declarations/src/types.d.ts +4 -0
  32. package/dist/uidu-client.cjs.dev.js +585 -10
  33. package/dist/uidu-client.cjs.prod.js +585 -10
  34. package/dist/uidu-client.esm.js +582 -11
  35. package/package.json +1 -1
  36. package/src/actions.ts +10 -6
  37. package/src/applications.test.ts +42 -0
  38. package/src/applications.ts +31 -2
  39. package/src/benefit-enrollments.ts +5 -0
  40. package/src/benefits.ts +5 -0
  41. package/src/bookings.ts +22 -0
  42. package/src/calls.ts +8 -0
  43. package/src/campaigns.ts +12 -0
  44. package/src/client.ts +13 -1
  45. package/src/cms.ts +32 -0
  46. package/src/contacts.ts +16 -0
  47. package/src/courses.ts +23 -0
  48. package/src/donations.ts +19 -0
  49. package/src/events.ts +19 -0
  50. package/src/forms.ts +19 -0
  51. package/src/generated/index.ts +2528 -172
  52. package/src/goals.ts +4 -0
  53. package/src/help-center.ts +4 -0
  54. package/src/index.ts +8 -1
  55. package/src/kb.ts +15 -0
  56. package/src/models.ts +54 -0
  57. package/src/mutations.ts +162 -0
  58. package/src/notes.ts +4 -0
  59. package/src/people.ts +8 -0
  60. package/src/queries/applications/UpdateApplication.graphql +17 -0
  61. package/src/queries/cms/GetPage.graphql +1 -0
  62. package/src/queries/people/TimeClockMutations.graphql +17 -0
  63. package/src/queries/sites/CreateSite.graphql +15 -0
  64. package/src/search.ts +7 -0
  65. package/src/sites.test.ts +26 -0
  66. package/src/sites.ts +17 -0
  67. package/src/spaces.ts +4 -0
  68. package/src/stories.ts +11 -0
  69. package/src/system.ts +4 -0
  70. package/src/tasks.ts +4 -0
  71. package/src/types.ts +4 -0
@@ -1,4 +1,11 @@
1
1
  import type { UiduClient } from "./client.js";
2
2
  import { type SearchQuery, type SearchQueryVariables } from "./generated/index.js";
3
3
  export type SearchResult = NonNullable<NonNullable<SearchQuery['currentWorkspace']>['search']>;
4
+ /**
5
+ * Search the workspace index, optionally limited to `models`, with filters and
6
+ * sorting in `params`; page with `first`/`after`.
7
+ *
8
+ * Returns the connection itself, not a flat array: `edges`, `pageInfo`,
9
+ * `totalCount`, `term`, `took`. Each node only carries `__typename` and `id`.
10
+ */
4
11
  export declare function search(client: UiduClient, variables: SearchQueryVariables): Promise<SearchResult | null>;
@@ -1,5 +1,5 @@
1
1
  import type { UiduClient } from "./client.js";
2
- import { type PublishableStatus, type SiteFieldsFragment, type SiteModelFieldsFragment } from "./generated/index.js";
2
+ import { type CreateSiteMutationVariables, type PublishableStatus, type SiteFieldsFragment, type SiteModelFieldsFragment } from "./generated/index.js";
3
3
  /**
4
4
  * The new CMS: a Site, its page types (page-kind Models), its pages
5
5
  * (ModelItems of those Models) and the blocks placed on each page (block-kind
@@ -79,3 +79,25 @@ export declare function getSingletonBlock(client: UiduClient, variables: {
79
79
  siteId: string;
80
80
  shortname: string;
81
81
  }): Promise<SitePage | null>;
82
+ /**
83
+ * Provisions a new Site in the workspace/account (`tenantId`). Bearer token
84
+ * (`apiKey`) — this is workspace admin territory, never a public write.
85
+ * Returns the mutation payload as-is, including `errors`.
86
+ */
87
+ export declare function createSite(client: UiduClient, variables: CreateSiteMutationVariables): Promise<{
88
+ __typename?: "CreateSitePayload";
89
+ site?: {
90
+ __typename?: "SiteEdge";
91
+ node?: {
92
+ __typename?: "Site";
93
+ id: string;
94
+ name?: string | null;
95
+ } | null;
96
+ } | null;
97
+ errors: Array<{
98
+ __typename?: "Error";
99
+ key: string;
100
+ name: string;
101
+ type: string;
102
+ }>;
103
+ } | null>;
@@ -1,5 +1,9 @@
1
1
  import type { UiduClient } from "./client.js";
2
2
  import { type CreateSpaceMutationVariables } from "./generated/index.js";
3
+ /**
4
+ * Create a space, the container tasks live in. Returns the payload (with
5
+ * `errors`) or null; the new space is at `space.node`.
6
+ */
3
7
  export declare function createSpace(client: UiduClient, variables: CreateSpaceMutationVariables): Promise<{
4
8
  __typename?: "CreateSpacePayload";
5
9
  space?: {
@@ -1,7 +1,14 @@
1
1
  import type { UiduClient } from "./client.js";
2
2
  import { type CreateStoryMutationVariables, type GetStoryQuery, type GetStoryQueryVariables, type ListStoriesQueryVariables } from "./generated/index.js";
3
3
  export type Story = NonNullable<NonNullable<GetStoryQuery['currentWorkspace']>['story']>;
4
+ /**
5
+ * One story with its rich-text `body`, or null.
6
+ */
4
7
  export declare function getStory(client: UiduClient, variables: GetStoryQueryVariables): Promise<Story | null>;
8
+ /**
9
+ * The workspace's stories as a flat array of summaries (no `body`); page with
10
+ * `first`/`after`.
11
+ */
5
12
  export declare function listStories(client: UiduClient, variables?: ListStoriesQueryVariables): Promise<{
6
13
  __typename?: "Story";
7
14
  id: string;
@@ -12,6 +19,10 @@ export declare function listStories(client: UiduClient, variables?: ListStoriesQ
12
19
  publishedAt?: any | null;
13
20
  publicPath?: string | null;
14
21
  }[]>;
22
+ /**
23
+ * Create a story; returns the payload as-is, `{ errors, story }`, validation
24
+ * failures included.
25
+ */
15
26
  export declare function createStory(client: UiduClient, variables: CreateStoryMutationVariables): Promise<{
16
27
  __typename?: "CreateStoryPayload";
17
28
  story?: {
@@ -1,5 +1,9 @@
1
1
  import type { UiduClient } from "./client.js";
2
2
  import { type CreateWorkspaceMutationVariables, type GenerateWorkspaceApiCredentialsMutationVariables } from "./generated/index.js";
3
+ /**
4
+ * Create a workspace owned by the authenticated account (`attributes.name`,
5
+ * `subdomain`…). Returns the payload (with `errors`) or null.
6
+ */
3
7
  export declare function createWorkspace(client: UiduClient, variables: CreateWorkspaceMutationVariables): Promise<{
4
8
  __typename?: "CreateWorkspacePayload";
5
9
  workspace?: {
@@ -1,5 +1,9 @@
1
1
  import type { UiduClient } from "./client.js";
2
2
  import { type CreateTaskMutationVariables } from "./generated/index.js";
3
+ /**
4
+ * Create a task, usually in a space (`attributes.spaceId`). Returns the
5
+ * payload (with `errors`) or null.
6
+ */
3
7
  export declare function createTask(client: UiduClient, variables: CreateTaskMutationVariables): Promise<{
4
8
  __typename?: "CreateTaskPayload";
5
9
  task?: {
@@ -18,6 +18,10 @@ export interface UiduErrorOptions {
18
18
  graphQLErrors?: ReadonlyArray<unknown>;
19
19
  cause?: unknown;
20
20
  }
21
+ /**
22
+ * What `UiduClient` throws: `code` is `GRAPHQL_ERROR` (with `graphQLErrors`),
23
+ * `NETWORK_ERROR`, `TOKEN_ERROR` or `CONFIG_ERROR`.
24
+ */
21
25
  export declare class UiduError extends Error {
22
26
  readonly code: string;
23
27
  readonly graphQLErrors: ReadonlyArray<unknown>;