@narrative.io/data-collaboration-sdk-ts 0.0.106 → 0.0.107

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { type ApiRecords } from '../types';
2
2
  import { BaseApi } from '../base-api';
3
- import { type App } from './types';
3
+ import { type App, type Installation } from './types';
4
4
  /**
5
5
  * @module AppsApi
6
6
  * @description This module provides methods for fetching app records.
@@ -13,5 +13,6 @@ declare class AppsApi extends BaseApi {
13
13
  * @returns {Promise<ApiRecords<Installation>>} - Promise resolving with the list of installations.
14
14
  */
15
15
  getApps(appCategory?: string): Promise<ApiRecords<App>>;
16
+ getInstalledApps(appCategory?: string): Promise<ApiRecords<Installation>>;
16
17
  }
17
- export { type App, AppsApi };
18
+ export { type App, type Installation, AppsApi };
@@ -16,5 +16,10 @@ class AppsApi extends BaseApi {
16
16
  const url = `${resourceName}${appCategoryQuery}`;
17
17
  return await this.get(url);
18
18
  }
19
+ async getInstalledApps(appCategory) {
20
+ const appCategoryQuery = appCategory !== undefined ? `?app_category=${appCategory}` : '';
21
+ const url = `installations${appCategoryQuery}`;
22
+ return await this.get(url);
23
+ }
19
24
  }
20
25
  export { AppsApi };
@@ -1,3 +1,15 @@
1
+ interface Permission {
2
+ access: 'read' | 'write';
3
+ resource: string;
4
+ }
5
+ export interface Installation {
6
+ id: number;
7
+ app_id: number;
8
+ company_id: number;
9
+ tier_id: string;
10
+ permissions: Permission[];
11
+ installation_time: string;
12
+ }
1
13
  export interface App {
2
14
  id: number;
3
15
  manifest: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narrative.io/data-collaboration-sdk-ts",
3
- "version": "0.0.106",
3
+ "version": "0.0.107",
4
4
  "main": "build/index.js",
5
5
  "repository": "github:narrative-io/data-collaboration-sdk-ts",
6
6
  "source": "src/index.ts",