new sdk for front with vendor entity

This commit is contained in:
José Salazar
2025-11-24 12:16:40 -05:00
parent 93f17ce517
commit 0e0d5c647e
18 changed files with 1482 additions and 204 deletions

View File

@@ -1,11 +1,11 @@
const { listStaffRef, createEventRef, listEventsRef, createStaffRef, connectorConfig } = require('../index.cjs.js');
const { listVendorRef, createEventRef, listEventsRef, createStaffRef, listStaffRef, createVendorRef, connectorConfig } = require('../index.cjs.js');
const { validateArgs, CallerSdkTypeEnum } = require('firebase/data-connect');
const { useDataConnectQuery, useDataConnectMutation, validateReactArgs } = require('@tanstack-query-firebase/react/data-connect');
exports.useListStaff = function useListStaff(dcOrOptions, options) {
exports.useListVendor = function useListVendor(dcOrOptions, options) {
const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options);
const ref = listStaffRef(dcInstance);
const ref = listVendorRef(dcInstance);
return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact);
}
exports.useCreateEvent = function useCreateEvent(dcOrOptions, options) {
@@ -29,3 +29,17 @@ exports.useCreateStaff = function useCreateStaff(dcOrOptions, options) {
}
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact);
}
exports.useListStaff = function useListStaff(dcOrOptions, options) {
const { dc: dcInstance, options: inputOpts } = validateReactArgs(connectorConfig, dcOrOptions, options);
const ref = listStaffRef(dcInstance);
return useDataConnectQuery(ref, inputOpts, CallerSdkTypeEnum.GeneratedReact);
}
exports.useCreateVendor = function useCreateVendor(dcOrOptions, options) {
const { dc: dcInstance, vars: inputOpts } = validateArgs(connectorConfig, dcOrOptions, options);
function refFactory(vars) {
return createVendorRef(dcInstance, vars);
}
return useDataConnectMutation(refFactory, inputOpts, CallerSdkTypeEnum.GeneratedReact);
}