|
1
|
import { createCategoryRef, upsertCategoryRef, deleteCategoryRef, updateCategoryRef, getCategoryRef, listCategoriesRef, createDeviceRef, upsertDeviceRef, deleteDeviceRef, updateDeviceRef, getDeviceRef, listDevicesRef, createGuideRef, upsertGuideRef, deleteGuideRef, updateGuideRef, getGuideRef, listGuidesRef, createPartRef, upsertPartRef, deletePartRef, updatePartRef, getPartRef, listPartsRef, createStepRef, upsertStepRef, deleteStepRef, updateStepRef, getStepRef, listStepsRef, createBookmarkRef, upsertBookmarkRef, deleteBookmarkRef, updateBookmarkRef, getMyBookmarksRef, getBookmarkRef, connectorConfig } from '../../esm/index.esm.js'; |
|
2
|
import { validateArgs, CallerSdkTypeEnum } from 'firebase/data-connect'; |
|
3
|
import { useDataConnectQuery, useDataConnectMutation, validateReactArgs } from '@tanstack-query-firebase/react/data-connect'; |
|
4
|
|
|
5
|
export function useCreateCategory(dcOrOptions, options) { |
|
6
|
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); |
|
7
|
function refFactory() { |
|
8
|
return createCategoryRef(dcInstance); |
|
9
|
} |
|
10
|
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
11
|
} |
|
12
|
|
|
13
|
export function useUpsertCategory(dcOrOptions, options) { |
|
14
|
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); |
|
15
|
function refFactory(vars) { |
|
16
|
return upsertCategoryRef(dcInstance, vars); |
|
17
|
} |
|
18
|
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
19
|
} |
|
20
|
|
|
21
|
export function useDeleteCategory(dcOrOptions, options) { |
|
22
|
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); |
|
23
|
function refFactory(vars) { |
|
24
|
return deleteCategoryRef(dcInstance, vars); |
|
25
|
} |
|
26
|
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
27
|
} |
|
28
|
|
|
29
|
export function useUpdateCategory(dcOrOptions, options) { |
|
30
|
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); |
|
31
|
function refFactory(vars) { |
|
32
|
return updateCategoryRef(dcInstance, vars); |
|
33
|
} |
|
34
|
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
35
|
} |
|
36
|
|
|
37
|
|
|
38
|
export function useGetCategory(dcOrVars, varsOrOptions, options) { |
|
39
|
const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); |
|
40
|
const ref = getCategoryRef(dcInstance, inputVars); |
|
41
|
return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
42
|
} |
|
43
|
|
|
44
|
export function useListCategories(dcOrOptions, options) { |
|
45
|
const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); |
|
46
|
const ref = listCategoriesRef(dcInstance); |
|
47
|
return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
48
|
} |
|
49
|
export function useCreateDevice(dcOrOptions, options) { |
|
50
|
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); |
|
51
|
function refFactory() { |
|
52
|
return createDeviceRef(dcInstance); |
|
53
|
} |
|
54
|
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
55
|
} |
|
56
|
|
|
57
|
export function useUpsertDevice(dcOrOptions, options) { |
|
58
|
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); |
|
59
|
function refFactory(vars) { |
|
60
|
return upsertDeviceRef(dcInstance, vars); |
|
61
|
} |
|
62
|
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
63
|
} |
|
64
|
|
|
65
|
export function useDeleteDevice(dcOrOptions, options) { |
|
66
|
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); |
|
67
|
function refFactory(vars) { |
|
68
|
return deleteDeviceRef(dcInstance, vars); |
|
69
|
} |
|
70
|
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
71
|
} |
|
72
|
|
|
73
|
export function useUpdateDevice(dcOrOptions, options) { |
|
74
|
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); |
|
75
|
function refFactory(vars) { |
|
76
|
return updateDeviceRef(dcInstance, vars); |
|
77
|
} |
|
78
|
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
79
|
} |
|
80
|
|
|
81
|
|
|
82
|
export function useGetDevice(dcOrVars, varsOrOptions, options) { |
|
83
|
const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); |
|
84
|
const ref = getDeviceRef(dcInstance, inputVars); |
|
85
|
return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
86
|
} |
|
87
|
|
|
88
|
export function useListDevices(dcOrOptions, options) { |
|
89
|
const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); |
|
90
|
const ref = listDevicesRef(dcInstance); |
|
91
|
return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
92
|
} |
|
93
|
export function useCreateGuide(dcOrOptions, options) { |
|
94
|
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); |
|
95
|
function refFactory(vars) { |
|
96
|
return createGuideRef(dcInstance, vars); |
|
97
|
} |
|
98
|
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
99
|
} |
|
100
|
|
|
101
|
export function useUpsertGuide(dcOrOptions, options) { |
|
102
|
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); |
|
103
|
function refFactory(vars) { |
|
104
|
return upsertGuideRef(dcInstance, vars); |
|
105
|
} |
|
106
|
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
107
|
} |
|
108
|
|
|
109
|
export function useDeleteGuide(dcOrOptions, options) { |
|
110
|
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); |
|
111
|
function refFactory(vars) { |
|
112
|
return deleteGuideRef(dcInstance, vars); |
|
113
|
} |
|
114
|
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
115
|
} |
|
116
|
|
|
117
|
export function useUpdateGuide(dcOrOptions, options) { |
|
118
|
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); |
|
119
|
function refFactory(vars) { |
|
120
|
return updateGuideRef(dcInstance, vars); |
|
121
|
} |
|
122
|
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
123
|
} |
|
124
|
|
|
125
|
|
|
126
|
export function useGetGuide(dcOrVars, varsOrOptions, options) { |
|
127
|
const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); |
|
128
|
const ref = getGuideRef(dcInstance, inputVars); |
|
129
|
return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
130
|
} |
|
131
|
|
|
132
|
export function useListGuides(dcOrOptions, options) { |
|
133
|
const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); |
|
134
|
const ref = listGuidesRef(dcInstance); |
|
135
|
return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
136
|
} |
|
137
|
export function useCreatePart(dcOrOptions, options) { |
|
138
|
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); |
|
139
|
function refFactory(vars) { |
|
140
|
return createPartRef(dcInstance, vars); |
|
141
|
} |
|
142
|
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
143
|
} |
|
144
|
|
|
145
|
export function useUpsertPart(dcOrOptions, options) { |
|
146
|
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); |
|
147
|
function refFactory(vars) { |
|
148
|
return upsertPartRef(dcInstance, vars); |
|
149
|
} |
|
150
|
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
151
|
} |
|
152
|
|
|
153
|
export function useDeletePart(dcOrOptions, options) { |
|
154
|
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); |
|
155
|
function refFactory(vars) { |
|
156
|
return deletePartRef(dcInstance, vars); |
|
157
|
} |
|
158
|
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
159
|
} |
|
160
|
|
|
161
|
export function useUpdatePart(dcOrOptions, options) { |
|
162
|
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); |
|
163
|
function refFactory(vars) { |
|
164
|
return updatePartRef(dcInstance, vars); |
|
165
|
} |
|
166
|
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
167
|
} |
|
168
|
|
|
169
|
|
|
170
|
export function useGetPart(dcOrVars, varsOrOptions, options) { |
|
171
|
const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); |
|
172
|
const ref = getPartRef(dcInstance, inputVars); |
|
173
|
return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
174
|
} |
|
175
|
|
|
176
|
export function useListParts(dcOrOptions, options) { |
|
177
|
const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); |
|
178
|
const ref = listPartsRef(dcInstance); |
|
179
|
return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
180
|
} |
|
181
|
export function useCreateStep(dcOrOptions, options) { |
|
182
|
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); |
|
183
|
function refFactory(vars) { |
|
184
|
return createStepRef(dcInstance, vars); |
|
185
|
} |
|
186
|
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
187
|
} |
|
188
|
|
|
189
|
export function useUpsertStep(dcOrOptions, options) { |
|
190
|
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); |
|
191
|
function refFactory(vars) { |
|
192
|
return upsertStepRef(dcInstance, vars); |
|
193
|
} |
|
194
|
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
195
|
} |
|
196
|
|
|
197
|
export function useDeleteStep(dcOrOptions, options) { |
|
198
|
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); |
|
199
|
function refFactory(vars) { |
|
200
|
return deleteStepRef(dcInstance, vars); |
|
201
|
} |
|
202
|
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
203
|
} |
|
204
|
|
|
205
|
export function useUpdateStep(dcOrOptions, options) { |
|
206
|
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); |
|
207
|
function refFactory(vars) { |
|
208
|
return updateStepRef(dcInstance, vars); |
|
209
|
} |
|
210
|
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
211
|
} |
|
212
|
|
|
213
|
|
|
214
|
export function useGetStep(dcOrVars, varsOrOptions, options) { |
|
215
|
const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); |
|
216
|
const ref = getStepRef(dcInstance, inputVars); |
|
217
|
return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
218
|
} |
|
219
|
|
|
220
|
export function useListSteps(dcOrOptions, options) { |
|
221
|
const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); |
|
222
|
const ref = listStepsRef(dcInstance); |
|
223
|
return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
224
|
} |
|
225
|
export function useCreateBookmark(dcOrOptions, options) { |
|
226
|
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); |
|
227
|
function refFactory(vars) { |
|
228
|
return createBookmarkRef(dcInstance, vars); |
|
229
|
} |
|
230
|
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
231
|
} |
|
232
|
|
|
233
|
export function useUpsertBookmark(dcOrOptions, options) { |
|
234
|
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); |
|
235
|
function refFactory(vars) { |
|
236
|
return upsertBookmarkRef(dcInstance, vars); |
|
237
|
} |
|
238
|
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
239
|
} |
|
240
|
|
|
241
|
export function useDeleteBookmark(dcOrOptions, options) { |
|
242
|
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); |
|
243
|
function refFactory(vars) { |
|
244
|
return deleteBookmarkRef(dcInstance, vars); |
|
245
|
} |
|
246
|
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
247
|
} |
|
248
|
|
|
249
|
export function useUpdateBookmark(dcOrOptions, options) { |
|
250
|
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options); |
|
251
|
function refFactory(vars) { |
|
252
|
return updateBookmarkRef(dcInstance, vars); |
|
253
|
} |
|
254
|
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
255
|
} |
|
256
|
|
|
257
|
|
|
258
|
export function useGetMyBookmarks(dcOrOptions, options) { |
|
259
|
const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options); |
|
260
|
const ref = getMyBookmarksRef(dcInstance); |
|
261
|
return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
262
|
} |
|
263
|
|
|
264
|
export function useGetBookmark(dcOrVars, varsOrOptions, options) { |
|
265
|
const { dc: dcInstance, vars: inputVars, options: inputOpts } = validateReactArgs(connectorConfig, dcOrVars, varsOrOptions, options, true, true); |
|
266
|
const ref = getBookmarkRef(dcInstance, inputVars); |
|
267
|
return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact); |
|
268
|
} |