@uidu/cli 0.4.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.
Files changed (2) hide show
  1. package/dist/index.js +121 -6
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -94,7 +94,14 @@ function normalizeMutationVariables(variables) {
94
94
  }
95
95
  var UiduClient = class {
96
96
  constructor(config) {
97
+ if (!config.endpoint && !config.workspace) {
98
+ throw new UiduError({
99
+ code: "CONFIG_ERROR",
100
+ message: "createClient needs a `workspace` or an `endpoint`"
101
+ });
102
+ }
97
103
  this.endpoint = config.endpoint ?? `https://${config.workspace}.uidu.org/graphql`;
104
+ this.getToken = config.getToken;
98
105
  const headers = {
99
106
  ...config.headers ?? {}
100
107
  };
@@ -105,12 +112,27 @@ var UiduClient = class {
105
112
  });
106
113
  }
107
114
  async query(document, variables) {
115
+ const vars = variables ?? {};
116
+ const headers = this.getToken ? {
117
+ Authorization: `Bearer ${await this.tokenFor()}`
118
+ } : void 0;
108
119
  try {
109
- return await this.client.request(document, variables ?? {});
120
+ return await this.client.request(document, vars, headers);
110
121
  } catch (err) {
111
122
  throw toUiduError(err);
112
123
  }
113
124
  }
125
+ async tokenFor() {
126
+ try {
127
+ return await this.getToken();
128
+ } catch (err) {
129
+ throw new UiduError({
130
+ code: "TOKEN_ERROR",
131
+ message: err instanceof Error ? err.message : "Could not get a token",
132
+ cause: err
133
+ });
134
+ }
135
+ }
114
136
  mutate(document, variables) {
115
137
  return this.query(document, normalizeMutationVariables(variables));
116
138
  }
@@ -139,6 +161,7 @@ var CallKind = /* @__PURE__ */ (function(CallKind2) {
139
161
  CallKind2["Opportunity"] = "opportunity";
140
162
  return CallKind2;
141
163
  })({});
164
+ var ExecuteActionDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "ExecuteAction" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "ExecuteActionInput" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "executeAction" }, "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": "result" } }, { "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" } }] } }] } }] } }] };
142
165
  var CreateApplicationDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CreateApplication" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "CreateApplicationInput" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "createApplication" }, "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": "application" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "aasmState" } }, { "kind": "Field", "name": { "kind": "Name", "value": "summary" } }, { "kind": "Field", "name": { "kind": "Name", "value": "completedAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "createdAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "contact" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "humanName" } }, { "kind": "Field", "name": { "kind": "Name", "value": "email" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "applicable" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "__typename" } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "Call" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "kind" } }] } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "formResponse" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }] } }] } }] } }] } }] };
143
166
  var ListApplicationsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListApplications" }, "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": "applications" }, "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": "aasmState" } }, { "kind": "Field", "name": { "kind": "Name", "value": "summary" } }, { "kind": "Field", "name": { "kind": "Name", "value": "completedAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "createdAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "status" }, "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": "contact" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "humanName" } }, { "kind": "Field", "name": { "kind": "Name", "value": "email" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "applicable" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "__typename" } }, { "kind": "InlineFragment", "typeCondition": { "kind": "NamedType", "name": { "kind": "Name", "value": "Call" } }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "kind" } }] } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "formResponse" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }] } }] } }] } }] } }] } }] } }] };
144
167
  var CreateBenefitEnrollmentDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CreateBenefitEnrollment" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "CreateBenefitEnrollmentInput" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "createBenefitEnrollment" }, "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": "benefitEnrollment" }, "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": "humanName" } }, { "kind": "Field", "name": { "kind": "Name", "value": "enrolledAt" } }] } }] } }, { "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" } }] } }] } }] } }] };
