@uidu/client 3.11.0 → 3.12.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uidu/client",
3
- "version": "3.11.0",
3
+ "version": "3.12.0",
4
4
  "description": "Typed GraphQL client for the uidu platform. Server-first, framework-agnostic.",
5
5
  "license": "MIT",
6
6
  "author": "uidu",
@@ -32060,6 +32060,8 @@ export type Mutation = Node & {
32060
32060
  reorderWorkflowStep?: Maybe<ReorderWorkflowStepPayload>;
32061
32061
  reorderWorkflowStepItem?: Maybe<ReorderWorkflowStepItemPayload>;
32062
32062
  replaceDocumentAttachment?: Maybe<ReplaceDocumentAttachmentPayload>;
32063
+ /** Replace the format of an owner for one purpose with an ordered list of parts */
32064
+ replaceNameFormatParts?: Maybe<ReplaceNameFormatPartsPayload>;
32063
32065
  replayWebhookDelivery?: Maybe<ReplayWebhookDeliveryPayload>;
32064
32066
  requestReward?: Maybe<RequestRewardPayload>;
32065
32067
  resendInvitation?: Maybe<ResendInvitationPayload>;
@@ -35358,6 +35360,11 @@ export type MutationReplaceDocumentAttachmentArgs = {
35358
35360
  };
35359
35361
 
35360
35362
 
35363
+ export type MutationReplaceNameFormatPartsArgs = {
35364
+ input: ReplaceNameFormatPartsInput;
35365
+ };
35366
+
35367
+
35361
35368
  export type MutationReplayWebhookDeliveryArgs = {
35362
35369
  input: ReplayWebhookDeliveryInput;
35363
35370
  };
@@ -36917,6 +36924,9 @@ export type MutationVoidSignatureRequestArgs = {
36917
36924
  input: VoidSignatureRequestInput;
36918
36925
  };
36919
36926
 
36927
+ /** Objects which may own a name format */
36928
+ export type NameFormatOwner = DocumentModel | Product | WorkspaceApp;
36929
+
36920
36930
  /** One token of a composed name: a field, a token or a literal */
36921
36931
  export type NameFormatPart = ActiveRecordTimestamp & Node & {
36922
36932
  __typename?: 'NameFormatPart';
@@ -36950,15 +36960,18 @@ export type NameFormatPartAttributes = {
36950
36960
  ifFalse?: InputMaybe<Scalars['String']['input']>;
36951
36961
  /** Text used for a true value, with the boolean transformer */
36952
36962
  ifTrue?: InputMaybe<Scalars['String']['input']>;
36953
- /** The token to resolve, for kind token (e.g. contact.lastName, createdAt) */
36963
+ /** The token to resolve, for kind token (contact.lastName, createdAt; year, month, day, number for a code) */
36954
36964
  key?: InputMaybe<Scalars['String']['input']>;
36955
36965
  /** field | token | literal */
36956
36966
  kind?: InputMaybe<Scalars['String']['input']>;
36957
- /** The record whose format this part belongs to (a document model) */
36967
+ /**
36968
+ * The record whose format this part belongs to: a document model, the inventory
36969
+ * app (delivery and transfer codes) or a product (sku codes)
36970
+ */
36958
36971
  ownerId?: InputMaybe<Scalars['ID']['input']>;
36959
36972
  /** Order of the part within its format, from 0 */
36960
36973
  position?: InputMaybe<Scalars['Int']['input']>;
36961
- /** Which name the parts compose (document_name) */
36974
+ /** Which name the parts compose: document_name, delivery_code, transfer_code or sku_code */
36962
36975
  purpose?: InputMaybe<Scalars['String']['input']>;
36963
36976
  /** Transformer applied to the resolved value (uppercase, date, fill, …) */
36964
36977
  transformer?: InputMaybe<Scalars['String']['input']>;
@@ -40112,6 +40125,8 @@ export type Product = ActiveRecordTimestamp & ActsAsFormable & Node & WithCampai
40112
40125
  memberList: Array<User>;
40113
40126
  members: UserConnection;
40114
40127
  name?: Maybe<Scalars['String']['output']>;
40128
+ /** How a new sku of this product is coded, in order */
40129
+ nameFormatParts: Array<NameFormatPart>;
40115
40130
  orderItems?: Maybe<Array<OrderItem>>;
40116
40131
  orderList: Array<Order>;
40117
40132
  orders: OrderConnection;
@@ -43214,6 +43229,31 @@ export type ReplaceDocumentAttachmentPayload = {
43214
43229
  errors: Array<Error>;
43215
43230
  };
43216
43231
 
43232
+ /** Autogenerated input type of ReplaceNameFormatParts */
43233
+ export type ReplaceNameFormatPartsInput = {
43234
+ /** Flag to mark the object for destruction */
43235
+ _destroy?: InputMaybe<Scalars['Boolean']['input']>;
43236
+ /** A unique identifier for the client performing the mutation. */
43237
+ clientMutationId?: InputMaybe<Scalars['String']['input']>;
43238
+ /** Global ID of the object */
43239
+ id?: InputMaybe<Scalars['ID']['input']>;
43240
+ ownerId: Scalars['ID']['input'];
43241
+ /** The parts, in order; position comes from the order */
43242
+ parts: Array<NameFormatPartAttributes>;
43243
+ /** document_name, delivery_code, transfer_code or sku_code */
43244
+ purpose: Scalars['String']['input'];
43245
+ };
43246
+
43247
+ /** Autogenerated return type of ReplaceNameFormatParts. */
43248
+ export type ReplaceNameFormatPartsPayload = {
43249
+ __typename?: 'ReplaceNameFormatPartsPayload';
43250
+ /** A unique identifier for the client performing the mutation. */
43251
+ clientMutationId?: Maybe<Scalars['String']['output']>;
43252
+ errors: Array<Error>;
43253
+ nameFormatParts?: Maybe<Array<NameFormatPart>>;
43254
+ owner?: Maybe<NameFormatOwner>;
43255
+ };
43256
+
43217
43257
  /** Autogenerated input type of ReplayWebhookDelivery */
43218
43258
  export type ReplayWebhookDeliveryInput = {
43219
43259
  /** Flag to mark the object for destruction */
@@ -62262,6 +62302,8 @@ export type WorkspaceApp = ActiveRecordTimestamp & Node & Showcase & WithDataVie
62262
62302
  modelList?: Maybe<Array<Model>>;
62263
62303
  models?: Maybe<ModelConnection>;
62264
62304
  name?: Maybe<Scalars['String']['output']>;
62305
+ /** How the codes of this app are composed, in order */
62306
+ nameFormatParts: Array<NameFormatPart>;
62265
62307
  newCycleSuggestedStartDate?: Maybe<Scalars['ISO8601Date']['output']>;
62266
62308
  openTasksCount: Scalars['Int']['output'];
62267
62309
  owner: WorkspaceAppOwner;
@@ -62392,6 +62434,11 @@ export type WorkspaceAppModelsArgs = {
62392
62434
  };
62393
62435
 
62394
62436
 
62437
+ export type WorkspaceAppNameFormatPartsArgs = {
62438
+ purpose?: InputMaybe<Scalars['String']['input']>;
62439
+ };
62440
+
62441
+
62395
62442
  export type WorkspaceAppPersonalDataViewsArgs = {
62396
62443
  after?: InputMaybe<Scalars['String']['input']>;
62397
62444
  before?: InputMaybe<Scalars['String']['input']>;
@@ -63477,6 +63524,38 @@ export type UpdateFormResponseMutationVariables = Exact<{
63477
63524
 
63478
63525
  export type UpdateFormResponseMutation = { __typename?: 'Mutation', updateFormResponse?: { __typename?: 'UpdateFormResponsePayload', errors: Array<{ __typename?: 'Error', key: string, name: string, type: string }>, formResponse?: { __typename?: 'FormResponse', id: string, status?: string | null, fieldValues?: Array<{ __typename?: 'FieldValue', id: string, content?: any | null, linkedRecordId?: string | null, field: { __typename?: 'Field', id: string } }> | null, contact?: { __typename?: 'Contact', id: string } | null } | null } | null };
63479
63526
 
63527
+ export type GetGoalQueryVariables = Exact<{
63528
+ id: Scalars['ID']['input'];
63529
+ }>;
63530
+
63531
+
63532
+ export type GetGoalQuery = { __typename?: 'Query', currentWorkspace?: { __typename?: 'Workspace', goal?: { __typename?: 'Goal', id: string, name?: string | null, description?: any | null, kind?: GoalKind | null, metricKind?: string | null, status?: string | null, currency?: string | null, initialValue?: number | null, currentValue?: number | null, targetValue?: number | null, progress?: number | null, weight?: number | null, updateFrequency?: string | null, parentId?: string | null, subgoalsCount?: number | null, createdAt: any, updatedAt: any, subgoals?: { __typename?: 'GoalConnection', edges?: Array<{ __typename?: 'GoalEdge', node?: { __typename?: 'Goal', id: string, name?: string | null, description?: any | null, kind?: GoalKind | null, metricKind?: string | null, status?: string | null, currency?: string | null, initialValue?: number | null, currentValue?: number | null, targetValue?: number | null, progress?: number | null, weight?: number | null, updateFrequency?: string | null, parentId?: string | null, subgoalsCount?: number | null, createdAt: any, updatedAt: any, timeframe?: { __typename?: 'Timeframe', id: string, name?: string | null, startDate?: any | null, endDate?: any | null } | null } | null } | null> | null } | null, timeframe?: { __typename?: 'Timeframe', id: string, name?: string | null, startDate?: any | null, endDate?: any | null } | null } | null } | null };
63533
+
63534
+ export type GoalFieldsFragment = { __typename?: 'Goal', id: string, name?: string | null, description?: any | null, kind?: GoalKind | null, metricKind?: string | null, status?: string | null, currency?: string | null, initialValue?: number | null, currentValue?: number | null, targetValue?: number | null, progress?: number | null, weight?: number | null, updateFrequency?: string | null, parentId?: string | null, subgoalsCount?: number | null, createdAt: any, updatedAt: any, timeframe?: { __typename?: 'Timeframe', id: string, name?: string | null, startDate?: any | null, endDate?: any | null } | null };
63535
+
63536
+ export type UpdateGoalMutationVariables = Exact<{
63537
+ input: UpdateGoalInput;
63538
+ }>;
63539
+
63540
+
63541
+ export type UpdateGoalMutation = { __typename?: 'Mutation', updateGoal?: { __typename?: 'UpdateGoalPayload', goal?: { __typename?: 'Goal', id: string, name?: string | null, description?: any | null, kind?: GoalKind | null, metricKind?: string | null, status?: string | null, currency?: string | null, initialValue?: number | null, currentValue?: number | null, targetValue?: number | null, progress?: number | null, weight?: number | null, updateFrequency?: string | null, parentId?: string | null, subgoalsCount?: number | null, createdAt: any, updatedAt: any, timeframe?: { __typename?: 'Timeframe', id: string, name?: string | null, startDate?: any | null, endDate?: any | null } | null } | null, errors: Array<{ __typename?: 'Error', key: string, name: string, type: string }> } | null };
63542
+
63543
+ export type ListGoalsQueryVariables = Exact<{
63544
+ first?: InputMaybe<Scalars['Int']['input']>;
63545
+ after?: InputMaybe<Scalars['String']['input']>;
63546
+ }>;
63547
+
63548
+
63549
+ export type ListGoalsQuery = { __typename?: 'Query', currentWorkspace?: { __typename?: 'Workspace', goals: { __typename?: 'GoalConnection', pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean, endCursor?: string | null }, edges?: Array<{ __typename?: 'GoalEdge', node?: { __typename?: 'Goal', id: string, name?: string | null, description?: any | null, kind?: GoalKind | null, metricKind?: string | null, status?: string | null, currency?: string | null, initialValue?: number | null, currentValue?: number | null, targetValue?: number | null, progress?: number | null, weight?: number | null, updateFrequency?: string | null, parentId?: string | null, subgoalsCount?: number | null, createdAt: any, updatedAt: any, timeframe?: { __typename?: 'Timeframe', id: string, name?: string | null, startDate?: any | null, endDate?: any | null } | null } | null } | null> | null } } | null };
63550
+
63551
+ export type ListTimeframesQueryVariables = Exact<{
63552
+ first?: InputMaybe<Scalars['Int']['input']>;
63553
+ after?: InputMaybe<Scalars['String']['input']>;
63554
+ }>;
63555
+
63556
+
63557
+ export type ListTimeframesQuery = { __typename?: 'Query', currentWorkspace?: { __typename?: 'Workspace', timeframes: { __typename?: 'TimeframeConnection', pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean, endCursor?: string | null }, edges?: Array<{ __typename?: 'TimeframeEdge', node?: { __typename?: 'Timeframe', id: string, name?: string | null, startDate?: any | null, endDate?: any | null, year?: number | null, active?: boolean | null } | null } | null> | null } } | null };
63558
+
63480
63559
  export type CreateChannelMutationVariables = Exact<{
63481
63560
  input: CreateChannelInput;
63482
63561
  }>;
@@ -64001,6 +64080,7 @@ export type DeleteTaskMutation = { __typename?: 'Mutation', deleteTask?: { __typ
64001
64080
 
64002
64081
  export const FormFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FormFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Form"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","alias":{"kind":"Name","value":"inputs"},"name":{"kind":"Name","value":"formQuestions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"required"}},{"kind":"Field","name":{"kind":"Name","value":"hidden"}},{"kind":"Field","name":{"kind":"Name","value":"placeholder"}},{"kind":"Field","name":{"kind":"Name","value":"hint"}},{"kind":"Field","name":{"kind":"Name","value":"fieldKind"}},{"kind":"Field","name":{"kind":"Name","value":"rules"}},{"kind":"Field","name":{"kind":"Name","value":"preferences"}},{"kind":"Field","name":{"kind":"Name","value":"field"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"accessor"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"shortname"}},{"kind":"Field","name":{"kind":"Name","value":"uploadPresignedUrl"}},{"kind":"Field","name":{"kind":"Name","value":"uploadUrl"}},{"kind":"Field","name":{"kind":"Name","value":"uploadParams"}},{"kind":"Field","alias":{"kind":"Name","value":"options"},"name":{"kind":"Name","value":"optionList"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<FormFieldsFragment, unknown>;
64003
64082
  export const FormResponseFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FormResponseFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FormResponse"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"fieldValues"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"linkedRecordId"}},{"kind":"Field","name":{"kind":"Name","value":"field"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"contact"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode<FormResponseFieldsFragment, unknown>;
64083
+ export const GoalFieldsFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GoalFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Goal"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"metricKind"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"currency"}},{"kind":"Field","name":{"kind":"Name","value":"initialValue"}},{"kind":"Field","name":{"kind":"Name","value":"currentValue"}},{"kind":"Field","name":{"kind":"Name","value":"targetValue"}},{"kind":"Field","name":{"kind":"Name","value":"progress"}},{"kind":"Field","name":{"kind":"Name","value":"weight"}},{"kind":"Field","name":{"kind":"Name","value":"updateFrequency"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"subgoalsCount"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"timeframe"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"startDate"}},{"kind":"Field","name":{"kind":"Name","value":"endDate"}}]}}]}}]} as unknown as DocumentNode<GoalFieldsFragment, unknown>;
64004
64084
  export const ModelFieldOptionFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ModelFieldOption"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldOption"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"position"}}]}}]} as unknown as DocumentNode<ModelFieldOptionFragment, unknown>;
