@uidu/cli 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -12,14 +12,9 @@ import fs from "fs";
12
12
  import os from "os";
13
13
  import path from "path";
14
14
 
15
- // ../client/src/client.ts
16
- import { ClientError, GraphQLClient } from "graphql-request";
17
-
18
- // ../client/src/types.ts
15
+ // ../client/dist/uidu-client.esm.js
16
+ import { GraphQLClient, ClientError } from "graphql-request";
19
17
  var UiduError = class extends Error {
20
- code;
21
- graphQLErrors;
22
- cause;
23
18
  constructor(opts) {
24
19
  super(opts.message);
25
20
  this.name = "UiduError";
@@ -28,24 +23,21 @@ var UiduError = class extends Error {
28
23
  this.cause = opts.cause;
29
24
  }
30
25
  };
31
-
32
- // ../client/src/client.ts
33
26
  var UiduClient = class {
34
- endpoint;
35
- client;
36
27
  constructor(config) {
37
28
  this.endpoint = config.endpoint ?? `https://${config.workspace}.uidu.org/graphql`;
38
- const headers = { ...config.headers ?? {} };
29
+ const headers = {
30
+ ...config.headers ?? {}
31
+ };
39
32
  if (config.publicToken) headers["X-Uidu-Public-Token"] = config.publicToken;
40
33
  if (config.apiKey) headers["Authorization"] = `Bearer ${config.apiKey}`;
41
- this.client = new GraphQLClient(this.endpoint, { headers });
34
+ this.client = new GraphQLClient(this.endpoint, {
35
+ headers
36
+ });
42
37
  }
43
38
  async query(document, variables) {
44
39
  try {
45
- return await this.client.request(
46
- document,
47
- variables ?? {}
48
- );
40
+ return await this.client.request(document, variables ?? {});
49
41
  } catch (err) {
50
42
  throw toUiduError(err);
51
43
  }
@@ -72,8 +64,6 @@ function toUiduError(err) {
72
64
  cause: err
73
65
  });
74
66
  }
75
-
76
- // ../client/src/generated/index.ts
77
67
  var GetBookingDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "GetBooking" }, "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": "booking" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "id" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "kind" } }, { "kind": "Field", "name": { "kind": "Name", "value": "status" } }, { "kind": "Field", "name": { "kind": "Name", "value": "number" } }, { "kind": "Field", "name": { "kind": "Name", "value": "currency" } }, { "kind": "Field", "name": { "kind": "Name", "value": "itemsCount" } }, { "kind": "Field", "name": { "kind": "Name", "value": "itemsTotal" } }, { "kind": "Field", "name": { "kind": "Name", "value": "paymentIntentId" } }, { "kind": "Field", "name": { "kind": "Name", "value": "createdAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "updatedAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "paidAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "refundedAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "expiredAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "willExpireAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "fieldValuesByShortname" } }, { "kind": "Field", "name": { "kind": "Name", "value": "contact" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "email" } }] } }] } }] } }] } }] };
78
68
  var ListBookingsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListBookings" }, "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" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "before" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } }, { "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "last" } }, "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "Int" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "currentWorkspace" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "bookings" }, "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" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "before" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "before" } } }, { "kind": "Argument", "name": { "kind": "Name", "value": "last" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "last" } } }], "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": "kind" } }, { "kind": "Field", "name": { "kind": "Name", "value": "status" } }, { "kind": "Field", "name": { "kind": "Name", "value": "number" } }, { "kind": "Field", "name": { "kind": "Name", "value": "currency" } }, { "kind": "Field", "name": { "kind": "Name", "value": "itemsCount" } }, { "kind": "Field", "name": { "kind": "Name", "value": "itemsTotal" } }, { "kind": "Field", "name": { "kind": "Name", "value": "createdAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "paidAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "expiredAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "willExpireAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "contact" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "email" } }] } }] } }] } }] } }] } }] } }] };
