1.0.13 • Published 12 months ago

@flipdish/orgmanagement v1.0.13

Weekly downloads
-
License
Unlicense
Repository
github
Last release
12 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

12 months ago

1.0.9

12 months ago

1.0.8-rc.1727361706

12 months ago

1.0.11

12 months ago

1.0.10

12 months ago

1.0.13

12 months ago

1.0.12

12 months ago

1.0.5-rc.1727102889

12 months ago

1.0.7-rc.1727103256

12 months ago

1.0.7

12 months ago

1.0.6

12 months ago

1.0.5

12 months ago

1.0.4

12 months ago

1.0.6-rc.1727103123

12 months ago

1.0.4-rc.1727082576

12 months ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.3.6

1 year ago

0.3.5

1 year ago

0.3.2

1 year ago

0.3.1

1 year ago

0.3.4

1 year ago

0.3.3

1 year ago

0.2.6

1 year ago

0.1.0

1 year ago

0.0.1

1 year ago

0.0.3

1 year ago

0.2.0

1 year ago

0.0.2

1 year ago

0.2.3

1 year ago

0.0.5

1 year ago

0.2.2

1 year ago

0.0.7

1 year ago

0.0.1-beta

1 year ago