64005
64085
  export const ModelFieldFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ModelField"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Field"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"shortname"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"required"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"optionList"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ModelFieldOption"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ModelFieldOption"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldOption"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"position"}}]}}]} as unknown as DocumentNode<ModelFieldFragment, unknown>;
64006
64086
  export const ModelSchemaFragmentDoc = {"kind":"Document","definitions":[{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ModelSchema"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Model"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"namePlural"}},{"kind":"Field","name":{"kind":"Name","value":"fieldList"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ModelField"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ModelFieldOption"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FieldOption"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"color"}},{"kind":"Field","name":{"kind":"Name","value":"position"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ModelField"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Field"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"shortname"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"required"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"optionList"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ModelFieldOption"}}]}}]}}]} as unknown as DocumentNode<ModelSchemaFragment, unknown>;
@@ -64069,6 +64149,10 @@ export const DeleteFormDocument = {"kind":"Document","definitions":[{"kind":"Ope
64069
64149
  export const GetFormDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetForm"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentWorkspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"form"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FormFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FormFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Form"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","alias":{"kind":"Name","value":"inputs"},"name":{"kind":"Name","value":"formQuestions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"position"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"required"}},{"kind":"Field","name":{"kind":"Name","value":"hidden"}},{"kind":"Field","name":{"kind":"Name","value":"placeholder"}},{"kind":"Field","name":{"kind":"Name","value":"hint"}},{"kind":"Field","name":{"kind":"Name","value":"fieldKind"}},{"kind":"Field","name":{"kind":"Name","value":"rules"}},{"kind":"Field","name":{"kind":"Name","value":"preferences"}},{"kind":"Field","name":{"kind":"Name","value":"field"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"accessor"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"shortname"}},{"kind":"Field","name":{"kind":"Name","value":"uploadPresignedUrl"}},{"kind":"Field","name":{"kind":"Name","value":"uploadUrl"}},{"kind":"Field","name":{"kind":"Name","value":"uploadParams"}},{"kind":"Field","alias":{"kind":"Name","value":"options"},"name":{"kind":"Name","value":"optionList"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<GetFormQuery, GetFormQueryVariables>;
64070
64150
  export const ListFormsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListForms"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"after"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentWorkspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"forms"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}},{"kind":"Argument","name":{"kind":"Name","value":"after"},"value":{"kind":"Variable","name":{"kind":"Name","value":"after"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}},{"kind":"Field","name":{"kind":"Name","value":"endCursor"}}]}},{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"cover"}},{"kind":"Field","name":{"kind":"Name","value":"coverData"}},{"kind":"Field","name":{"kind":"Name","value":"published"}},{"kind":"Field","name":{"kind":"Name","value":"publishedAt"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<ListFormsQuery, ListFormsQueryVariables>;
64071
64151
  export const UpdateFormResponseDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateFormResponse"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateFormResponseInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateFormResponse"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"errors"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}},{"kind":"Field","name":{"kind":"Name","value":"formResponse"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"FormResponseFields"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"FormResponseFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"FormResponse"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"fieldValues"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"content"}},{"kind":"Field","name":{"kind":"Name","value":"linkedRecordId"}},{"kind":"Field","name":{"kind":"Name","value":"field"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"contact"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode<UpdateFormResponseMutation, UpdateFormResponseMutationVariables>;
64152
+ export const GetGoalDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetGoal"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentWorkspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"goal"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"GoalFields"}},{"kind":"Field","name":{"kind":"Name","value":"subgoals"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"GoalFields"}}]}}]}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GoalFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Goal"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"metricKind"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"currency"}},{"kind":"Field","name":{"kind":"Name","value":"initialValue"}},{"kind":"Field","name":{"kind":"Name","value":"currentValue"}},{"kind":"Field","name":{"kind":"Name","value":"targetValue"}},{"kind":"Field","name":{"kind":"Name","value":"progress"}},{"kind":"Field","name":{"kind":"Name","value":"weight"}},{"kind":"Field","name":{"kind":"Name","value":"updateFrequency"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"subgoalsCount"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"timeframe"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"startDate"}},{"kind":"Field","name":{"kind":"Name","value":"endDate"}}]}}]}}]} as unknown as DocumentNode<GetGoalQuery, GetGoalQueryVariables>;
64153
+ export const UpdateGoalDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateGoal"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateGoalInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateGoal"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"goal"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"GoalFields"}}]}},{"kind":"Field","name":{"kind":"Name","value":"errors"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GoalFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Goal"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"metricKind"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"currency"}},{"kind":"Field","name":{"kind":"Name","value":"initialValue"}},{"kind":"Field","name":{"kind":"Name","value":"currentValue"}},{"kind":"Field","name":{"kind":"Name","value":"targetValue"}},{"kind":"Field","name":{"kind":"Name","value":"progress"}},{"kind":"Field","name":{"kind":"Name","value":"weight"}},{"kind":"Field","name":{"kind":"Name","value":"updateFrequency"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"subgoalsCount"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"timeframe"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"startDate"}},{"kind":"Field","name":{"kind":"Name","value":"endDate"}}]}}]}}]} as unknown as DocumentNode<UpdateGoalMutation, UpdateGoalMutationVariables>;
64154
+ export const ListGoalsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListGoals"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"after"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentWorkspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"goals"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}},{"kind":"Argument","name":{"kind":"Name","value":"after"},"value":{"kind":"Variable","name":{"kind":"Name","value":"after"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}},{"kind":"Field","name":{"kind":"Name","value":"endCursor"}}]}},{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"GoalFields"}}]}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"GoalFields"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"Goal"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"kind"}},{"kind":"Field","name":{"kind":"Name","value":"metricKind"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"currency"}},{"kind":"Field","name":{"kind":"Name","value":"initialValue"}},{"kind":"Field","name":{"kind":"Name","value":"currentValue"}},{"kind":"Field","name":{"kind":"Name","value":"targetValue"}},{"kind":"Field","name":{"kind":"Name","value":"progress"}},{"kind":"Field","name":{"kind":"Name","value":"weight"}},{"kind":"Field","name":{"kind":"Name","value":"updateFrequency"}},{"kind":"Field","name":{"kind":"Name","value":"parentId"}},{"kind":"Field","name":{"kind":"Name","value":"subgoalsCount"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}},{"kind":"Field","name":{"kind":"Name","value":"timeframe"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"startDate"}},{"kind":"Field","name":{"kind":"Name","value":"endDate"}}]}}]}}]} as unknown as DocumentNode<ListGoalsQuery, ListGoalsQueryVariables>;
64155
+ export const ListTimeframesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ListTimeframes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"after"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentWorkspace"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"timeframes"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}},{"kind":"Argument","name":{"kind":"Name","value":"after"},"value":{"kind":"Variable","name":{"kind":"Name","value":"after"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"pageInfo"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"hasNextPage"}},{"kind":"Field","name":{"kind":"Name","value":"endCursor"}}]}},{"kind":"Field","name":{"kind":"Name","value":"edges"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"startDate"}},{"kind":"Field","name":{"kind":"Name","value":"endDate"}},{"kind":"Field","name":{"kind":"Name","value":"year"}},{"kind":"Field","name":{"kind":"Name","value":"active"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode<ListTimeframesQuery, ListTimeframesQueryVariables>;
64072
64156
  export const CreateChannelDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateChannel"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"CreateChannelInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createChannel"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channel"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"node"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}},{"kind":"Field","name":{"kind":"Name","value":"errors"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}}]}}]}}]} as unknown as DocumentNode<CreateChannelMutation, CreateChannelMutationVariables>;