79
69
  var GetCallDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "GetCall" }, "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": "call" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "id" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "id" } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "body" } }, { "kind": "Field", "name": { "kind": "Name", "value": "cover" } }, { "kind": "Field", "name": { "kind": "Name", "value": "coverData" } }, { "kind": "Field", "name": { "kind": "Name", "value": "kind" } }, { "kind": "Field", "name": { "kind": "Name", "value": "status" } }, { "kind": "Field", "name": { "kind": "Name", "value": "quantity" } }, { "kind": "Field", "name": { "kind": "Name", "value": "salaryMin" } }, { "kind": "Field", "name": { "kind": "Name", "value": "salaryMax" } }, { "kind": "Field", "name": { "kind": "Name", "value": "publishedAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "expiresAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "completedAt" } }, { "kind": "Field", "name": { "kind": "Name", "value": "publicUrl" } }, { "kind": "Field", "name": { "kind": "Name", "value": "publicPath" } }, { "kind": "Field", "name": { "kind": "Name", "value": "primaryAddress" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "formattedAddress" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "city" } }, { "kind": "Field", "name": { "kind": "Name", "value": "countryCode" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "form" }, "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" } }] } }] } }] } }] } }] } }] } }] };
@@ -130,7 +120,15 @@ var ListKbCollectionsDocument = { "kind": "Document", "definitions": [{ "kind":
130
120
  var CreateNoteDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CreateNote" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "CreateNoteInput" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "createNote" }, "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": "note" }, "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" } }] } }] } }] } }] };
131
121
  var UpdateNoteDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "UpdateNote" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "UpdateNoteInput" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "updateNote" }, "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": "note" }, "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" } }] } }] } }] } }] };
132
122
  var DeleteNoteDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "DeleteNote" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "DeleteNoteInput" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "deleteNote" }, "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": "note" }, "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" } }] } }] } }] } }] };
123
+ var ListCirclesDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListCircles" }, "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": "circles" }, "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": "kind" } }] } }] } }] } }] } }] } }] };
133
124
  var ListEmployeesDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListEmployees" }, "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": "employees" }, "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": "employeeCode" } }, { "kind": "Field", "name": { "kind": "Name", "value": "user" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "firstName" } }, { "kind": "Field", "name": { "kind": "Name", "value": "lastName" } }, { "kind": "Field", "name": { "kind": "Name", "value": "email" } }] } }, { "kind": "Field", "name": { "kind": "Name", "value": "currentEmployment" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "jobTitle" } }, { "kind": "Field", "name": { "kind": "Name", "value": "contractType" } }, { "kind": "Field", "name": { "kind": "Name", "value": "isActive" } }, { "kind": "Field", "name": { "kind": "Name", "value": "startDate" } }] } }] } }] } }] } }] } }] } }] };
125
+ var ListKindsDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListKinds" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "models" } }, "type": { "kind": "NonNullType", "type": { "kind": "ListType", "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "String" } } } } } }, { "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": "kinds" }, "arguments": [{ "kind": "Argument", "name": { "kind": "Name", "value": "models" }, "value": { "kind": "Variable", "name": { "kind": "Name", "value": "models" } } }, { "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": "code" } }, { "kind": "Field", "name": { "kind": "Name", "value": "model" } }] } }] } }] } }] } }] } }] };
126
+ var ListOfficesDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "query", "name": { "kind": "Name", "value": "ListOffices" }, "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": "offices" }, "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" } }] } }] } }] } }] } }] } }] };
127
+ var CreateEmployeeDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CreateEmployee" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "CreateEmployeeInput" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "createEmployee" }, "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": "employee" }, "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": "employeeCode" } }, { "kind": "Field", "name": { "kind": "Name", "value": "user" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, { "kind": "Field", "name": { "kind": "Name", "value": "email" } }] } }] } }] } }, { "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" } }] } }] } }] } }] };
128
+ var UpdateEmployeeDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "UpdateEmployee" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "UpdateEmployeeInput" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "updateEmployee" }, "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": "employee" }, "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "id" } }, { "kind": "Field", "name": { "kind": "Name", "value": "employeeCode" } }] } }, { "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" } }] } }] } }] } }] };
129
+ 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": "contractType" } }, { "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" } }] } }] } }] } }] };
130
+ 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": "contractType" } }, { "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" } }] } }] } }] } }] };
131
+ 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" } }] } }] } }] } }] };
134
132
  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" } }] } }] } }] } }] };