@@ -184,6 +207,10 @@ var UpdateFormDocument = { "kind": "Document", "definitions": [{ "kind": "Operat
184
207
  var DeleteFormDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "DeleteForm" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "DeleteFormInput" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "deleteForm" }, "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": "form" }, "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" } }] } }] } }] } }] };
185
208
  var 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" } }] } }] } }] } }] } }] } }] } }] };
186
209
  var 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" } }] } }] } }] } }] } }] } }] };
210
+ var 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" } }] } }] } }] };
211
+ var 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" } }] } }] } }] };
212
+ var 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" } }] } }] } }] };
213
+ var 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" } }] } }] } }] } }] } }] } }] };
187
214
  var 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" } }] } }] } }] } }] };
188
215
  var 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" } }] } }] } }] } }] };
189
216
  var 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" } }] } }] } }] } }] };
@@ -215,6 +242,8 @@ var UpdateEmployeeDocument = { "kind": "Document", "definitions": [{ "kind": "Op
215
242
  var CreateEmploymentDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CreateEmployment" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "CreateEmploymentInput" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "createEmployment" }, "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": "employment" }, "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": "jobTitle" } }, { "kind": "Field", "name": { "kind": "Name", "value": "employmentKind" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "classification" } }, { "kind": "Field", "name": { "kind": "Name", "value": "startDate" } }, { "kind": "Field", "name": { "kind": "Name", "value": "endDate" } }, { "kind": "Field", "name": { "kind": "Name", "value": "isActive" } }] } }] } }, { "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" } }] } }] } }] } }] };
216
243
  var UpdateEmploymentDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "UpdateEmployment" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "UpdateEmploymentInput" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "updateEmployment" }, "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": "employment" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "jobTitle" } }, { "kind": "Field", "name": { "kind": "Name", "value": "employmentKind" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "classification" } }, { "kind": "Field", "name": { "kind": "Name", "value": "startDate" } }, { "kind": "Field", "name": { "kind": "Name", "value": "endDate" } }, { "kind": "Field", "name": { "kind": "Name", "value": "endReason" } }, { "kind": "Field", "name": { "kind": "Name", "value": "isActive" } }] } }, { "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" } }] } }] } }] } }] };
217
244
  var DeleteEmploymentDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "DeleteEmployment" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "DeleteEmploymentInput" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "deleteEmployment" }, "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": "employment" }, "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" } }] } }] } }] } }] };
245
+ var CreateTimeClockDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CreateTimeClock" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "CreateTimeClockInput" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "createTimeClock" }, "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": "timeClock" }, "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": "beginsAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "finishesAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "kind" } }] } }] } }, { "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" } }] } }] } }] } }] };
246
+ var CreateSiteDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CreateSite" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "CreateSiteInput" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "createSite" }, "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": "site" }, "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": "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" } }] } }] } }] } }] };
218
247
  var CreateSpaceDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CreateSpace" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "CreateSpaceInput" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "createSpace" }, "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": "space" }, "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": "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" } }] } }] } }] } }] };
219
248
  var UpdateSpaceDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "UpdateSpace" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "UpdateSpaceInput" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "updateSpace" }, "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": "space" }, "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" } }] } }] } }] } }] };
220
249
  var DeleteSpaceDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "DeleteSpace" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "DeleteSpaceInput" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "deleteSpace" }, "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": "space" }, "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" } }] } }] } }] } }] };
@@ -259,6 +288,10 @@ async function listProjects(client, variables = {}) {
259
288
  const result = await client.query(ListProjectsDocument, variables);
260
289
  return nodes(result.currentWorkspace?.projects);
261
290
  }