64073
64157
  export const UpdateChannelDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateChannel"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateChannelInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateChannel"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channel"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"errors"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}}]}}]}}]} as unknown as DocumentNode<UpdateChannelMutation, UpdateChannelMutationVariables>;
64074
64158
  export const DeleteChannelDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"DeleteChannel"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"DeleteChannelInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"deleteChannel"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"channel"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}},{"kind":"Field","name":{"kind":"Name","value":"errors"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"type"}}]}}]}}]}}]} as unknown as DocumentNode<DeleteChannelMutation, DeleteChannelMutationVariables>;
@@ -0,0 +1,90 @@
1
+ import { beforeEach, describe, expect, it, vi } from 'vitest';
2
+
3
+ const request = vi.fn();
4
+
5
+ vi.mock('graphql-request', () => ({
6
+ GraphQLClient: class {
7
+ request = request;
8
+ },
9
+ ClientError: class extends Error {},
10
+ }));
11
+
12
+ const { createClient } = await import('./client');
13
+ const goals = await import('./goals');
14
+
15
+ const client = createClient({
16
+ endpoint: 'https://acme.uidu.org/graphql',
17
+ getToken: async () => 'session',
18
+ });
19
+
20
+ const q2 = { id: 'tf_1', name: 'Q2', startDate: '2026-04-01', endDate: '2026-06-30' };
21
+
22
+ beforeEach(() => request.mockReset());
23
+
24
+ describe('reads', () => {
25
+ it('listGoals flattens the connection', async () => {
26
+ request.mockResolvedValue({
27
+ currentWorkspace: {
28
+ goals: {
29
+ pageInfo: { hasNextPage: false, endCursor: null },
30
+ edges: [{ node: { id: 'g1', name: 'Revenue' } }],
31
+ },
32
+ },
33
+ });
34
+ await expect(goals.listGoals(client)).resolves.toEqual([
35
+ { id: 'g1', name: 'Revenue' },
36
+ ]);
37
+ });
38
+
39
+ it('getGoal returns null when the goal is not there', async () => {
40
+ request.mockResolvedValue({ currentWorkspace: { goal: null } });
41
+ await expect(goals.getGoal(client, { id: 'g1' })).resolves.toBeNull();
42
+ });
43
+
44
+ it('asks only for fields a custom app may read', async () => {
45
+ request.mockResolvedValue({ currentWorkspace: { goal: null } });
46
+ await goals.getGoal(client, { id: 'g1' });
47
+ const printed = JSON.stringify(request.mock.calls[0][0]);
48
+ for (const shut of ['"owner"', '"members"', '"logs"', '"workspace"']) {
49
+ expect(printed).not.toContain(`"value":${shut}`);
50
+ }
51
+ });
52
+ });
53
+
54
+ describe('values are stored x100', () => {
55
+ it('goalValue divides by 100, checkbox is 1 or 0', () => {
56
+ expect(goals.goalValue({ metricKind: 'percentage' }, 4500)).toBe(45);
57
+ expect(goals.goalValue({ metricKind: 'currency' }, 12_050)).toBe(120.5);
58
+ expect(goals.goalValue({ metricKind: 'checkbox' }, 100)).toBe(1);
59
+ expect(goals.goalValue({ metricKind: 'number' }, null)).toBeNull();
60
+ expect(goals.toGoalRaw(120.5)).toBe(12_050);
61
+ });
62
+
63
+ it('goalProgress reads 10000 as done', () => {
64
+ expect(goals.goalProgress({ progress: 10_000 })).toBe(1);
65
+ expect(goals.goalProgress({ progress: 4500 })).toBe(0.45);
66
+ expect(goals.goalProgress({ progress: null })).toBe(0);
67
+ });
68
+ });
69
+
70
+ describe('behind schedule', () => {
71
+ const midQ2 = new Date('2026-05-16T00:00:00Z');
72
+
73
+ it('goalTimeElapsed counts the last day of the timeframe', () => {
74
+ expect(goals.goalTimeElapsed({ timeframe: q2 }, new Date('2026-07-01T00:00:00Z'))).toBe(1);
75
+ expect(goals.goalTimeElapsed({ timeframe: q2 }, midQ2)).toBeCloseTo(0.5, 1);
76
+ expect(goals.goalTimeElapsed({ timeframe: null })).toBeNull();
77
+ });
78
+
79
+ it('isGoalBehind compares progress with time elapsed', () => {
80
+ expect(goals.isGoalBehind({ timeframe: q2, progress: 2000 }, { now: midQ2 })).toBe(true);
81
+ expect(goals.isGoalBehind({ timeframe: q2, progress: 6000 }, { now: midQ2 })).toBe(false);
82
+ expect(
83
+ goals.isGoalBehind({ timeframe: q2, progress: 4500 }, { now: midQ2, tolerance: 0.1 }),
84
+ ).toBe(false);
85
+ expect(
86
+ goals.isGoalBehind({ timeframe: q2, progress: 0, status: 'accomplished' }, { now: midQ2 }),
87
+ ).toBe(false);
88
+ expect(goals.isGoalBehind({ timeframe: null, progress: 0 })).toBe(false);
89
+ });
90
+ });
package/src/goals.ts ADDED
@@ -0,0 +1,144 @@
1
+ import type { UiduClient } from './client';
2
+ import {
3
+ GetGoalDocument,
4
+ type GetGoalQuery,
5
+ type GetGoalQueryVariables,
6
+ ListGoalsDocument,
7
+ type ListGoalsQueryVariables,
8
+ ListTimeframesDocument,
9
+ type ListTimeframesQuery,
10
+ type ListTimeframesQueryVariables,
11
+ UpdateGoalDocument,
12
+ type UpdateGoalMutationVariables,
13
+ } from './generated';
14
+ import { nodes } from './utils/relay';
15
+
16
+ // Goals (OKRs) are native to every uidu workspace: an objective is a Goal, its
17
+ // key results are its subgoals, and the period it runs over is a Timeframe.
18
+ //
19
+ // Reads work with any client that may see the workspace, including a custom
20
+ // app's session token — which sees the workspace-level goals and those of the
21
+ // Space the app sits in, and only the fields in `GoalFields`. `updateGoal`
22
+ // needs an account (Bearer / apiKey): a custom app cannot write goals.
23
+
24
+ export type Goal = NonNullable<
25
+ NonNullable<GetGoalQuery['currentWorkspace']>['goal']
26
+ >;
27
+ export type Timeframe = NonNullable<
28
+ NonNullable<
29
+ NonNullable<
30
+ NonNullable<ListTimeframesQuery['currentWorkspace']>['timeframes']
31
+ >['edges']
32
+ >[number]
33
+ >['node'];
34
+
35
+ /** Every goal of the workspace (objectives and key results alike), newest first. Without `first`, all of them. */
36
+ export async function listGoals(
37
+ client: UiduClient,
38
+ variables: ListGoalsQueryVariables = {},
39
+ ) {
40
+ const result = await client.query(ListGoalsDocument, variables);
41
+ return nodes(result.currentWorkspace?.goals);
42
+ }
43
+
44
+ /** One goal with its key results (`subgoals`). */
45
+ export async function getGoal(
46
+ client: UiduClient,
47
+ variables: GetGoalQueryVariables,
48
+ ): Promise<Goal | null> {
49
+ const result = await client.query(GetGoalDocument, variables);
50
+ return result.currentWorkspace?.goal ?? null;
51
+ }
52
+
53
+ export async function listTimeframes(
54
+ client: UiduClient,
55
+ variables: ListTimeframesQueryVariables = {},
56
+ ) {
57
+ const result = await client.query(ListTimeframesDocument, variables);
58
+ return nodes(result.currentWorkspace?.timeframes);
59
+ }
60
+
61
+ /**
62
+ * Authoring (Bearer / apiKey). Returns the payload, incl. `errors`.
63
+ * `initialValue` / `currentValue` / `targetValue` are stored x100: pass
64
+ * `toGoalRaw(value)`, never the number a person typed.
65
+ */
66
+ export async function updateGoal(
67
+ client: UiduClient,
68
+ variables: UpdateGoalMutationVariables,
69
+ ) {
70
+ const result = await client.mutate(UpdateGoalDocument, variables);
71
+ return result.updateGoal ?? null;
72
+ }
73
+
74
+ type GoalMetric = { metricKind?: string | null };
75
+
76
+ /**
77
+ * A stored goal value (`initialValue`, `currentValue`, `targetValue`) in the
78
+ * unit a person typed: uidu keeps every one of them x100. For `percentage`
79
+ * that is percent points (45 = 45%), for `currency` whole units of
80
+ * `goal.currency`, for `checkbox` 1 or 0. `null` stays `null`.
81
+ */
82
+ export function goalValue(
83
+ goal: GoalMetric,
84
+ raw: number | null | undefined,
85
+ ): number | null {
86
+ if (raw == null) return null;
87
+ if (goal.metricKind === 'checkbox') return raw ? 1 : 0;
88
+ return raw / 100;
89
+ }
90
+
91
+ /** The inverse of `goalValue`, for `updateGoal`. */
92
+ export function toGoalRaw(value: number): number {
93
+ return Math.round(value * 100);
94
+ }
95
+
96
+ /**
97
+ * How far the goal is, 0 to 1 (above 1 when it overshoots). `goal.progress`
98
+ * itself is percent x100: 10000 is done.
99
+ */
100
+ export function goalProgress(goal: { progress?: number | null }): number {
101
+ return (goal.progress ?? 0) / 10_000;
102
+ }
103
+
104
+ /**
105
+ * How much of the goal's timeframe has passed, 0 to 1, or `null` when it has
106
+ * none. A goal whose `goalProgress` is below this is behind schedule.
107
+ */
108
+ export function goalTimeElapsed(
109
+ goal: {
110
+ timeframe?: {
111
+ startDate?: string | null;
112
+ endDate?: string | null;
113
+ } | null;
114
+ },
115
+ now: Date = new Date(),
116
+ ): number | null {
117
+ const start = goal.timeframe?.startDate;
118
+ const end = goal.timeframe?.endDate;
119
+ if (!start || !end) return null;
120
+ const from = Date.parse(start);
121
+ // endDate is the last day of the period: count it whole.
122
+ const to = Date.parse(end) + 24 * 60 * 60 * 1000;
123
+ if (!(to > from)) return null;
124
+ return Math.min(1, Math.max(0, (now.getTime() - from) / (to - from)));
125
+ }
126
+
127
+ /**
128
+ * Behind schedule: less done than time elapsed, by more than `tolerance`
129
+ * (0.1 = ten points). `false` for a goal with no timeframe or one already
130
+ * accomplished. The goal's own `status` (`off_track`, `needs_attention`) is
131
+ * its owner's judgement — show it next to this, don't replace one with the other.
132
+ */
133
+ export function isGoalBehind(
134
+ goal: Parameters<typeof goalTimeElapsed>[0] & {
135
+ progress?: number | null;
136
+ status?: string | null;
137
+ },
138
+ { now = new Date(), tolerance = 0 }: { now?: Date; tolerance?: number } = {},
139
+ ): boolean {
140
+ if (goal.status === 'accomplished') return false;
141
+ const elapsed = goalTimeElapsed(goal, now);
142
+ if (elapsed == null) return false;
143
+ return goalProgress(goal) + tolerance < elapsed;
144
+ }
package/src/index.ts CHANGED
@@ -25,11 +25,13 @@ export {
25
25
  ListEnrollmentsDocument,
26
26
  ListEventsDocument,
27
27
  ListFormsDocument,
28
+ ListGoalsDocument,
28
29
  ListKbArticlesDocument,
29
30
  ListKbCollectionsDocument,
30
31
  ListLecturesDocument,
31
32
  ListPagesDocument,
32
33
  ListStoriesDocument,
34
+ ListTimeframesDocument,
33
35
  } from './generated';