135
133
  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" } }] } }] } }] } }] };
136
134
  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" } }] } }] } }] } }] };
@@ -143,14 +141,10 @@ var GenerateWorkspaceApiCredentialsDocument = { "kind": "Document", "definitions
143
141
  var CreateTaskDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "CreateTask" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "CreateTaskInput" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "createTask" }, "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": "task" }, "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" } }] } }] } }] } }] };
144
142
  var UpdateTaskDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "UpdateTask" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "UpdateTaskInput" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "updateTask" }, "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": "task" }, "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" } }] } }] } }] } }] };
145
143
  var DeleteTaskDocument = { "kind": "Document", "definitions": [{ "kind": "OperationDefinition", "operation": "mutation", "name": { "kind": "Name", "value": "DeleteTask" }, "variableDefinitions": [{ "kind": "VariableDefinition", "variable": { "kind": "Variable", "name": { "kind": "Name", "value": "input" } }, "type": { "kind": "NonNullType", "type": { "kind": "NamedType", "name": { "kind": "Name", "value": "DeleteTaskInput" } } } }], "selectionSet": { "kind": "SelectionSet", "selections": [{ "kind": "Field", "name": { "kind": "Name", "value": "deleteTask" }, "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": "task" }, "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" } }] } }] } }] } }] };
146
-
147
- // ../client/src/utils/relay.ts
148
144
  function nodes(connection) {
149
145
  if (!connection?.edges) return [];
150
146
  return connection.edges.flatMap((edge) => edge?.node ? [edge.node] : []);
151
147
  }
