starta.apiclient 1.37.6852 → 1.37.6933

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.
@@ -26,6 +26,7 @@ import Techcards from './techcards';
26
26
  import Memberships from './memberships';
27
27
  import WarehouseOperations from './warehouseOperations';
28
28
  import Settlements from './settlements';
29
+ import Resources from './resources';
29
30
  export type TariffDetails = {
30
31
  tariff: 'lite' | 'pro';
31
32
  period: 'monthly' | 'yearly' | 'ltl';
@@ -145,5 +146,6 @@ export default class Organizations {
145
146
  get techcards(): Techcards;
146
147
  get memberships(): Memberships;
147
148
  get settlements(): Settlements;
149
+ get resources(): Resources;
148
150
  get warehouseOperations(): WarehouseOperations;
149
151
  }
@@ -27,6 +27,7 @@ const techcards_1 = require("./techcards");
27
27
  const memberships_1 = require("./memberships");
28
28
  const warehouseOperations_1 = require("./warehouseOperations");
29
29
  const settlements_1 = require("./settlements");
30
+ const resources_1 = require("./resources");
30
31
  const _helpers_1 = require("../_helpers");
31
32
  class Organizations {
32
33
  constructor(requestRunner) {
@@ -335,6 +336,9 @@ class Organizations {
335
336
  get settlements() {
336
337
  return new settlements_1.default(this._requestRunner);
337
338
  }
339
+ get resources() {
340
+ return new resources_1.default(this._requestRunner);
341
+ }
338
342
  get warehouseOperations() {
339
343
  return new warehouseOperations_1.default(this._requestRunner);
340
344
  }
@@ -0,0 +1,25 @@
1
+ import { StartaRequestRunner } from '../../types';
2
+ export default class Resources {
3
+ private _requestRunner;
4
+ constructor(requestRunner: StartaRequestRunner);
5
+ add(organizationLogin: string, { name, description, instances, }: {
6
+ name: string;
7
+ description: string;
8
+ instances: {
9
+ branchId: string;
10
+ quantity: number;
11
+ };
12
+ }): Promise<import("../../types").StartaResponse>;
13
+ update(organizationLogin: string, resourceId: string, { name, description, instances, }: {
14
+ name: string;
15
+ description: string;
16
+ instances: {
17
+ branchId: string;
18
+ quantity: number;
19
+ };
20
+ }): Promise<import("../../types").StartaResponse>;
21
+ delete(organizationLogin: string, resourceId: string): Promise<import("../../types").StartaResponse>;
22
+ index(organizationLogin: string, { branchId }?: {
23
+ branchId?: string;
24
+ }): Promise<import("../../types").StartaResponse>;
25
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _helpers_1 = require("../_helpers");
4
+ class Resources {
5
+ constructor(requestRunner) {
6
+ this._requestRunner = requestRunner;
7
+ }
8
+ add(organizationLogin, { name, description, instances, }) {
9
+ return this._requestRunner.performRequest({
10
+ url: `accounts/${organizationLogin}/resources`,
11
+ method: 'POST',
12
+ body: {
13
+ name,
14
+ description,
15
+ instances,
16
+ },
17
+ });
18
+ }
19
+ update(organizationLogin, resourceId, { name, description, instances, }) {
20
+ return this._requestRunner.performRequest({
21
+ url: `accounts/${organizationLogin}/resources/${resourceId}`,
22
+ method: 'PUT',
23
+ body: {
24
+ name,
25
+ description,
26
+ instances,
27
+ },
28
+ });
29
+ }
30
+ delete(organizationLogin, resourceId) {
31
+ return this._requestRunner.performRequest({
32
+ url: `accounts/${organizationLogin}/resources/${resourceId}`,
33
+ method: 'DELETE',
34
+ });
35
+ }
36
+ index(organizationLogin, { branchId } = {}) {
37
+ return this._requestRunner.performRequest({
38
+ url: `accounts/${organizationLogin}/resources${(0, _helpers_1.buildQuery)({ branchId })}`,
39
+ method: 'GET',
40
+ });
41
+ }
42
+ }
43
+ exports.default = Resources;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starta.apiclient",
3
- "version": "1.37.6852",
3
+ "version": "1.37.6933",
4
4
  "main": "./lib/index.js",
5
5
  "description": "Wrapper for starta.one api",
6
6
  "author": "Collaboracia OÜ",