starta.apiclient 1.37.3579 → 1.37.3583

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.
@@ -0,0 +1,18 @@
1
+ import { StartaRequestRunner } from '../../types';
2
+ export default class CashRegisterOperations {
3
+ private _requestRunner;
4
+ constructor(requestRunner: StartaRequestRunner);
5
+ index(organizationLogin: string, branchId?: string): Promise<import("../../types").StartaResponse>;
6
+ add(organizationLogin: string, { cashRegisterId, branchId, operationType, operationSubtype, receiverType, recipient, recipientLogin, amount, comment, date, }: {
7
+ cashRegisterId: string;
8
+ branchId?: string;
9
+ operationType: 'income' | 'expenses';
10
+ operationSubtype: 'provisionOfServices' | 'saleOfProducts' | 'purchaseOfMaterials' | 'purchaseOfProducts' | 'employeeSalaries' | 'taxesAndFees' | 'otherIncome' | 'otherExpenses';
11
+ receiverType: 'counterparty' | 'customer' | 'employee';
12
+ recipient?: string;
13
+ recipientLogin?: string;
14
+ amount: number;
15
+ comment?: string;
16
+ date: Date;
17
+ }): Promise<import("../../types").StartaResponse>;
18
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _helpers_1 = require("../_helpers");
4
+ class CashRegisterOperations {
5
+ constructor(requestRunner) {
6
+ this._requestRunner = requestRunner;
7
+ }
8
+ index(organizationLogin, branchId) {
9
+ return this._requestRunner.performRequest({
10
+ url: `accounts/${organizationLogin}/cashRegisterOperations${(0, _helpers_1.buildQuery)({ branchId })}`,
11
+ method: 'GET',
12
+ });
13
+ }
14
+ add(organizationLogin, { cashRegisterId, branchId, operationType, operationSubtype, receiverType, recipient, recipientLogin, amount, comment, date, }) {
15
+ return this._requestRunner.performRequest({
16
+ url: `accounts/${organizationLogin}/cashRegisterOperations`,
17
+ method: 'POST',
18
+ body: {
19
+ cashRegisterId,
20
+ branchId,
21
+ operationType,
22
+ operationSubtype,
23
+ receiverType,
24
+ recipient,
25
+ recipientLogin,
26
+ amount,
27
+ comment,
28
+ date,
29
+ },
30
+ });
31
+ }
32
+ }
33
+ exports.default = CashRegisterOperations;
@@ -0,0 +1,6 @@
1
+ import { StartaRequestRunner } from '../../types';
2
+ export default class CashRegisterShifts {
3
+ private _requestRunner;
4
+ constructor(requestRunner: StartaRequestRunner);
5
+ index(organizationLogin: string, branchId?: string): Promise<import("../../types").StartaResponse>;
6
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _helpers_1 = require("../_helpers");
4
+ class CashRegisterShifts {
5
+ constructor(requestRunner) {
6
+ this._requestRunner = requestRunner;
7
+ }
8
+ index(organizationLogin, branchId) {
9
+ return this._requestRunner.performRequest({
10
+ url: `accounts/${organizationLogin}/cashRegisterShifts${(0, _helpers_1.buildQuery)({ branchId })}`,
11
+ method: 'GET',
12
+ });
13
+ }
14
+ }
15
+ exports.default = CashRegisterShifts;
@@ -0,0 +1,21 @@
1
+ import { StartaRequestRunner } from '../../types';
2
+ export default class CashRegisters {
3
+ private _requestRunner;
4
+ constructor(requestRunner: StartaRequestRunner);
5
+ index(organizationLogin: string, branchId?: string): Promise<import("../../types").StartaResponse>;
6
+ add(organizationLogin: string, { name, type, balance, description, branchId, }: {
7
+ name: string;
8
+ type: 'cash' | 'nonCash';
9
+ balance: number;
10
+ description?: string;
11
+ branchId?: string;
12
+ }): Promise<import("../../types").StartaResponse>;
13
+ update(organizationLogin: string, cashRegisterId: string, { name, type, description, branchId, }: {
14
+ name: string;
15
+ type: 'cash' | 'nonCash';
16
+ description?: string;
17
+ branchId?: string;
18
+ }): Promise<import("../../types").StartaResponse>;
19
+ delete(organizationLogin: string, cashRegisterId: string): Promise<import("../../types").StartaResponse>;
20
+ setDefaults(organizationLogin: string, cashRegisterId: string, nonCashRegisterId: string): Promise<import("../../types").StartaResponse>;
21
+ }
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const _helpers_1 = require("../_helpers");
4
+ class CashRegisters {
5
+ constructor(requestRunner) {
6
+ this._requestRunner = requestRunner;
7
+ }
8
+ index(organizationLogin, branchId) {
9
+ return this._requestRunner.performRequest({
10
+ url: `accounts/${organizationLogin}/cashRegisters${(0, _helpers_1.buildQuery)({ branchId })}`,
11
+ method: 'GET',
12
+ });
13
+ }
14
+ add(organizationLogin, { name, type, balance, description, branchId, }) {
15
+ return this._requestRunner.performRequest({
16
+ url: `accounts/${organizationLogin}/cashRegisters`,
17
+ method: 'POST',
18
+ body: {
19
+ name,
20
+ type,
21
+ balance,
22
+ description,
23
+ branchId,
24
+ },
25
+ });
26
+ }
27
+ update(organizationLogin, cashRegisterId, { name, type, description, branchId, }) {
28
+ return this._requestRunner.performRequest({
29
+ url: `accounts/${organizationLogin}/cashRegisters/${cashRegisterId}`,
30
+ method: 'PUT',
31
+ body: {
32
+ name,
33
+ type,
34
+ description,
35
+ branchId,
36
+ },
37
+ });
38
+ }
39
+ delete(organizationLogin, cashRegisterId) {
40
+ return this._requestRunner.performRequest({
41
+ url: `accounts/${organizationLogin}/cashRegisters/${cashRegisterId}`,
42
+ method: 'DELETE'
43
+ });
44
+ }
45
+ setDefaults(organizationLogin, cashRegisterId, nonCashRegisterId) {
46
+ return this._requestRunner.performRequest({
47
+ url: `accounts/${organizationLogin}/cashRegisters/defaults`,
48
+ method: 'PUT',
49
+ body: {
50
+ cashRegisterId,
51
+ nonCashRegisterId,
52
+ },
53
+ });
54
+ }
55
+ }
56
+ exports.default = CashRegisters;
@@ -15,7 +15,9 @@ import StartaTransactions from './startaTransactions';
15
15
  import Warehouses from './warehouses';
16
16
  import Products from './products';
17
17
  import ProductCategories from './productCategories';
18
+ import CashRegisters from './cashRegisters';
18
19
  import ProductOperations from './productOperations';
20
+ import CashRegisterOperations from './cashRegisterOperations';
19
21
  export declare type TariffDetails = {
20
22
  tariff: 'lite' | 'pro';
21
23
  period: 'monthly' | 'yearly';
@@ -108,6 +110,9 @@ export default class Organizations {
108
110
  get warehouses(): Warehouses;
109
111
  get products(): Products;
110
112
  get productCategories(): ProductCategories;
113
+ get cashRegisters(): CashRegisters;
111
114
  get productsOperations(): ProductOperations;
115
+ get cashRegisterOperations(): CashRegisterOperations;
116
+ get cashRegisterShifts(): CashRegisterOperations;
112
117
  get startaTransactions(): StartaTransactions;
113
118
  }
@@ -16,7 +16,9 @@ const startaTransactions_1 = require("./startaTransactions");
16
16
  const warehouses_1 = require("./warehouses");
17
17
  const products_1 = require("./products");
18
18
  const productCategories_1 = require("./productCategories");
19
+ const cashRegisters_1 = require("./cashRegisters");
19
20
  const productOperations_1 = require("./productOperations");
21
+ const cashRegisterOperations_1 = require("./cashRegisterOperations");
20
22
  const _helpers_1 = require("../_helpers");
21
23
  class Organizations {
22
24
  constructor(requestRunner) {
@@ -251,9 +253,18 @@ class Organizations {
251
253
  get productCategories() {
252
254
  return new productCategories_1.default(this._requestRunner);
253
255
  }
256
+ get cashRegisters() {
257
+ return new cashRegisters_1.default(this._requestRunner);
258
+ }
254
259
  get productsOperations() {
255
260
  return new productOperations_1.default(this._requestRunner);
256
261
  }
262
+ get cashRegisterOperations() {
263
+ return new cashRegisterOperations_1.default(this._requestRunner);
264
+ }
265
+ get cashRegisterShifts() {
266
+ return new cashRegisterOperations_1.default(this._requestRunner);
267
+ }
257
268
  get startaTransactions() {
258
269
  return new startaTransactions_1.default(this._requestRunner);
259
270
  }
@@ -2,17 +2,6 @@ import { ProductOperation, StartaRequestRunner } from '../../types';
2
2
  export default class ProductOperations {
3
3
  private _requestRunner;
4
4
  constructor(requestRunner: StartaRequestRunner);
5
- index(organizationLogin: string, { searchQuery, filters, }: {
6
- searchQuery?: string;
7
- filters?: {
8
- date?: {
9
- from?: string;
10
- to?: string;
11
- };
12
- operationType?: 'writeOff' | 'receiving';
13
- warehouseId?: string;
14
- paymentStatus?: 'paid' | 'unpaid';
15
- };
16
- }): Promise<import("../../types").StartaResponse>;
5
+ index(organizationLogin: string): Promise<import("../../types").StartaResponse>;
17
6
  add(organizationLogin: string, { date, type, supplier, warehouseId, products, isPaid, comment, }: ProductOperation): Promise<import("../../types").StartaResponse>;
18
7
  }
@@ -1,16 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const _helpers_1 = require("../_helpers");
4
3
  class ProductOperations {
5
4
  constructor(requestRunner) {
6
5
  this._requestRunner = requestRunner;
7
6
  }
8
- index(organizationLogin, { searchQuery, filters, }) {
7
+ index(organizationLogin) {
9
8
  return this._requestRunner.performRequest({
10
- url: `accounts/${organizationLogin}/productOperations${(0, _helpers_1.buildQuery)({
11
- searchQuery,
12
- filters,
13
- })}`,
9
+ url: `accounts/${organizationLogin}/productOperations`,
14
10
  method: 'GET',
15
11
  });
16
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starta.apiclient",
3
- "version": "1.37.3579",
3
+ "version": "1.37.3583",
4
4
  "main": "./lib/index.js",
5
5
  "description": "Wrapper for starta.one api",
6
6
  "author": "Collaboracia OÜ",