1.0.13 • Published 10 months ago

@flipdish/orgmanagement v1.0.13

Weekly downloads
-
License
Unlicense
Repository
github
Last release
10 months ago

@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 { OrgsApi, Configuration, OrgCountryCodeEnum } from '@flipdish/orgmanagement';
import { describe, expect, test } from '@jest/globals';

const configuration = new Configuration({
    basePath: "https://api.flipdish.co",
    // to get the API key, you should follow these docs: 
    // https://developers.flipdish.com/docs/getting-started
    accessToken: process.env.FLIPDISH_API_KEY,
    // 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: "macdonalds.test.org@flipdish.com",
            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);
        })
    });
});

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)

1.0.9-rc.1727362573

10 months ago

1.0.9

10 months ago

1.0.8-rc.1727361706

10 months ago

1.0.11

10 months ago

1.0.10

10 months ago

1.0.13

10 months ago

1.0.12

10 months ago

1.0.5-rc.1727102889

10 months ago

1.0.7-rc.1727103256

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.6-rc.1727103123

10 months ago

1.0.4-rc.1727082576

10 months ago

1.0.3

11 months ago

1.0.3-rc.1726137116

11 months ago

1.0.2-rc.1725965675

11 months ago

1.0.1-rc.1725964777

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago

1.0.0-rc.1725964353

11 months ago

0.3.6

11 months ago

0.3.5

11 months ago

0.3.2

11 months ago

0.3.1

11 months ago

0.3.4

11 months ago

0.3.3

11 months ago

0.2.6

11 months ago

0.1.0

11 months ago

0.0.1

11 months ago

0.0.3

11 months ago

0.2.0

11 months ago

0.0.2

11 months ago

0.2.3

11 months ago

0.0.5

11 months ago

0.2.2

11 months ago

0.0.7

11 months ago

0.0.1-beta

11 months ago