@wenex/sdk 0.7.5 → 0.7.7

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.
Files changed (31) hide show
  1. package/common/interfaces/auth/grant/grant.interface.d.ts +1 -2
  2. package/common/interfaces/context/config.interface.d.ts +1 -2
  3. package/common/interfaces/context/setting.interface.d.ts +1 -2
  4. package/common/interfaces/domain/app/app.interface.d.ts +1 -2
  5. package/common/interfaces/domain/client/client.interface.d.ts +1 -2
  6. package/common/interfaces/financial/account.interface.d.ts +1 -2
  7. package/common/interfaces/financial/coin/coin.interface.d.ts +1 -2
  8. package/common/interfaces/financial/transaction.interface.d.ts +1 -2
  9. package/common/interfaces/financial/wallet.interface.d.ts +1 -2
  10. package/common/interfaces/general/artifact.interface.d.ts +1 -2
  11. package/common/interfaces/general/workflow/workflow.interface.d.ts +1 -2
  12. package/common/interfaces/identity/profile.interface.d.ts +1 -2
  13. package/common/interfaces/identity/session.interface.d.ts +1 -2
  14. package/common/interfaces/identity/user.interface.d.ts +1 -2
  15. package/common/interfaces/logistic/cargo.interface.d.ts +1 -2
  16. package/common/interfaces/logistic/driver.interface.d.ts +1 -2
  17. package/common/interfaces/logistic/location/location.interface.d.ts +1 -2
  18. package/common/interfaces/logistic/travel.interface.d.ts +1 -2
  19. package/common/interfaces/logistic/vehicle.interface.d.ts +1 -2
  20. package/common/interfaces/special/file.interface.d.ts +1 -2
  21. package/common/interfaces/special/saga/history.interface.d.ts +1 -1
  22. package/common/interfaces/special/saga/saga.interface.d.ts +1 -1
  23. package/common/interfaces/touch/mail/mail.interface.d.ts +1 -2
  24. package/common/interfaces/touch/push/push.interface.d.ts +1 -2
  25. package/common/utils/transform.util.d.ts +1 -0
  26. package/common/utils/transform.util.js +9 -0
  27. package/common/utils/transform.util.js.map +1 -1
  28. package/package.json +1 -1
  29. package/services/special/sagas/sagas.service.d.ts +6 -2
  30. package/services/special/sagas/sagas.service.js +30 -1
  31. package/services/special/sagas/sagas.service.js.map +1 -1
@@ -1,7 +1,7 @@
1
1
  import type { Document } from 'mongoose';
2
2
  import { GrantTime } from './time.interface';
3
3
  import { Action, Resource } from '../../../enums';
4
- import { Core, Dto, Items, Properties } from '../../common';
4
+ import { Core, Dto, Properties } from '../../common';
5
5
  export interface Grant<Props extends Properties = Properties> extends Core<Props> {
6
6
  subject: string;
7
7
  action: Action;
@@ -15,4 +15,3 @@ export type GrantDoc = Grant & Document;
15
15
  export type GrantDto = Dto<Omit<Grant, 'time'>> & {
16
16
  time?: Dto<GrantTime>[];
17
17
  };
18
- export type GrantItemsDto = Items<GrantDto>;
@@ -1,6 +1,6 @@
1
1
  import type { Document } from 'mongoose';
2
2
  import { ValueType } from '../../enums';
3
- import { Core, Dto, Items, Properties } from '../common';
3
+ import { Core, Dto, Properties } from '../common';
4
4
  export interface Config<Props extends Properties = Properties> extends Core<Props> {
5
5
  key: string;
6
6
  type: ValueType;
@@ -8,4 +8,3 @@ export interface Config<Props extends Properties = Properties> extends Core<Prop
8
8
  }
9
9
  export type ConfigDoc = Config & Document;
10
10
  export type ConfigDto = Dto<Config>;
11
- export type ConfigItemsDto = Items<ConfigDto>;
@@ -1,6 +1,6 @@
1
1
  import type { Document } from 'mongoose';
2
2
  import { ValueType } from '../../enums';
3
- import { Core, Dto, Items, Properties } from '../common';
3
+ import { Core, Dto, Properties } from '../common';
4
4
  export interface Setting<Props extends Properties = Properties> extends Core<Props> {
5
5
  key: string;
6
6
  type: ValueType;
@@ -8,4 +8,3 @@ export interface Setting<Props extends Properties = Properties> extends Core<Pro
8
8
  }
9
9
  export type SettingDoc = Setting & Document;
10
10
  export type SettingDto = Dto<Setting>;
11
- export type SettingItemsDto = Items<SettingDto>;
@@ -1,6 +1,6 @@
1
1
  import type { Document } from 'mongoose';
2
+ import { Core, Dto, Properties } from '../../common';
2
3
  import { AppChangeLog } from './change-log.interface';
3
- import { Core, Dto, Items, Properties } from '../../common';
4
4
  import { AppType, GrantType, Scope, Status } from '../../../enums';
5
5
  export interface App<Props extends Properties = Properties> extends Core<Props> {
6
6
  cid: string;
@@ -23,4 +23,3 @@ export type AppDoc = App & Document;
23
23
  export type AppDto = Dto<Omit<App, 'change_logs'>> & {
24
24
  change_logs?: Dto<AppChangeLog>[];
25
25
  };
26
- export type AppItemsDto = Items<AppDto>;
@@ -1,7 +1,7 @@
1
1
  import type { Document } from 'mongoose';
2
2
  import { ClientDomain, ClientDomainDto } from './domain.interface';
3
+ import { Core, Dto, MakeOptional, Properties } from '../../common';
3
4
  import { ClientService, ClientServiceDto } from './service.interface';
4
- import { Core, Dto, Items, MakeOptional, Properties } from '../../common';
5
5
  import { ClientPlan, GrantType, Scope, State, Status } from '../../../enums';
6
6
  export type ApiToken = {
7
7
  cid: string;
@@ -37,4 +37,3 @@ export type ClientDto = Dto<MakeOptional<Omit<Client, 'domains' | 'services'>, '
37
37
  domains: ClientDomainDto[];
38
38
  services?: ClientServiceDto[];
39
39
  };
40
- export type ClientItemsDto = Items<ClientDto>;
@@ -1,6 +1,6 @@
1
1
  import type { Document } from 'mongoose';
2
2
  import { AccountBroker, AccountOwnership, AccountProvider, AccountType } from '../../enums';
3
- import { Core, Dto, Items, MakeOptional, Properties } from '../common';
3
+ import { Core, Dto, MakeOptional, Properties } from '../common';
4
4
  export interface Account<Props extends Properties = Properties> extends Core<Props> {
5
5
  type: AccountType;
6
6
  broker: AccountBroker;
@@ -10,4 +10,3 @@ export interface Account<Props extends Properties = Properties> extends Core<Pro
10
10
  }
11
11
  export type AccountDoc = Account & Document;
12
12
  export type AccountDto = Dto<MakeOptional<Account, 'broker' | 'members' | 'provider'>>;
13
- export type AccountItemsDto = Items<AccountDto>;
@@ -1,6 +1,6 @@
1
1
  import type { Document } from 'mongoose';
2
2
  import { CoinUnit, CoinUnitDto } from './unit.interface';
3
- import { Core, Dto, Items, MakeOptional, Properties } from '../../common';
3
+ import { Core, Dto, MakeOptional, Properties } from '../../common';
4
4
  import { CoinCategory, CoinLib, CoinProvider, CoinType } from '../../../enums';
5
5
  export interface Coin<Props extends Properties = Properties> extends Core<Props> {
6
6
  type: CoinType;
@@ -23,4 +23,3 @@ export type CoinDoc = Coin & Document;
23
23
  export type CoinDto = Dto<MakeOptional<Omit<Coin, 'subunits'>, 'precision'>> & {
24
24
  subunits?: CoinUnitDto[];
25
25
  };
26
- export type CoinItemsDto = Items<CoinDto>;
@@ -1,6 +1,6 @@
1
1
  import type { Document } from 'mongoose';
2
2
  import { Pay, PayDto } from './common';
3
- import { Core, Dto, Items, Properties } from '../common';
3
+ import { Core, Dto, Properties } from '../common';
4
4
  import { TransactionReason, TransactionState, TransactionType } from '../../enums';
5
5
  export interface Transaction<Props extends Properties = Properties> extends Core<Props> {
6
6
  type: TransactionType;
@@ -18,4 +18,3 @@ export type TransactionDto = Dto<Omit<Transaction, 'payers' | 'payees'>> & {
18
18
  payees?: PayDto[];
19
19
  payers?: PayDto[];
20
20
  };
21
- export type TransactionItemsDto = Items<TransactionDto>;
@@ -1,6 +1,6 @@
1
1
  import type { Document } from 'mongoose';
2
2
  import { WalletProvider } from '../../enums';
3
- import { Core, Dto, Items, MakeOptional, Properties } from '../common';
3
+ import { Core, Dto, MakeOptional, Properties } from '../common';
4
4
  export interface Wallet<Props extends Properties = Properties> extends Core<Props> {
5
5
  coin: string;
6
6
  account: string;
@@ -14,4 +14,3 @@ export interface Wallet<Props extends Properties = Properties> extends Core<Prop
14
14
  }
15
15
  export type WalletDoc = Wallet & Document;
16
16
  export type WalletDto = Dto<MakeOptional<Wallet, 'provider'>>;
17
- export type WalletItemsDto = Items<WalletDto>;
@@ -1,6 +1,6 @@
1
1
  import type { Document } from 'mongoose';
2
2
  import { ValueType } from '../../enums';
3
- import { Core, Dto, Items, Properties } from '../common';
3
+ import { Core, Dto, Properties } from '../common';
4
4
  export interface Artifact<T = any, Props extends Properties = Properties> extends Core<Props> {
5
5
  key: string;
6
6
  type: ValueType;
@@ -8,4 +8,3 @@ export interface Artifact<T = any, Props extends Properties = Properties> extend
8
8
  }
9
9
  export type ArtifactDoc<T = any> = Artifact<T> & Document;
10
10
  export type ArtifactDto<T = any> = Dto<Artifact<T>>;
11
- export type ArtifactItemsDto = Items<ArtifactDto>;
@@ -1,7 +1,7 @@
1
1
  import type { Document } from 'mongoose';
2
2
  import { WorkflowStatus } from '../../../enums';
3
3
  import { WorkflowToken } from './token.interface';
4
- import { Core, Dto, Items, Properties } from '../../common';
4
+ import { Core, Dto, Properties } from '../../common';
5
5
  export interface Workflow<D = any, V = any, Props extends Properties = Properties> extends Core<Props> {
6
6
  entity: string;
7
7
  identity: string;
@@ -13,4 +13,3 @@ export type WorkflowDoc<D = any, V = any> = Workflow<D, V> & Document;
13
13
  export type WorkflowDto<D = any, V = any> = Dto<Omit<Workflow<D, V>, 'tokens'> & {
14
14
  tokens: WorkflowToken<V>[];
15
15
  }>;
16
- export type WorkflowItemsDto = Items<WorkflowDto>;
@@ -1,6 +1,6 @@
1
1
  import type { Document } from 'mongoose';
2
2
  import { Gender, ProfileType, State } from '../../enums';
3
- import { Core, Dto, Items, MakeOptional, Properties } from '../common';
3
+ import { Core, Dto, MakeOptional, Properties } from '../common';
4
4
  export interface Profile<Props extends Properties = Properties> extends Core<Props> {
5
5
  type: ProfileType;
6
6
  state: State;
@@ -20,4 +20,3 @@ export interface Profile<Props extends Properties = Properties> extends Core<Pro
20
20
  }
21
21
  export type ProfileDoc = Profile & Document;
22
22
  export type ProfileDto = Dto<MakeOptional<Profile, 'state' | 'gender' | 'type'>>;
23
- export type ProfileItemsDto = Items<ProfileDto>;
@@ -1,5 +1,5 @@
1
1
  import type { Document } from 'mongoose';
2
- import { Core, Dto, Items, Properties } from '../common';
2
+ import { Core, Dto, Properties } from '../common';
3
3
  export interface Session<Props extends Properties = Properties> extends Core<Props> {
4
4
  ip: string;
5
5
  agent: string;
@@ -7,4 +7,3 @@ export interface Session<Props extends Properties = Properties> extends Core<Pro
7
7
  }
8
8
  export type SessionDoc = Session & Document;
9
9
  export type SessionDto = Dto<Session>;
10
- export type SessionItemsDto = Items<SessionDto>;
@@ -1,6 +1,6 @@
1
1
  import type { Document } from 'mongoose';
2
2
  import { Status, UserMFA, UserOAuth } from '../../enums';
3
- import { Core, Dto, Items, MakeOptional, Properties } from '../common';
3
+ import { Core, Dto, MakeOptional, Properties } from '../common';
4
4
  export interface User<Props extends Properties = Properties> extends Core<Props> {
5
5
  status: Status;
6
6
  tz: string;
@@ -16,4 +16,3 @@ export interface User<Props extends Properties = Properties> extends Core<Props>
16
16
  }
17
17
  export type UserDoc = User & Document;
18
18
  export type UserDto = Dto<MakeOptional<User, 'tz' | 'lang'>>;
19
- export type UserItemsDto = Items<UserDto>;
@@ -1,5 +1,5 @@
1
1
  import type { Document } from 'mongoose';
2
- import { Core, Dto, Items, Properties } from '../common';
2
+ import { Core, Dto, Properties } from '../common';
3
3
  export interface Cargo<Props extends Properties = Properties> extends Core<Props> {
4
4
  title?: string;
5
5
  product?: string;
@@ -13,4 +13,3 @@ export interface Cargo<Props extends Properties = Properties> extends Core<Props
13
13
  }
14
14
  export type CargoDoc = Cargo & Document;
15
15
  export type CargoDto = Dto<Cargo>;
16
- export type CargoItemsDto = Items<CargoDto>;
@@ -1,6 +1,6 @@
1
1
  import type { Document } from 'mongoose';
2
2
  import { DriverType, Gender, State, Status } from '../../enums';
3
- import { Core, Dto, Items, MakeOptional, Properties } from '../common';
3
+ import { Core, Dto, MakeOptional, Properties } from '../common';
4
4
  export interface Driver<Props extends Properties = Properties> extends Core<Props> {
5
5
  type: DriverType;
6
6
  gender: Gender;
@@ -14,4 +14,3 @@ export interface Driver<Props extends Properties = Properties> extends Core<Prop
14
14
  }
15
15
  export type DriverDoc = Driver & Document;
16
16
  export type DriverDto = Dto<MakeOptional<Driver, 'state' | 'status'>>;
17
- export type DriverItemsDto = Items<DriverDto>;
@@ -1,9 +1,8 @@
1
1
  import type { Document } from 'mongoose';
2
- import { Core, Dto, Geometry, Items, Properties } from '../../common';
2
+ import { Core, Dto, Geometry, Properties } from '../../common';
3
3
  export interface Location<Props extends Properties = Properties> extends Core<Props> {
4
4
  identity?: string;
5
5
  geometry: Geometry;
6
6
  }
7
7
  export type LocationDoc = Location & Document;
8
8
  export type LocationDto = Dto<Location>;
9
- export type LocationItemsDto = Items<LocationDto>;
@@ -1,5 +1,5 @@
1
1
  import type { Document } from 'mongoose';
2
- import { Core, Dto, Items, Properties } from '../common';
2
+ import { Core, Dto, Properties } from '../common';
3
3
  export interface Travel<Props extends Properties = Properties> extends Core<Props> {
4
4
  cargoes?: string[];
5
5
  drivers?: string[];
@@ -8,4 +8,3 @@ export interface Travel<Props extends Properties = Properties> extends Core<Prop
8
8
  }
9
9
  export type TravelDoc = Travel & Document;
10
10
  export type TravelDto = Dto<Travel>;
11
- export type TravelItemsDto = Items<TravelDto>;
@@ -1,6 +1,6 @@
1
1
  import type { Document } from 'mongoose';
2
2
  import { Status, VehicleType } from '../../enums';
3
- import { Core, Dto, Items, MakeOptional, Properties } from '../common';
3
+ import { Core, Dto, MakeOptional, Properties } from '../common';
4
4
  export interface Vehicle<Props extends Properties = Properties> extends Core<Props> {
5
5
  type: VehicleType;
6
6
  status: Status;
@@ -9,4 +9,3 @@ export interface Vehicle<Props extends Properties = Properties> extends Core<Pro
9
9
  }
10
10
  export type VehicleDoc = Vehicle & Document;
11
11
  export type VehicleDto = Dto<MakeOptional<Vehicle, 'status'>>;
12
- export type VehicleItemsDto = Items<VehicleDto>;
@@ -1,5 +1,5 @@
1
1
  import type { Document } from 'mongoose';
2
- import { Core, Dto, Items, Properties } from '../common';
2
+ import { Core, Dto, Properties } from '../common';
3
3
  export interface File<Props extends Properties = Properties> extends Core<Props> {
4
4
  field?: string;
5
5
  original: string;
@@ -16,4 +16,3 @@ export interface File<Props extends Properties = Properties> extends Core<Props>
16
16
  }
17
17
  export type FileDoc = File & Document;
18
18
  export type FileDto = Dto<File>;
19
- export type FileItemsDto = Items<FileDto>;
@@ -10,4 +10,4 @@ export interface SagaHistory<Req = any, Res = any> extends Core {
10
10
  }
11
11
  export type SagaHistoryDoc<Req = any, Res = any> = SagaHistory<Req, Res> & Document;
12
12
  export type SagaHistoryDto<Req = any, Res = any> = Dto<SagaHistory<Req, Res>>;
13
- export type SagaHistoryAppend<Req = any, Res = any> = Dto<MakeOptional<SagaHistory<Req, Res>, 'res'>>;
13
+ export type SagaHistoryAppendDto<Req = any, Res = any> = Dto<MakeOptional<SagaHistory<Req, Res>, 'res'>>;
@@ -12,4 +12,4 @@ export interface Saga extends Core {
12
12
  export type SagaDoc = Saga & Document;
13
13
  export type SagaDto = Dto<MakeOptional<Saga, 'state'>>;
14
14
  export type SagaId = Pick<Saga, 'id'>;
15
- export type SagaStart = Dto<MakeOptional<Saga, 'job' | 'state' | 'session'>>;
15
+ export type SagaStartDto = Dto<MakeOptional<Saga, 'job' | 'state' | 'session'>>;
@@ -1,6 +1,6 @@
1
1
  import type { Document } from 'mongoose';
2
2
  import { MailSmtp } from './smtp.interface';
3
- import { Core, Dto, Items, MakeOptional, Properties } from '../../common';
3
+ import { Core, Dto, MakeOptional, Properties } from '../../common';
4
4
  export interface Mail<Props extends Properties = Properties> extends Core<Props> {
5
5
  to: string[];
6
6
  cc?: string[];
@@ -17,4 +17,3 @@ export interface Mail<Props extends Properties = Properties> extends Core<Props>
17
17
  }
18
18
  export type MailDoc = Mail & Document;
19
19
  export type MailDto = Dto<MakeOptional<Mail, 'from'>>;
20
- export type MailItemsDto = Items<MailDto>;
@@ -1,6 +1,6 @@
1
1
  import type { Document } from 'mongoose';
2
2
  import { PushKeys } from './keys.interface';
3
- import { Core, Dto, Items, MakeOptional, Properties } from '../../common';
3
+ import { Core, Dto, MakeOptional, Properties } from '../../common';
4
4
  export interface Push<Props extends Properties = Properties> extends Core<Props> {
5
5
  domain: string;
6
6
  session: string;
@@ -13,4 +13,3 @@ export interface Push<Props extends Properties = Properties> extends Core<Props>
13
13
  }
14
14
  export type PushDoc = Push & Document;
15
15
  export type PushDto = Dto<MakeOptional<Push, 'domain' | 'session' | 'identity'>>;
16
- export type PushItemsDto = Items<PushDto>;
@@ -1,2 +1,3 @@
1
1
  export declare function toJSON<T = any>(val: string): T;
2
2
  export declare function toDate(val: string | number | Date): Date;
3
+ export declare function toString<T = any>(val: T): string;
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.toJSON = toJSON;
5
5
  exports.toDate = toDate;
6
+ exports.toString = toString;
6
7
  function toJSON(val) {
7
8
  try {
8
9
  return JSON.parse(val);
@@ -19,4 +20,12 @@ function toDate(val) {
19
20
  return val;
20
21
  }
21
22
  }
23
+ function toString(val) {
24
+ try {
25
+ return typeof val === 'string' ? val : JSON.stringify(val);
26
+ }
27
+ catch (_a) {
28
+ return String(val);
29
+ }
30
+ }
22
31
  //# sourceMappingURL=transform.util.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transform.util.js","sourceRoot":"","sources":["../../src/common/utils/transform.util.ts"],"names":[],"mappings":";AAAA,uDAAuD;;AAEvD,wBAMC;AAED,wBAMC;AAdD,SAAgB,MAAM,CAAU,GAAW;IACzC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,GAAQ,CAAC;IAClB,CAAC;AACH,CAAC;AAED,SAAgB,MAAM,CAAC,GAA2B;IAChD,IAAI,CAAC;QACH,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,GAAW,CAAC;IACrB,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"transform.util.js","sourceRoot":"","sources":["../../src/common/utils/transform.util.ts"],"names":[],"mappings":";AAAA,uDAAuD;;AAEvD,wBAMC;AAED,wBAMC;AAED,4BAMC;AAtBD,SAAgB,MAAM,CAAU,GAAW;IACzC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,GAAQ,CAAC;IAClB,CAAC;AACH,CAAC;AAED,SAAgB,MAAM,CAAC,GAA2B;IAChD,IAAI,CAAC;QACH,OAAO,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,GAAW,CAAC;IACrB,CAAC;AACH,CAAC;AAED,SAAgB,QAAQ,CAAU,GAAM;IACtC,IAAI,CAAC;QACH,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC7D,CAAC;IAAC,WAAM,CAAC;QACP,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wenex/sdk",
3
- "version": "0.7.5",
3
+ "version": "0.7.7",
4
4
  "description": "Wenex SDK",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -1,10 +1,14 @@
1
1
  import type { AxiosInstance } from 'axios';
2
- import { RestfulService } from '../../../common/classes';
2
+ import { Saga, SagaDto, SagaHistory, SagaHistoryAppendDto, SagaStartDto, Serializer } from '../../../common/interfaces';
3
3
  import { SagaHistoriesService } from './history.service';
4
- import { Saga, SagaDto } from '../../../common/interfaces';
4
+ import { RequestConfig, RestfulService } from '../../../common/classes';
5
5
  export declare class SagasService extends RestfulService<Saga, SagaDto> {
6
6
  protected axios: AxiosInstance;
7
7
  protected $histories?: SagaHistoriesService;
8
8
  constructor(axios: AxiosInstance);
9
9
  get histories(): SagaHistoriesService;
10
+ start(data: SagaStartDto, config?: RequestConfig<Saga>): Promise<Serializer<Saga>>;
11
+ append(data: SagaHistoryAppendDto, config?: RequestConfig<SagaHistory>): Promise<Serializer<SagaHistory>>;
12
+ commit(id: string, config?: RequestConfig<Saga>): Promise<Serializer<Saga>>;
13
+ abort(id: string, config?: RequestConfig<Saga>): Promise<Serializer<Saga>>;
10
14
  }
@@ -1,8 +1,17 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.SagasService = void 0;
4
- const classes_1 = require("../../../common/classes");
5
13
  const history_service_1 = require("./history.service");
14
+ const classes_1 = require("../../../common/classes");
6
15
  class SagasService extends classes_1.RestfulService {
7
16
  constructor(axios) {
8
17
  super('sagas', axios);
@@ -12,6 +21,26 @@ class SagasService extends classes_1.RestfulService {
12
21
  var _a;
13
22
  return (this.$histories = (_a = this.$histories) !== null && _a !== void 0 ? _a : new history_service_1.SagaHistoriesService(this.axios));
14
23
  }
24
+ start(data, config) {
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ return (yield this.post(this.url('start'), data, config)).data;
27
+ });
28
+ }
29
+ append(data, config) {
30
+ return __awaiter(this, void 0, void 0, function* () {
31
+ return (yield this.post(this.url('append'), data, config)).data;
32
+ });
33
+ }
34
+ commit(id, config) {
35
+ return __awaiter(this, void 0, void 0, function* () {
36
+ return (yield this.patch(this.url(`${id}/commit`), undefined, config)).data;
37
+ });
38
+ }
39
+ abort(id, config) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ return (yield this.patch(this.url(`${id}/abort`), undefined, config)).data;
42
+ });
43
+ }
15
44
  }
16
45
  exports.SagasService = SagasService;
17
46
  //# sourceMappingURL=sagas.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sagas.service.js","sourceRoot":"","sources":["../../../src/services/special/sagas/sagas.service.ts"],"names":[],"mappings":";;;AAEA,qDAAyD;AACzD,uDAAyD;AAGzD,MAAa,YAAa,SAAQ,wBAA6B;IAG7D,YAAsB,KAAoB;QACxC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QADF,UAAK,GAAL,KAAK,CAAe;IAE1C,CAAC;IAED,IAAI,SAAS;;QACX,OAAO,CAAC,IAAI,CAAC,UAAU,GAAG,MAAA,IAAI,CAAC,UAAU,mCAAI,IAAI,sCAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACrF,CAAC;CACF;AAVD,oCAUC"}
1
+ {"version":3,"file":"sagas.service.js","sourceRoot":"","sources":["../../../src/services/special/sagas/sagas.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAWA,uDAAyD;AACzD,qDAAwE;AAExE,MAAa,YAAa,SAAQ,wBAA6B;IAG7D,YAAsB,KAAoB;QACxC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QADF,UAAK,GAAL,KAAK,CAAe;IAE1C,CAAC;IAED,IAAI,SAAS;;QACX,OAAO,CAAC,IAAI,CAAC,UAAU,GAAG,MAAA,IAAI,CAAC,UAAU,mCAAI,IAAI,sCAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACrF,CAAC;IAEK,KAAK,CACT,IAAkB,EAClB,MAA4B;;YAE5B,OAAO,CACL,MAAM,IAAI,CAAC,IAAI,CACb,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,EACjB,IAAI,EACJ,MAAM,CACP,CACF,CAAC,IAAI,CAAC;QACT,CAAC;KAAA;IAEK,MAAM,CACV,IAA0B,EAC1B,MAAmC;;YAEnC,OAAO,CACL,MAAM,IAAI,CAAC,IAAI,CACb,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,EAClB,IAAI,EACJ,MAAM,CACP,CACF,CAAC,IAAI,CAAC;QACT,CAAC;KAAA;IAEK,MAAM,CAAC,EAAU,EAAE,MAA4B;;YACnD,OAAO,CACL,MAAM,IAAI,CAAC,KAAK,CACd,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,SAAS,CAAC,EACxB,SAAS,EACT,MAAM,CACP,CACF,CAAC,IAAI,CAAC;QACT,CAAC;KAAA;IAEK,KAAK,CAAC,EAAU,EAAE,MAA4B;;YAClD,OAAO,CACL,MAAM,IAAI,CAAC,KAAK,CACd,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,EACvB,SAAS,EACT,MAAM,CACP,CACF,CAAC,IAAI,CAAC;QACT,CAAC;KAAA;CACF;AAxDD,oCAwDC"}