export type ValidValue = {Code: string, Name: string}; export type Field = {Name: string, Description: string, Key: string, Tooltip?: string | undefined, Position: number, DefaultValue?: string | undefined, ValidValues?: Array | undefined, ValidationRegex?: string | undefined, FieldType: 'Text' | 'TextArea' | 'Integer' | 'Decimal' | 'Date' | 'DateTime' | 'Time' | 'Select' | 'Boolean' | 'ActionButton', IsFlipdishRestricted?: (boolean | null) | undefined}; export type FieldGroup = {Name: string, Description?: string | undefined, Tooltip?: string | undefined, Position: number, Fields?: Array | undefined}; export type AppStoreAppSupportInfo = {PrivacyPolicy?: string | undefined, TermsOfUse?: string | undefined, CompanyWebsite?: string | undefined, LearnMore?: string | undefined, InstallationMessage?: string | undefined, SupportEmail?: string | undefined}; export type UpdateAppStoreApp = {Details: string, ConfigurationType: 'ExternalLink' | 'FlipdishHosted', StoreSelectorType: 'None' | 'Single' | 'Multiple', FieldGroups?: Array | undefined, SetupInstructions?: string | undefined, ExternalSetupLink?: string | undefined, TeammateAppAccessLevel?: ('Owner' | 'StoreOwner' | 'PropertyOwner' | 'ManagedOwner' | 'Integrator' | 'PropertyManager' | 'StoreManager' | 'StoreStaff' | 'StaffMember' | 'StoreReadOnlyAccess' | 'FinanceManger') | undefined, PermissionsType: 'Teammate', Support?: AppStoreAppSupportInfo | undefined, ExternalFunctionActionUrl?: string | undefined, ExternalFunctionSignatureKey?: string | undefined, IsPaid?: boolean | undefined, Name: string, Description: string, IsEnabled?: boolean | undefined, Categories: Array<'PointOfSale' | 'DeliveryAndLogistics' | 'CRM' | 'GiftCard' | 'Accounting' | 'LoyaltyAndMarketing' | 'Other'>, Countries: Array<'GB' | 'IE' | 'FR' | 'ES' | 'PT' | 'IT' | 'DE' | 'PL' | 'BE' | 'LU' | 'NL' | 'US' | 'CA' | 'BG' | 'MX' | 'AU' | 'NZ'>, DeveloperName?: string | undefined}; export type UpdateApiApiV10OauthclientsOauthAppIdAppstoreAppsAppStoreAppIdArgs = {oauthAppId: string, appStoreAppId: string, body: UpdateAppStoreApp}; export type UpdateApiApiV10OauthclientsOauthAppIdAppstoreAppsAppStoreAppIdOptions = {baseUrl?: string | undefined, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * PUT /api/v1.0/oauthclients/{oauthAppId}/appstore/apps/{appStoreAppId} */ export const updateApiApiV10OauthclientsOauthAppIdAppstoreAppsAppStoreAppId = async (args: UpdateApiApiV10OauthclientsOauthAppIdAppstoreAppsAppStoreAppIdArgs, options?: UpdateApiApiV10OauthclientsOauthAppIdAppstoreAppsAppStoreAppIdOptions) => { const {baseUrl = "https://api.flipdish.co", fetch: fetchFn = fetch, oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (oauth2 !== undefined) headers.set('authorization', `Bearer ${oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1.0/oauthclients/${encodeURIComponent(String(args.oauthAppId))}/appstore/apps/${encodeURIComponent(String(args.appStoreAppId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };