@taruvi/sdk 1.2.4 → 1.2.6

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taruvi/sdk",
3
- "version": "1.2.4",
3
+ "version": "1.2.6",
4
4
  "description": "Taruvi SDK",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
@@ -21,6 +21,10 @@ export class App {
21
21
  return new App(this.client, { ...this.urlParams, roles: "roles" }, HttpMethod.GET)
22
22
  }
23
23
 
24
+ settings() {
25
+ return new App(this.client, {...this.urlParams, settings: "settings"}, HttpMethod.GET)
26
+ }
27
+
24
28
  private buildRoute(): string {
25
29
  return (
26
30
  AppRoutes.baseUrl(this.config.appSlug) +
@@ -7,6 +7,7 @@ export type AppOperation = HttpMethod
7
7
  export interface UrlParams {
8
8
  appSlug?: string
9
9
  roles?: string
10
+ settings?: string
10
11
  }
11
12
 
12
13
  export interface AppClientInterface {
@@ -23,3 +24,19 @@ export interface RoleResponse {
23
24
  updated_at?: string
24
25
  [key: string]: unknown
25
26
  }
27
+
28
+ export interface SettingsResponse {
29
+ display_name: string
30
+ icon: string | null
31
+ icon_url: string | null
32
+ primary_color: string
33
+ secondary_color: string
34
+ banner_image: string | null
35
+ banner_image_url: string | null
36
+ category: string
37
+ documentation_url: string | null
38
+ support_email: string | null
39
+ default_frontend_worker_url: string | null
40
+ created_at: string
41
+ updated_at: string
42
+ }
@@ -25,11 +25,6 @@ export class Secrets {
25
25
  return new Secrets(this.client, { ...this.urlParams, path }, undefined, HttpMethod.GET)
26
26
  }
27
27
 
28
- update(key: string, body: object): Secrets {
29
- const path = SecretsRoutes.update(key)
30
- return new Secrets(this.client, { ...this.urlParams, path }, body, HttpMethod.PUT)
31
- }
32
-
33
28
  async execute<T = unknown>(): Promise<T> {
34
29
  const url = this.urlParams.path ?? SecretsRoutes.baseUrl
35
30
 
@@ -1,6 +1,7 @@
1
1
  export const AppRoutes = {
2
- baseUrl: (appSlug: string) => `api/app/${appSlug}`,
3
- roles: (): string => `/roles`
2
+ baseUrl: (appSlug: string) => `api/apps/${appSlug}`,
3
+ roles: (): string => `/roles`,
4
+ settings: (): string => "/settings/"
4
5
  }
5
6
 
6
7
  type AllRouteKeys = keyof typeof AppRoutes
@@ -1,3 +1,3 @@
1
1
  export const FunctionRoutes = {
2
- baseUrl: (appSlug: string, functionSlug: string) => `api/functions/apps/${appSlug}/functions/${functionSlug}`
2
+ baseUrl: (appSlug: string, functionSlug: string) => `api/apps/${appSlug}/functions/${functionSlug}`
3
3
  }