@uidu/client 3.9.0 → 3.10.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.
@@ -0,0 +1,173 @@
1
+ # The mutations a custom app session token may call (CustomApps::Scope in the
2
+ # uidu repo). Schema writes (models, fields, options) are interim: step 3 of
3
+ # the custom apps spec moves them to an install-time manifest.
4
+
5
+ mutation CreateModel($input: CreateModelInput!) {
6
+ createModel(input: $input) {
7
+ model {
8
+ ...ModelSchema
9
+ }
10
+ errors {
11
+ key
12
+ name
13
+ type
14
+ }
15
+ }
16
+ }
17
+
18
+ mutation UpdateModel($input: UpdateModelInput!) {
19
+ updateModel(input: $input) {
20
+ model {
21
+ ...ModelSchema
22
+ }
23
+ errors {
24
+ key
25
+ name
26
+ type
27
+ }
28
+ }
29
+ }
30
+
31
+ mutation CreateField($input: CreateFieldInput!) {
32
+ createField(input: $input) {
33
+ field {
34
+ ...ModelField
35
+ }
36
+ errors {
37
+ key
38
+ name
39
+ type
40
+ }
41
+ }
42
+ }
43
+
44
+ mutation UpdateField($input: UpdateFieldInput!) {
45
+ updateField(input: $input) {
46
+ field {
47
+ ...ModelField
48
+ }
49
+ errors {
50
+ key
51
+ name
52
+ type
53
+ }
54
+ }
55
+ }
56
+
57
+ mutation DeleteField($input: DeleteFieldInput!) {
58
+ deleteField(input: $input) {
59
+ field {
60
+ id
61
+ }
62
+ errors {
63
+ key
64
+ name
65
+ type
66
+ }
67
+ }
68
+ }
69
+
70
+ mutation CreateFieldOption($input: CreateFieldOptionInput!) {
71
+ createFieldOption(input: $input) {
72
+ fieldOption {
73
+ ...ModelFieldOption
74
+ }
75
+ errors {
76
+ key
77
+ name
78
+ type
79
+ }
80
+ }
81
+ }
82
+
83
+ mutation UpdateFieldOption($input: UpdateFieldOptionInput!) {
84
+ updateFieldOption(input: $input) {
85
+ fieldOption {
86
+ ...ModelFieldOption
87
+ }
88
+ errors {
89
+ key
90
+ name
91
+ type
92
+ }
93
+ }
94
+ }
95
+
96
+ mutation DeleteFieldOption($input: DeleteFieldOptionInput!) {
97
+ deleteFieldOption(input: $input) {
98
+ fieldOption {
99
+ id
100
+ }
101
+ errors {
102
+ key
103
+ name
104
+ type
105
+ }
106
+ }
107
+ }
108
+
109
+ mutation CreateModelItem($input: CreateModelItemInput!) {
110
+ createModelItem(input: $input) {
111
+ modelItem {
112
+ ...ModelItemFields
113
+ }
114
+ errors {
115
+ key
116
+ name
117
+ type
118
+ }
119
+ }
120
+ }
121
+
122
+ mutation UpdateModelItem($input: UpdateModelItemInput!) {
123
+ updateModelItem(input: $input) {
124
+ modelItem {
125
+ ...ModelItemFields
126
+ }
127
+ errors {
128
+ key
129
+ name
130
+ type
131
+ }
132
+ }
133
+ }
134
+
135
+ mutation DeleteModelItem($input: DeleteModelItemInput!) {
136
+ deleteModelItem(input: $input) {
137
+ modelItem {
138
+ id
139
+ }
140
+ errors {
141
+ key
142
+ name
143
+ type
144
+ }
145
+ }
146
+ }
147
+
148
+ mutation UpdateFieldValue($input: UpdateFieldValueInput!) {
149
+ updateFieldValue(input: $input) {
150
+ fieldValue {
151
+ id
152
+ content
153
+ }
154
+ errors {
155
+ key
156
+ name
157
+ type
158
+ }
159
+ }
160
+ }
161
+
162
+ mutation DeleteFieldValue($input: DeleteFieldValueInput!) {
163
+ deleteFieldValue(input: $input) {
164
+ fieldValue {
165
+ id
166
+ }
167
+ errors {
168
+ key
169
+ name
170
+ type
171
+ }
172
+ }
173
+ }
@@ -0,0 +1,44 @@
1
+ query ListAppModels($workspaceAppId: ID!) {
2
+ node(id: $workspaceAppId) {
3
+ __typename
4
+ ... on WorkspaceApp {
5
+ id
6
+ modelList {
7
+ ...ModelSchema
8
+ }
9
+ }
10
+ }
11
+ }
12
+
13
+ query GetModel($id: ID!) {
14
+ node(id: $id) {
15
+ __typename
16
+ ... on Model {
17
+ ...ModelSchema
18
+ }
19
+ }
20
+ }
21
+
22
+ query ListModelItems($modelId: ID!, $params: SearchParams) {
23
+ node(id: $modelId) {
24
+ __typename
25
+ ... on Model {
26
+ id
27
+ modelItemList(params: $params) {
28
+ ...ModelItemFields
29
+ }
30
+ }
31
+ }
32
+ }
33
+
34
+ query GetModelItem($id: ID!) {
35
+ node(id: $id) {
36
+ __typename
37
+ ... on ModelItem {
38
+ ...ModelItemFields
39
+ model {
40
+ id
41
+ }
42
+ }
43
+ }
44
+ }
package/src/types.ts CHANGED
@@ -1,7 +1,14 @@
1
1
  export interface UiduClientConfig {
2
- workspace: string;
2
+ /** Builds the default endpoint. Not needed when `endpoint` is given. */
3
+ workspace?: string;
3
4
  publicToken?: string;
4
5
  apiKey?: string;
6
+ /**
7
+ * A Bearer token fetched per request, for tokens that expire — a custom
8
+ * app's session from `@uidu/app-bridge` (see `fromBridge`). Takes
9
+ * precedence over `apiKey`.
10
+ */
11
+ getToken?: () => Promise<string>;
5
12
  endpoint?: string;
6
13
  headers?: Record<string, string>;
7
14
  }