291
+ async function createSite(client, variables) {
292
+ const result = await client.mutate(CreateSiteDocument, variables);
293
+ return result.createSite ?? null;
294
+ }
262
295
  async function createWorkspace(client, variables) {
263
296
  const result = await client.mutate(CreateWorkspaceDocument, variables);
264
297
  return result.createWorkspace ?? null;
@@ -279,6 +312,10 @@ async function createNote(client, variables) {
279
312
  const result = await client.mutate(CreateNoteDocument, variables);
280
313
  return result.createNote ?? null;
281
314
  }
315
+ async function executeAction(client, variables) {
316
+ const result = await client.mutate(ExecuteActionDocument, variables);
317
+ return result.executeAction ?? null;
318
+ }
282
319
  async function createBenefit(client, variables) {
283
320
  const result = await client.mutate(CreateBenefitDocument, variables);
284
321
  return result.createBenefit ?? null;
@@ -332,6 +369,9 @@ async function updateEmployment(c, v) {
332
369
  async function deleteEmployment(c, v) {
333
370
  return (await c.mutate(DeleteEmploymentDocument, v)).deleteEmployment ?? null;
334
371
  }
372
+ async function createTimeClock(c, v) {
373
+ return (await c.mutate(CreateTimeClockDocument, v)).createTimeClock ?? null;
374
+ }
335
375
  async function createCompensation(c, v) {
336
376
  return (await c.mutate(CreateCompensationDocument, v)).createCompensation ?? null;
337
377
  }
@@ -549,6 +589,22 @@ async function listDeals(client, variables = {}) {
549
589
  const result = await client.query(ListDealsDocument, variables);
550
590
  return nodes(result.currentWorkspace?.deals);
551
591
  }
592
+ async function listGoals(client, variables = {}) {
593
+ const result = await client.query(ListGoalsDocument, variables);
594
+ return nodes(result.currentWorkspace?.goals);
595
+ }
596
+ async function getGoal(client, variables) {
597
+ const result = await client.query(GetGoalDocument, variables);
598
+ return result.currentWorkspace?.goal ?? null;
599
+ }
600
+ async function listTimeframes(client, variables = {}) {
601
+ const result = await client.query(ListTimeframesDocument, variables);
602
+ return nodes(result.currentWorkspace?.timeframes);
603
+ }
604
+ async function updateGoal(client, variables) {
605
+ const result = await client.mutate(UpdateGoalDocument, variables);
606
+ return result.updateGoal ?? null;
607
+ }
552
608
  async function getKbArticle(client, variables) {
553
609
  const result = await client.query(GetKbArticleDocument, variables);
554
610
  return result.currentWorkspace?.kbArticle ?? null;
@@ -1022,6 +1078,38 @@ function buildReadContext(overrides, opts) {
1022
1078
  };
1023
1079
  }
1024
1080
 
1081
+ // src/commands/tools.ts
1082
+ function buildToolsContext(overrides, opts) {
1083
+ return { auth: resolveAuth(overrides), json: opts.json };
1084
+ }
1085
+ function requireBearer2(ctx) {
1086
+ if (!ctx.auth.apiKey) {
1087
+ fail(
1088
+ "tools call requires a Bearer token. Run `uidu login` or set UIDU_API_KEY.",
1089
+ ctx
1090
+ );
1091
+ }
1092
+ }
1093
+ async function toolsCall(ctx, key, attributesJson) {
1094
+ if (!key) fail("Usage: uidu tools call <key> --attributes <json>", ctx);
1095
+ requireBearer2(ctx);
1096
+ let attributes = {};
1097
+ if (attributesJson) {
1098
+ try {
1099
+ attributes = JSON.parse(attributesJson);
1100
+ } catch {
1101
+ fail("--attributes must be valid JSON.", ctx);
1102
+ }
1103
+ }
1104
+ const client = makeClient(ctx.auth);
1105
+ const payload = await executeAction(client, { input: { key, attributes } });
1106
+ const errors = payload?.errors ?? [];
1107
+ if (errors.length > 0) {
1108
+ fail(`Action returned errors: ${JSON.stringify(errors)}`, ctx);
1109
+ }
1110
+ emit(payload, ctx);
1111
+ }
1112
+
1025
1113
  // src/resources.ts
1026
1114
  function createVars(attributes) {
1027
1115
  return { input: { attributes } };
@@ -1082,6 +1170,14 @@ var RESOURCES = {
1082
1170
  create: (c, a) => createDeal(c, createVars(a)),
1083
1171
  update: (c, id, a) => updateDeal(c, updateVars(id, a))
1084
1172
  },
1173
+ goals: {
1174
+ list: (c, first) => listGoals(c, { first }),
1175
+ get: (c, id) => getGoal(c, { id }),
1176
+ update: (c, id, a) => updateGoal(c, updateVars(id, a))
1177
+ },
1178
+ timeframes: {
1179
+ list: (c, first) => listTimeframes(c, { first })
1180
+ },
1085
1181
  employees: {
1086
1182
  list: (c, first) => listEmployees(c, { first }),
1087
1183
  create: (c, a) => createEmployee(c, createVars(a)),
@@ -1152,6 +1248,10 @@ var RESOURCES = {
1152
1248
  update: (c, id, a) => updateChannel(c, updateVars(id, a)),
1153
1249
  delete: (c, id) => deleteChannel(c, deleteVars(id))
1154
1250
  },
1251
+ // Punches. Write-only (no list/get in the client yet).
1252
+ "time-clocks": {
1253
+ create: (c, a) => createTimeClock(c, createVars(a))
1254
+ },
1155
1255
  // Pay items on an employment contract.
1156
1256
  compensations: {
1157
1257
  create: (c, a) => createCompensation(c, createVars(a)),
@@ -1181,6 +1281,12 @@ var RESOURCES = {
1181
1281
  projects: {
1182
1282
  list: (c, first) => listProjects(c, { first })
1183
1283
  },
1284
+ // The new CMS. Write-only here: reads (`getSiteByDomain`, `getSite`,
1285
+ // `listSitePages`, ...) take a domain/siteId shape the generic list/get
1286
+ // verbs don't fit.
1287
+ sites: {
1288
+ create: (c, a) => createSite(c, createVars(a))
1289
+ },
1184
1290
  spaces: {
1185
1291
  create: (c, a) => createSpace(c, createVars(a)),
1186
1292
  update: (c, id, a) => updateSpace(c, updateVars(id, a)),
@@ -1190,7 +1296,7 @@ var RESOURCES = {
1190
1296
  function isResource(name) {
1191
1297
  return Object.prototype.hasOwnProperty.call(RESOURCES, name);
1192
1298
  }
1193
- function requireBearer2(auth, opts) {
1299
+ function requireBearer3(auth, opts) {
1194
1300
  if (!auth.apiKey) {
1195
1301
  fail(
1196
1302
  "Authoring requires a Bearer token. Run `uidu login` or set UIDU_API_KEY.",
@@ -1226,7 +1332,7 @@ async function runResource(name, action, rest, input) {
1226
1332
  }
1227
1333
  case "create": {
1228
1334
  if (!res.create) fail(`\`${name}\` does not support create.`, opts);
1229
- requireBearer2(auth, opts);
1335
+ requireBearer3(auth, opts);
1230
1336
  const payload = await res.create(client, input.attributes);
1231
1337
  checkErrors2(payload, opts);
1232
1338
  emit(payload, opts);
@@ -1236,7 +1342,7 @@ async function runResource(name, action, rest, input) {
1236
1342
  const id = rest[0];
1237
1343
  if (!id) fail(`Usage: uidu ${name} update <id> --attributes '<json>'`, opts);
1238
1344
  if (!res.update) fail(`\`${name}\` does not support update.`, opts);
1239
- requireBearer2(auth, opts);
1345
+ requireBearer3(auth, opts);
1240
1346
  const payload = await res.update(client, id, input.attributes);
1241
1347
  checkErrors2(payload, opts);
1242
1348
  emit(payload, opts);
@@ -1246,7 +1352,7 @@ async function runResource(name, action, rest, input) {
1246
1352
  const id = rest[0];
1247
1353
  if (!id) fail(`Usage: uidu ${name} delete <id>`, opts);
1248
1354
  if (!res.delete) fail(`\`${name}\` does not support delete.`, opts);
1249
- requireBearer2(auth, opts);
1355
+ requireBearer3(auth, opts);
1250
1356
  const payload = await res.delete(client, id);
1251
1357
  checkErrors2(payload, opts);
1252
1358
  emit(payload, opts);
@@ -1282,7 +1388,8 @@ ${pc2.bold("Entities")} ${pc2.dim("<entity> list | get <id> | create | update <i
1282
1388
  ${pc2.dim("events, stories, donations, courses, forms, contacts, deals, employees,")}
1283
1389
  ${pc2.dim("employments, offices, roles, ccnls, bookings, calls, jobs, applications,")}
1284
1390
  ${pc2.dim("campaigns, kb-collections, kb-articles, channel, tasks, notes, spaces,")}
1285
- ${pc2.dim("attendances, projects, compensations, benefits, benefit-enrollments")}
1391
+ ${pc2.dim("attendances, projects, sites, compensations, benefits, benefit-enrollments,")}
1392
+ ${pc2.dim("time-clocks")}
1286
1393
  ${pc2.dim("writes need a Bearer token \xB7 --attributes <json> / --name / --slug \xB7 --first <n> for lists")}
1287
1394
 
1288
1395
  ${pc2.bold("HR")} ${pc2.dim("(hires / terminations / contract variations)")}
@@ -1295,6 +1402,9 @@ ${pc2.bold("Provisioning")} ${pc2.dim("(Bearer / UIDU_API_KEY)")}
1295
1402
  workspace credentials Generate workspace API credentials
1296
1403
  project create Create a project ${pc2.dim("--attributes <json>")}
1297
1404
 
1405
+ ${pc2.bold("Tools")} ${pc2.dim("(Bearer \u2014 generic ActionKey dispatch, any tool-flagged concept)")}
1406
+ tools call <key> Run one action ${pc2.dim("--attributes <json>, associations as GlobalIDs")}
1407
+
1298
1408
  ${pc2.bold("Scaffold")}
1299
1409
  create [name] [...] Scaffold a new app (delegates to create-uidu-app)
1300
1410
 
@@ -1357,6 +1467,7 @@ async function main() {
1357
1467
  slug: argv.slug
1358
1468
  };
1359
1469
  const authoringCtx = () => buildAuthoringContext(authOverrides, opts);
1470
+ const toolsCtx = () => buildToolsContext(authOverrides, opts);
1360
1471
  const resourceAttributes = (() => {
1361
1472
  let a = {};
1362
1473
  if (typeof argv.attributes === "string") {
@@ -1414,6 +1525,10 @@ async function main() {
1414
1525
  if (action === "create")
1415
1526
  return await projectCreate(authoringCtx(), authoringArgs);
1416
1527
  return unknown(`project ${action ?? ""}`.trim(), opts);
1528
+ case "tools":
1529
+ if (action === "call")
1530
+ return await toolsCall(toolsCtx(), rest[0], argv.attributes);
1531
+ return unknown(`tools ${action ?? ""}`.trim(), opts);
1417
1532
  case "create": {
1418
1533
  const passthrough = [action, ...rest].filter(Boolean);
1419
1534
  const code = await create(passthrough, opts);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uidu/cli",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "The uidu CLI — read, scaffold, and (soon) provision uidu apps. Designed to be driven by humans and AI coding agents alike.",
5
5
  "license": "MIT",
6
6
  "author": "uidu",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@clack/prompts": "^0.11.0",
23
- "@uidu/client": "^3.9.0",
23
+ "@uidu/client": "^3.13.0",
24
24
  "graphql": "^16.14.0",
25
25
  "graphql-request": "^7.4.0",
26
26
  "mri": "^1.2.0",