34
36
 
35
37
  export {
@@ -198,6 +200,18 @@ export type { Campaign } from './campaigns';
198
200
 
199
201
  export { getContact, listContacts, getDeal, listDeals } from './contacts';
200
202
  export type { Contact, Deal } from './contacts';
203
+ export {
204
+ listGoals,
205
+ getGoal,
206
+ listTimeframes,
207
+ updateGoal,
208
+ goalValue,
209
+ toGoalRaw,
210
+ goalProgress,
211
+ goalTimeElapsed,
212
+ isGoalBehind,
213
+ } from './goals';
214
+ export type { Goal, Timeframe } from './goals';
201
215
 
202
216
  export {
203
217
  getKbArticle,
@@ -0,0 +1,14 @@
1
+ query GetGoal($id: ID!) {
2
+ currentWorkspace {
3
+ goal(id: $id) {
4
+ ...GoalFields
5
+ subgoals {
6
+ edges {
7
+ node {
8
+ ...GoalFields
9
+ }
10
+ }
11
+ }
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,28 @@
1
+ # Only fields a custom app's session token may read (uidu's
2
+ # CustomApps::Scope::NATIVE_READS): asking for one outside that list — owner,
3
+ # members, logs — fails the whole query inside uidu.
4
+ fragment GoalFields on Goal {
5
+ id
6
+ name
7
+ description
8
+ kind
9
+ metricKind
10
+ status
11
+ currency
12
+ initialValue
13
+ currentValue
14
+ targetValue
15
+ progress
16
+ weight
17
+ updateFrequency
18
+ parentId
19
+ subgoalsCount
20
+ createdAt
21
+ updatedAt
22
+ timeframe {
23
+ id
24
+ name
25
+ startDate
26
+ endDate
27
+ }
28
+ }
@@ -0,0 +1,12 @@
1
+ mutation UpdateGoal($input: UpdateGoalInput!) {
2
+ updateGoal(input: $input) {
3
+ goal {
4
+ ...GoalFields
5
+ }
6
+ errors {
7
+ key
8
+ name
9
+ type
10
+ }
11
+ }
12
+ }