@flipdish/orgmanagement
v1.1.47
Published
OpenAPI client for @flipdish/orgmanagement
Readme
@flipdish/orgmanagement
This package provides a Typescript/JavaScript client for interacting with Flipdish's Organisation Management APIs over HTTP.
Internally the package utilizes the axios as its HTTP client.
Example code
import { Configuration, OrgsApi } from "@flipdish/orgmanagement";
import { describe, test } from "@jest/globals";
const configuration = new Configuration({
basePath: "https://api-prod-staging.flipdishdev.com",
// to get the API key, you should follow these docs:
// https://developers.flipdish.com/docs/getting-started
accessToken: process.env.FLIPDISH_BEARER_TOKEN,
// if using in a browser set useDefaultUserAgent
// to true to prevent errors
// useDefaultUserAgent: true
});
const _orgs = new OrgsApi(configuration);
describe("Org Management Tests", () => {
describe("Orgs", () => {
// let testOrg: any = {
// name: "Macdonald's Test Org",
// emailAddress: "[email protected]",
// countryCode: OrgCountryCodeEnum.Gb
// };
// test('Create org', async () => {
// const orgsCreateResponse = await orgs.createOrg({ createOrg: testOrg });
// expect(orgsCreateResponse.status).toBe(201);
// testOrg = { ...testOrg, orgId: orgsCreateResponse.data.data?.orgId };
// expect(orgsCreateResponse.data.data).toMatchObject(testOrg);
// });
// test('Get org by id', async () => {
// const orgsResponse = await orgs.getOrgById({ orgId: testOrg.orgId });
// expect(orgsResponse.data.data).toMatchObject(testOrg);
// })
// test('List org by id', async () => {
// const orgsResponse = await orgs.getAllOrgs({ brandId: "doesntExist" });
// expect(orgsResponse.data.data).toHaveLength(0);
// })
test("do nothing", async () => {});
});
});
The generated Node module can be used in the following environments:
Environment
- Node.js
- Webpack
- Browserify
Language level
- ES5 - you must have a Promises/A+ library installed
- ES6
Module system
- CommonJS
- ES6 module system
It can be used in both TypeScript and JavaScript. In TypeScript, the definition will be automatically resolved via package.json. (Reference)