152
-
153
- // ../client/src/cms.ts
154
148
  async function getPage(client, variables) {
155
149
  const result = await client.query(GetPageDocument, variables);
156
150
  return result.currentWorkspace?.project?.page ?? null;
@@ -175,39 +169,26 @@ async function createFieldValue(client, variables) {
175
169
  const result = await client.mutate(CreateFieldValueDocument, variables);
176
170
  return result.createFieldValue ?? null;
177
171
  }
178
-
179
- // ../client/src/system.ts
180
172
  async function createWorkspace(client, variables) {
181
173
  const result = await client.mutate(CreateWorkspaceDocument, variables);
182
174
  return result.createWorkspace ?? null;
183
175
  }
184
176
  async function generateWorkspaceApiCredentials(client, variables) {
185
- const result = await client.mutate(
186
- GenerateWorkspaceApiCredentialsDocument,
187
- variables
188
- );
177
+ const result = await client.mutate(GenerateWorkspaceApiCredentialsDocument, variables);
189
178
  return result.generateWorkspaceApiCredentials ?? null;
190
179
  }
191
-
192
- // ../client/src/spaces.ts
193
180
  async function createSpace(client, variables) {
194
181
  const result = await client.mutate(CreateSpaceDocument, variables);
195
182
  return result.createSpace ?? null;
196
183
  }
197
-
198
- // ../client/src/tasks.ts
199
184
  async function createTask(client, variables) {
200
185
  const result = await client.mutate(CreateTaskDocument, variables);
201
186
  return result.createTask ?? null;
202
187
  }
203
-
204
- // ../client/src/notes.ts
205
188
  async function createNote(client, variables) {
206
189
  const result = await client.mutate(CreateNoteDocument, variables);
207
190
  return result.createNote ?? null;
208
191
  }
209
-
210
- // ../client/src/mutations.ts
211
192
  async function createCourse(c, v) {
212
193
  return (await c.mutate(CreateCourseDocument, v)).createCourse ?? null;
213
194
  }
@@ -238,6 +219,21 @@ async function createDeal(c, v) {
238
219
  async function updateDeal(c, v) {
239
220
  return (await c.mutate(UpdateDealDocument, v)).updateDeal ?? null;
240
221
  }
222
+ async function createEmployee(c, v) {
223
+ return (await c.mutate(CreateEmployeeDocument, v)).createEmployee ?? null;
224
+ }
225
+ async function updateEmployee(c, v) {
226
+ return (await c.mutate(UpdateEmployeeDocument, v)).updateEmployee ?? null;
227
+ }
228
+ async function createEmployment(c, v) {
229
+ return (await c.mutate(CreateEmploymentDocument, v)).createEmployment ?? null;
230
+ }
231
+ async function updateEmployment(c, v) {
232
+ return (await c.mutate(UpdateEmploymentDocument, v)).updateEmployment ?? null;
233
+ }
234
+ async function deleteEmployment(c, v) {
235
+ return (await c.mutate(DeleteEmploymentDocument, v)).deleteEmployment ?? null;
236
+ }
241
237
  async function createKbCollection(c, v) {
242
238
  return (await c.mutate(CreateKbCollectionDocument, v)).createKbCollection ?? null;
243
239
  }
@@ -295,8 +291,6 @@ async function updateSpace(c, v) {
295
291
  async function deleteSpace(c, v) {
296
292
  return (await c.mutate(DeleteSpaceDocument, v)).deleteSpace ?? null;
297
293
  }
298
-
299
- // ../client/src/forms.ts
300
294
  async function getForm(client, variables) {
301
295
  const result = await client.query(GetFormDocument, variables);
302
296
  return result.currentWorkspace?.form ?? null;
@@ -305,14 +299,10 @@ async function listForms(client, variables = {}) {
305
299
  const result = await client.query(ListFormsDocument, variables);
306
300
  return nodes(result.currentWorkspace?.forms);
307
301
  }
308
-
309
- // ../client/src/help-center.ts
310
302
  async function getChannel(client, variables) {
311
303
  const result = await client.query(GetChannelDocument, variables);
312
304
  return result.currentWorkspace?.channel ?? null;
313
305
  }
314
-
315
- // ../client/src/events.ts
316
306
  async function getEvent(client, variables) {
317
307
  const result = await client.query(GetEventDocument, variables);
318
308
  return result.currentWorkspace?.event ?? null;
@@ -325,8 +315,6 @@ async function createEvent(client, variables) {
325
315
  const result = await client.mutate(CreateEventDocument, variables);
326
316
  return result.createEvent ?? null;
327
317
  }
328
-
329
- // ../client/src/calls.ts
330
318
  async function getCall(client, variables) {
331
319
  const result = await client.query(GetCallDocument, variables);
332
320
  return result.currentWorkspace?.call ?? null;
@@ -335,8 +323,6 @@ async function listCalls(client, variables = {}) {
335
323
  const result = await client.query(ListCallsDocument, variables);
336
324
  return nodes(result.currentWorkspace?.calls);
337
325
  }
338
-
339
- // ../client/src/donations.ts
340
326
  async function getDonationCampaign(client, variables) {
341
327
  const result = await client.query(GetDonationCampaignDocument, variables);
342
328
  return result.currentWorkspace?.donationCampaign ?? null;
@@ -349,8 +335,6 @@ async function createDonationCampaign(client, variables) {
349
335
  const result = await client.mutate(CreateDonationCampaignDocument, variables);
350
336
  return result.createDonationCampaign ?? null;
351
337
  }
352
-
353
- // ../client/src/stories.ts
354
338
  async function getStory(client, variables) {
355
339
  const result = await client.query(GetStoryDocument, variables);
356
340
  return result.currentWorkspace?.story ?? null;
@@ -363,14 +347,32 @@ async function createStory(client, variables) {
363
347
  const result = await client.mutate(CreateStoryDocument, variables);
364
348
  return result.createStory ?? null;
365
349
  }
366
-
367
- // ../client/src/people.ts
368
350
  async function listEmployees(client, variables = {}) {
369
351
  const result = await client.query(ListEmployeesDocument, variables);
370
352
  return nodes(result.currentWorkspace?.employees);
371
353
  }
372
-
373
- // ../client/src/bookings.ts
354
+ async function listOffices(client, variables = {}) {
355
+ const result = await client.query(ListOfficesDocument, variables);
356
+ return nodes(result.currentWorkspace?.offices);
357
+ }
358
+ async function listCircles(client, variables = {}) {
359
+ const result = await client.query(ListCirclesDocument, variables);
360
+ return nodes(result.currentWorkspace?.circles);
361
+ }
362
+ async function listRoles(client, variables = {}) {
363
+ const circles = await listCircles(client, variables);
364
+ return circles.filter((c) => c.kind === "role");
365
+ }
366
+ async function listKinds(client, variables) {
367
+ const result = await client.query(ListKindsDocument, variables);
368
+ return nodes(result.currentWorkspace?.kinds);
369
+ }
370
+ async function listCcnls(client, variables = {}) {
371
+ return listKinds(client, {
372
+ ...variables,
373
+ models: ["Ccnl"]
374
+ });
375
+ }
374
376
  async function getBooking(client, variables) {
375
377
  const result = await client.query(GetBookingDocument, variables);
376
378
  return result.currentWorkspace?.booking ?? null;
@@ -379,8 +381,6 @@ async function listBookings(client, variables = {}) {
379
381
  const result = await client.query(ListBookingsDocument, variables);
380
382
  return nodes(result.currentWorkspace?.bookings);
381
383
  }
382
-
383
- // ../client/src/courses.ts
384
384
  async function getCourse(client, variables) {
385
385
  const result = await client.query(GetCourseDocument, variables);
386
386
  return result.currentWorkspace?.course ?? null;
@@ -389,8 +389,6 @@ async function listCourses(client, variables = {}) {
389
389
  const result = await client.query(ListCoursesDocument, variables);
390
390
  return nodes(result.currentWorkspace?.courses);
391
391
  }
392
-
393
- // ../client/src/campaigns.ts
394
392
  async function getCampaign(client, variables) {
395
393
  const result = await client.query(GetCampaignDocument, variables);
396
394
  return result.currentWorkspace?.campaign ?? null;
@@ -399,8 +397,6 @@ async function listCampaigns(client, variables = {}) {
399
397
  const result = await client.query(ListCampaignsDocument, variables);
400
398
  return nodes(result.currentWorkspace?.campaigns);
401
399
  }
402
-
403
- // ../client/src/contacts.ts
404
400
  async function getContact(client, variables) {
405
401
  const result = await client.query(GetContactDocument, variables);
406
402
  return result.currentWorkspace?.contact ?? null;
@@ -417,8 +413,6 @@ async function listDeals(client, variables = {}) {
417
413
  const result = await client.query(ListDealsDocument, variables);
418
414
  return nodes(result.currentWorkspace?.deals);
419
415
  }
420
-
421
- // ../client/src/kb.ts
422
416
  async function getKbArticle(client, variables) {
423
417
  const result = await client.query(GetKbArticleDocument, variables);
424
418
  return result.currentWorkspace?.kbArticle ?? null;
@@ -949,7 +943,26 @@ var RESOURCES = {
949
943
  update: (c, id, a) => updateDeal(c, updateVars(id, a))
950
944
  },
951
945
  employees: {
952
- list: (c, first) => listEmployees(c, { first })
946
+ list: (c, first) => listEmployees(c, { first }),
947
+ create: (c, a) => createEmployee(c, createVars(a)),
948
+ update: (c, id, a) => updateEmployee(c, updateVars(id, a))
949
+ },
950
+ // Contracts. A hire = `employment create`; a variation = `employment update`;
951
+ // a termination = `employment update` with endDate + endReason.
952
+ employments: {
953
+ create: (c, a) => createEmployment(c, createVars(a)),
954
+ update: (c, id, a) => updateEmployment(c, updateVars(id, a)),
955
+ delete: (c, id) => deleteEmployment(c, deleteVars(id))
956
+ },
957
+ // Reference data for building employment attributes.
958
+ offices: {
959
+ list: (c, first) => listOffices(c, { first })
960
+ },
961
+ roles: {
962
+ list: (c, first) => listRoles(c, { first })
963
+ },
964
+ ccnls: {
965
+ list: (c, first) => listCcnls(c, { first })
953
966
  },
954
967
  bookings: {
955
968
  list: (c, first) => listBookings(c, { first }),
@@ -1093,10 +1106,15 @@ ${pc2.bold("CMS")} ${pc2.dim("(pages need --project <id>)")}
1093
1106
 
1094
1107
  ${pc2.bold("Entities")} ${pc2.dim("<entity> list | get <id> | create | update <id> | delete <id>")}
1095
1108
  ${pc2.dim("events, stories, donations, courses, forms, contacts, deals, employees,")}
1096
- ${pc2.dim("bookings, calls, campaigns, kb-collections, kb-articles, channel,")}
1097
- ${pc2.dim("tasks, notes, spaces (write-only)")}
1109
+ ${pc2.dim("employments, offices, roles, ccnls, bookings, calls, campaigns,")}
1110
+ ${pc2.dim("kb-collections, kb-articles, channel, tasks, notes, spaces (write-only)")}
1098
1111
  ${pc2.dim("writes need a Bearer token \xB7 --attributes <json> / --name / --slug \xB7 --first <n> for lists")}
1099
1112
 
1113
+ ${pc2.bold("HR")} ${pc2.dim("(hires / terminations / contract variations)")}
1114
+ ${pc2.dim(`employment create --attributes '{"employeeId","startDate","contractType","jobTitle",\u2026}' (assunzione)`)}
1115
+ ${pc2.dim(`employment update <id> --attributes '{"jobTitle",\u2026}' (variazione)`)}
1116
+ ${pc2.dim(`employment update <id> --attributes '{"endDate","endReason"}' (cessazione)`)}
1117
+
1100
1118
  ${pc2.bold("Provisioning")} ${pc2.dim("(Bearer / UIDU_API_KEY)")}
1101
1119
  workspace create Create a workspace ${pc2.dim("--name | --attributes <json>")}
1102
1120
  workspace credentials Generate workspace API credentials
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uidu/cli",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
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",
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@clack/prompts": "^0.11.0",
22
- "@uidu/client": "3.1.1",
22
+ "@uidu/client": "^3.2.0",
23
23
  "graphql": "^16.14.0",
24
24
  "graphql-request": "^7.4.0",
25
25
  "mri": "^1.2.0",
@@ -36,4 +36,4 @@
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  }
39
- }
39
+ }
package/CHANGELOG.md DELETED
@@ -1,24 +0,0 @@
1
- # @uidu/cli
2
-
3
- ## 0.1.1
4
-
5
- ### Patch Changes
6
-
7
- - Updated dependencies [22d268a]
8
- - @uidu/client@3.1.1
9
-
10
- ## 0.1.0
11
-
12
- ### Minor Changes
13
-
14
- - 8c8d021: Introduce `@uidu/cli` and a full authoring surface — the uidu SDK is now driveable as an AI connector.
15
- - **`@uidu/cli`** (`uidu`): read a workspace, scaffold an app, and provision content from the terminal or an AI coding agent. `uidu login` (OAuth Authorization Code + PKCE browser flow, with a password-grant fallback for CI/agents); uniform entity verbs `list | get | create | update | delete`; CMS + workspace provisioning; `uidu create` scaffolding; `--json` output throughout.
16
- - **`@uidu/client`**: add authoring mutations (`create` / `update` / `delete`) across events, stories, donations, courses, forms, contacts, deals, kb-collections, kb-articles, channel, tasks, notes, spaces, plus CMS (page/block/field) and workspace/project provisioning + `generateWorkspaceApiCredentials`. Reads use the public token (browser-safe); writes require the account Bearer (server-side / CLI only).
17
- - **`@uidu/skills`**: the `uidu` skill now covers the CLI and the read-vs-write authoring model, not just SDK reads.
18
- - **`@uidu/react`**: order the `types` condition before `default` in package `exports` (removes a dead-condition warning).
19
- - **`create-uidu-app`**: bump templates off the `3.0.0-alpha.0` pin to `^3.0.0`.
20
-
21
- ### Patch Changes
22
-
23
- - Updated dependencies [8c8d021]
24
- - @uidu/client@3.1.0