npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@crqlar/expo-sdk

v0.4.43

Published

An SDK for building hotel apps using Crqlar APIs and Expo.

Downloads

150

Readme

@crqlar/expo-sdk

An SDK for building hotel apps using Crqlar APIs and Expo.

Installation

yarn add @crqlar/expo-sdk

or

npm install @crqlar/expo-sdk

Usage


// Put this before App function in your App.tsx file
CrqlarSDK.initialize({
  publicKey: Constants.expoConfig?.extra?.publicKey,
  apiUrl: Constants.expoConfig?.extra?.apiUrl,
  wsUrl: Constants.expoConfig?.extra?.wsUrl,
  i18Config: {
    en: {
      translation: require('./assets/translations/en.json')
    },
    de: {
      translation: require('./assets/translations/de.json')
    }
  },
  paperProps: {
    theme: {
      fonts: {
        regular: { fontFamily: 'Arial' }
      }
    }
  } as any,
  customComponents: {
    text: props => <CustomText {...props} />,
    input: (props, ref) => <CustomInput {...props} ref={ref}/>,
    button: (props, ref) => <CustomButton {...props} ref={ref}/>,
  }
})

// With the SDK initialized, we can start using the app
export default function App() {
  const colorScheme = useColorScheme();
  const [fontsLoaded] = useFonts({
    "ExampleFont": require('./assets/fonts/ExampleFont.otf')
  })
  const [initializationDone, setInitializationDone] = useState(false);

  useEffect(() => {
    const init = async () => {
      CrqlarSDK.i18Config && (await initLocalization(CrqlarSDK.i18Config, 'en'));
      setInitializationDone(true);
    };
    init();
  }, []);

  if (!fontsLoaded || !initializationDone) {
    return null
  }

  return (
    <CrqlarApp>
      <Navigation colorScheme={colorScheme}/>
    </CrqlarApp>
  );
}

Configuration properties:

| Property | Explanation | |---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | publicKey | The public key provided to the SDK. It's used for API authentication and requests to the server. | | apiUrl | The base URL for all API calls. It's used by the SDK to connect to the server and perform operations. | | wsUrl | The URL for WebSocket communication. WebSockets provide full-duplex communication channels over a single TCP connection. | | i18Config | Internationalization (i18n) configuration object. This is used for localization of your application, providing translations for the languages you will use. The translations are fetched from *.json files. | | paperProps | The properties for the react-native-paper library, which is used for UI components in React Native. This particular configuration sets the theme's fonts. | | regular, light, thin, medium, labelLarge, labelMedium, labelSmall | Font configurations within the paperProps object. In this case, each is set to use the 'RotundaVariable-Regular' font family. | | customComponents | An object that defines custom React components. These components will replace the default components in the Paper library. | | text, input, button | These are custom components defined within customComponents. The text is a custom text component, input is a custom input component, and button is a custom button component. Each custom component takes props and, for the input and button components, a ref. |

This table explains the high-level concepts of each property. For a more in-depth explanation, you would need to consult the CrqlarSDK documentation, as the specifics can vary based on implementation.

Models

This is a brief explanation of most commonly used data models

| Interface Name | Description | |---------------------------------|----------------------------------------------------------------------------------------------------| | RestaurantReservation | Represents one restaurant reservation. | | RestaurantTable | Restaurant table information. | | CustomerGovernmentID | ID info, such as passport, licence, etc. | | RoomRate | Hotel reservation room rate, OTA. | | CustomFormPredefinedValue | Predefined value for custom form option. | | ServiceReservation | Represents one service (eg. spa) reservation. | | ServiceSector | Sector info - eg. spa, sports, rental. | | ServiceValidityPeriod | []TODO | | AmountType | Represent some value, such as price, with detailed info like before tax, after tax, validity, etc. | | BaseModel | Base model for all Crqlar types. | | CheckInInvoiceItem | One invoice line. | | LocalizedEmailTemplate | []TODO | | Media | Image or other media, with provider (storage) info. | | Comment | | | LocalizedContent | Content which contains language code and generic JSON content. | | ProfileEmail | Detailed email info. | | Channel | Chat message channel. | | Customer | Basic profile info such as name, gender, birthday... | | ProfileAddress | Detailed address info. | | ReservationExtra | Additional requests related to hotel reservation. | | Total | Represents amount with currency code. | | RatePlan | []TODO | | Service | A service which can be booked. | | LocalizedText | Content which contains language code and text value for that language. | | Plan | Weekly plan. | | ProfilePreference | Detailed profile preference with type and value. | | BaseAuditableModel | Extension of BaseMode which also contains date of modification. | | PostCategory | Category of app posts. | | Resource | Staff or facility related to Service and ServiceReservation. | | | RoomStay | One hotel room stay with check-in/out dates, room rates, room id, etc. | | Post | App post. | | GuestAuthClaims | Auth response which contains token and user info. | | | AdditionalGuestRequest | Info about additional guests; used during check in. | | RestaurantSpecialEvent | Marks that restaurant reservation is for some special event (eg. wedding, birthday) | | Page | Paging response holder with content. | | Price | []TODO | | PlanItem | One weekly planner item | | RoomType | | | ResGlobalInfo | | | StripeSetupIntent | | | AvailabilityDates | | | TaxRate | | | AuthRequest | | | Restaurant | | | Company | | | ProfilePhone | Detailed phone info. | | Participant | | | EmailTemplate | | | ServiceCategory | Category of Service | | Availability | Info about one availability slot for service or restaurant reservations | | ResGuest | | | CorrespondenceMessage | Chat message. | | HotelReservation | Holds all info about one hotel reservation. | | Guest | App user |

Services

Services are used for making CRQLAR API calls

| Service | File | |----------------|---------------------------------------------------------------| | AuthService | Login, Registration, Push token and other auth related calls. | | CorrespondenceMessageService | Get conversations and send messages. | | CheckInService | Send check in requests, check status, list extras. | | PostService | Get posts list or post details. | | PostCategoryService | Get post categories or category details. | | ProfileService | Modify profile data. | | CustomFormService | Read or submit custom forms. | | RestaurantService | List restaurants or check availability. | | RestaurantReservationService | Make restaurant reservations and check status. | | PlanService | Get plan info and plan for specific date range. | | ServiceCategoryService | Get info about service categories. | | ServiceReservationService | Make service (eg. spa) reservations and check status. | | ServicesService | Get info about available services. | | PushService | Request permissions and subscribe for push notifications. | | StompService | Handle web socket communication. | | CloudinaryService | Upload files |

Components

[] Add component descriptions

Utils

[] Add a list of util functions

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library