wowok 1.6.61 → 1.6.63

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,80 +1,83 @@
1
+ "use strict";
1
2
  /**
2
3
  * Provide a call interface for AI
3
4
  *
4
5
  */
5
- import { PermissionIndex } from '../permission';
6
- export const AGENT_FUNC = [
7
- { permissionIndex: PermissionIndex.repository, name: 'Repository', description: 'Launch new Repository', module: 'repository', parameter: [
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.AGENT_FUNC = void 0;
8
+ var permission_1 = require("../permission");
9
+ exports.AGENT_FUNC = [
10
+ { permissionIndex: permission_1.PermissionIndex.repository, name: 'Repository', description: 'Launch new Repository', module: 'repository', parameter: [
8
11
  { type: 'PermissionObject', name: 'permission', description: 'Permission address or object', required: true },
9
12
  { type: '"Relax mode" or "Strict mode"', name: 'mode', description: 'Relax mode: Allows entry of data other than policy. Used for informal, non-consensus situations.\nStrict mode: Prohibits entry of data beyond policy. Used in formal, fully consensus contexts.', required: false },
10
13
  ] },
11
- { permissionIndex: PermissionIndex.repository_description, name: 'Description', description: 'Set Repository description', module: 'repository', parameter: [
14
+ { permissionIndex: permission_1.PermissionIndex.repository_description, name: 'Description', description: 'Set Repository description', module: 'repository', parameter: [
12
15
  { type: 'DemandObject', name: 'demand', description: 'Demand address or object', required: true },
13
16
  { type: 'string', name: 'description', description: 'Demand description', required: true },
14
17
  ] },
15
- { permissionIndex: PermissionIndex.repository_policy_mode, name: 'Policy mode', description: 'Set Repository policy mode', module: 'repository', parameter: [] },
16
- { permissionIndex: PermissionIndex.repository_policies, name: 'Policy', description: 'Add/Remove/Edit Repository policy', module: 'repository', parameter: [] },
17
- { permissionIndex: PermissionIndex.repository_policy_description, name: 'Policy Description', description: 'Set Repository policy description', module: 'repository', parameter: [] },
18
- { permissionIndex: PermissionIndex.repository_policy_permission, name: 'Policy Permission', description: 'Set Repository policy permission', module: 'repository', parameter: [] },
19
- { permissionIndex: PermissionIndex.repository_reference, name: 'Reference', description: 'Set Repository reference', module: 'repository', parameter: [] },
20
- { permissionIndex: PermissionIndex.service, name: 'Service', description: 'Launch new Service', module: 'service', parameter: [] },
21
- { permissionIndex: PermissionIndex.service_description, name: 'Description', description: 'Set Service description', module: 'service', parameter: [] },
22
- { permissionIndex: PermissionIndex.service_price, name: 'Price', description: 'Set Service item price', module: 'service', parameter: [] },
23
- { permissionIndex: PermissionIndex.service_stock, name: 'Inventory', description: 'Set Service item inventory', module: 'service', parameter: [] },
24
- { permissionIndex: PermissionIndex.service_payee, name: 'Payee', description: 'Set Service payee', module: 'service', parameter: [] },
25
- { permissionIndex: PermissionIndex.service_repository, name: 'Repository', description: 'Set Service repositories', module: 'service', parameter: [] },
26
- { permissionIndex: PermissionIndex.service_withdraw_guards, name: 'Withdraw Guard', description: 'Set Service withdraw guards', module: 'service', parameter: [] },
27
- { permissionIndex: PermissionIndex.service_refund_guards, name: 'Refund Guard', description: 'Set Service refund guards', module: 'service', parameter: [] },
28
- { permissionIndex: PermissionIndex.service_add_sales, name: 'Add sales', description: 'Add sale items for Service', module: 'service', parameter: [] },
29
- { permissionIndex: PermissionIndex.service_remove_sales, name: 'Remove sales', description: 'Remove sale items for Service', module: 'service', parameter: [] },
30
- { permissionIndex: PermissionIndex.service_discount_transfer, name: 'Discount', description: 'Launch discounts for Service', module: 'service', parameter: [] },
31
- { permissionIndex: PermissionIndex.service_withdraw, name: 'Withdraw', description: 'Widthraw from Service orders', module: 'service', parameter: [] },
32
- { permissionIndex: PermissionIndex.service_buyer_guard, name: 'Buyer Guard', description: 'Set Guard of buying for Service', module: 'service', parameter: [] },
33
- { permissionIndex: PermissionIndex.service_machine, name: 'Machine', description: 'Set Machine for Service', module: 'service', parameter: [] },
34
- { permissionIndex: PermissionIndex.service_endpoint, name: 'Endpoint', description: 'Set Service endpoint', module: 'service', parameter: [] },
35
- { permissionIndex: PermissionIndex.service_publish, name: 'Publish', description: 'Allowing the creation of Order', module: 'service', parameter: [] },
36
- { permissionIndex: PermissionIndex.service_clone, name: 'Clone', description: 'Clone Service', module: 'service', parameter: [] },
37
- { permissionIndex: PermissionIndex.service_customer_required, name: 'Buyer info', description: 'Set Service buyer info required', module: 'service', parameter: [] },
38
- { permissionIndex: PermissionIndex.service_pause, name: 'Pause', description: 'Pause/Unpause Service', module: 'service', parameter: [] },
39
- { permissionIndex: PermissionIndex.service_treasury, name: 'Treasury', description: 'Externally withdrawable treasury for compensation or rewards', module: 'service', parameter: [] },
40
- { permissionIndex: PermissionIndex.service_arbitration, name: 'Arbitration', description: 'Add/Remove arbitration that allows refunds from orders at any time based on arbitration results', module: 'service', parameter: [] },
41
- { permissionIndex: PermissionIndex.demand, name: 'Demand', description: 'Launch new Demand', module: 'demand', parameter: [] },
42
- { permissionIndex: PermissionIndex.demand_refund, name: 'Refund', description: 'Refund from Demand', module: 'demand', parameter: [] },
43
- { permissionIndex: PermissionIndex.demand_expand_time, name: 'Expand deadline', description: 'Expand Demand deadline', module: 'demand', parameter: [] },
44
- { permissionIndex: PermissionIndex.demand_guard, name: 'Guard', description: 'Set Demand guard', module: 'demand', parameter: [] },
45
- { permissionIndex: PermissionIndex.demand_description, name: 'Description', description: 'Set Demand description', module: 'demand', parameter: [] },
46
- { permissionIndex: PermissionIndex.demand_yes, name: 'Yes', description: 'Pick the Deamand serice', module: 'demand', parameter: [] },
47
- { permissionIndex: PermissionIndex.machine, name: 'Machine', description: 'Launch new Machine', module: 'machine', parameter: [] },
48
- { permissionIndex: PermissionIndex.machine_description, name: 'Description', description: 'Set Machine description', module: 'machine', parameter: [] },
49
- { permissionIndex: PermissionIndex.machine_repository, name: 'Repository', description: 'Set Machine repository', module: 'machine', parameter: [] },
50
- { permissionIndex: PermissionIndex.machine_clone, name: 'Clone', description: 'Clone Machine', module: 'machine', parameter: [] },
51
- { permissionIndex: PermissionIndex.machine_node, name: 'Node', description: 'Set Machine nodes', module: 'machine', parameter: [] },
52
- { permissionIndex: PermissionIndex.machine_endpoint, name: 'Endpoint', description: 'Set Machine endpoint', module: 'machine', parameter: [] },
53
- { permissionIndex: PermissionIndex.machine_pause, name: 'Pause', description: 'Pause/Unpause Machine', module: 'machine', parameter: [] },
54
- { permissionIndex: PermissionIndex.machine_publish, name: 'Publish', description: 'Allowing the creation of Progress', module: 'machine', parameter: [] },
55
- { permissionIndex: PermissionIndex.progress, name: 'Progress', description: 'Launch new Progress', module: 'progress', parameter: [] },
56
- { permissionIndex: PermissionIndex.progress_namedOperator, name: 'Operator', description: 'Set Progress operators', module: 'progress', parameter: [] },
57
- { permissionIndex: PermissionIndex.progress_bind_task, name: 'Bind', description: 'Set Progress task', module: 'progress', parameter: [] },
58
- { permissionIndex: PermissionIndex.progress_context_repository, name: 'Repository', description: 'Set Progress repository', module: 'progress', parameter: [] },
59
- { permissionIndex: PermissionIndex.progress_unhold, name: 'Unhold', description: 'Release Progress holdings', module: 'progress', parameter: [] },
60
- { permissionIndex: PermissionIndex.progress_parent, name: 'Parent', description: 'Set Progress parent', module: 'progress', parameter: [] },
61
- { permissionIndex: PermissionIndex.treasury, name: 'Treasury', description: 'Launch new Treasury', module: 'treasury', parameter: [] },
62
- { permissionIndex: PermissionIndex.treasury_deposit, name: 'Deposit', description: 'Deposit coins', module: 'treasury', parameter: [] },
63
- { permissionIndex: PermissionIndex.treasury_receive, name: 'Receive', description: 'Receive coins from some address sent', module: 'treasury', parameter: [] },
64
- { permissionIndex: PermissionIndex.treasury_withdraw, name: 'Withdraw', description: 'Withdraw coins', module: 'treasury', parameter: [] },
65
- { permissionIndex: PermissionIndex.treasury_withdraw_guard, name: 'Withdraw Guard', description: 'Add/Remove Treasury withdraw guard', module: 'treasury', parameter: [] },
66
- { permissionIndex: PermissionIndex.treasury_withdraw_mode, name: 'Withdraw mode', description: 'Set Treasury withdraw mode', module: 'treasury', parameter: [] },
67
- { permissionIndex: PermissionIndex.treasury_deposit_guard, name: 'Deposit Guard', description: 'Set Treasury deposit guard', module: 'treasury', parameter: [] },
68
- { permissionIndex: PermissionIndex.treasury_descritption, name: 'Description', description: 'Set Treasury description', module: 'treasury', parameter: [] },
69
- { permissionIndex: PermissionIndex.arbitration, name: 'Arbitration', description: 'Launch new Arbitration', module: 'arbitration', parameter: [] },
70
- { permissionIndex: PermissionIndex.arbitration_description, name: 'Description', description: 'Set Arbitration description', module: 'arbitration', parameter: [] },
71
- { permissionIndex: PermissionIndex.arbitration_endpoint, name: 'Endpoint', description: 'Set Arbitration endpoint', module: 'arbitration', parameter: [] },
72
- { permissionIndex: PermissionIndex.arbitration_fee, name: 'Fee', description: 'Set Arbitration fee', module: 'arbitration', parameter: [] },
73
- { permissionIndex: PermissionIndex.arbitration_guard, name: 'Guard', description: 'Set Guard to apply for arbitration', module: 'arbitration', parameter: [] },
74
- { permissionIndex: PermissionIndex.arbitration_arbitration, name: 'Arbitrate', description: 'Determine the outcome of arbitration', module: 'arbitration', parameter: [] },
75
- { permissionIndex: PermissionIndex.arbitration_pause, name: 'Pause', description: 'Allowing/forbidding the creation of Arb', module: 'arbitration', parameter: [] },
76
- { permissionIndex: PermissionIndex.arbitration_voting_guard, name: 'Voting Guard', description: 'Add/Remove voting Guard', module: 'arbitration', parameter: [] },
77
- { permissionIndex: PermissionIndex.arbitration_vote, name: 'Vote', description: 'Vote on the application for arbitration', module: 'arbitration', parameter: [] },
78
- { permissionIndex: PermissionIndex.arbitration_withdraw, name: 'Withdraw', description: 'Withdraw the arbitration fee', module: 'arbitration', parameter: [] },
79
- { permissionIndex: PermissionIndex.arbitration_treasury, name: 'Withdraw', description: 'Set Treasury that fees was collected at the time of withdrawal', module: 'arbitration', parameter: [] },
18
+ { permissionIndex: permission_1.PermissionIndex.repository_policy_mode, name: 'Policy mode', description: 'Set Repository policy mode', module: 'repository', parameter: [] },
19
+ { permissionIndex: permission_1.PermissionIndex.repository_policies, name: 'Policy', description: 'Add/Remove/Edit Repository policy', module: 'repository', parameter: [] },
20
+ { permissionIndex: permission_1.PermissionIndex.repository_policy_description, name: 'Policy Description', description: 'Set Repository policy description', module: 'repository', parameter: [] },
21
+ { permissionIndex: permission_1.PermissionIndex.repository_policy_permission, name: 'Policy Permission', description: 'Set Repository policy permission', module: 'repository', parameter: [] },
22
+ { permissionIndex: permission_1.PermissionIndex.repository_reference, name: 'Reference', description: 'Set Repository reference', module: 'repository', parameter: [] },
23
+ { permissionIndex: permission_1.PermissionIndex.service, name: 'Service', description: 'Launch new Service', module: 'service', parameter: [] },
24
+ { permissionIndex: permission_1.PermissionIndex.service_description, name: 'Description', description: 'Set Service description', module: 'service', parameter: [] },
25
+ { permissionIndex: permission_1.PermissionIndex.service_price, name: 'Price', description: 'Set Service item price', module: 'service', parameter: [] },
26
+ { permissionIndex: permission_1.PermissionIndex.service_stock, name: 'Inventory', description: 'Set Service item inventory', module: 'service', parameter: [] },
27
+ { permissionIndex: permission_1.PermissionIndex.service_payee, name: 'Payee', description: 'Set Service payee', module: 'service', parameter: [] },
28
+ { permissionIndex: permission_1.PermissionIndex.service_repository, name: 'Repository', description: 'Set Service repositories', module: 'service', parameter: [] },
29
+ { permissionIndex: permission_1.PermissionIndex.service_withdraw_guards, name: 'Withdraw Guard', description: 'Set Service withdraw guards', module: 'service', parameter: [] },
30
+ { permissionIndex: permission_1.PermissionIndex.service_refund_guards, name: 'Refund Guard', description: 'Set Service refund guards', module: 'service', parameter: [] },
31
+ { permissionIndex: permission_1.PermissionIndex.service_add_sales, name: 'Add sales', description: 'Add sale items for Service', module: 'service', parameter: [] },
32
+ { permissionIndex: permission_1.PermissionIndex.service_remove_sales, name: 'Remove sales', description: 'Remove sale items for Service', module: 'service', parameter: [] },
33
+ { permissionIndex: permission_1.PermissionIndex.service_discount_transfer, name: 'Discount', description: 'Launch discounts for Service', module: 'service', parameter: [] },
34
+ { permissionIndex: permission_1.PermissionIndex.service_withdraw, name: 'Withdraw', description: 'Widthraw from Service orders', module: 'service', parameter: [] },
35
+ { permissionIndex: permission_1.PermissionIndex.service_buyer_guard, name: 'Buyer Guard', description: 'Set Guard of buying for Service', module: 'service', parameter: [] },
36
+ { permissionIndex: permission_1.PermissionIndex.service_machine, name: 'Machine', description: 'Set Machine for Service', module: 'service', parameter: [] },
37
+ { permissionIndex: permission_1.PermissionIndex.service_endpoint, name: 'Endpoint', description: 'Set Service endpoint', module: 'service', parameter: [] },
38
+ { permissionIndex: permission_1.PermissionIndex.service_publish, name: 'Publish', description: 'Allowing the creation of Order', module: 'service', parameter: [] },
39
+ { permissionIndex: permission_1.PermissionIndex.service_clone, name: 'Clone', description: 'Clone Service', module: 'service', parameter: [] },
40
+ { permissionIndex: permission_1.PermissionIndex.service_customer_required, name: 'Buyer info', description: 'Set Service buyer info required', module: 'service', parameter: [] },
41
+ { permissionIndex: permission_1.PermissionIndex.service_pause, name: 'Pause', description: 'Pause/Unpause Service', module: 'service', parameter: [] },
42
+ { permissionIndex: permission_1.PermissionIndex.service_treasury, name: 'Treasury', description: 'Externally withdrawable treasury for compensation or rewards', module: 'service', parameter: [] },
43
+ { permissionIndex: permission_1.PermissionIndex.service_arbitration, name: 'Arbitration', description: 'Add/Remove arbitration that allows refunds from orders at any time based on arbitration results', module: 'service', parameter: [] },
44
+ { permissionIndex: permission_1.PermissionIndex.demand, name: 'Demand', description: 'Launch new Demand', module: 'demand', parameter: [] },
45
+ { permissionIndex: permission_1.PermissionIndex.demand_refund, name: 'Refund', description: 'Refund from Demand', module: 'demand', parameter: [] },
46
+ { permissionIndex: permission_1.PermissionIndex.demand_expand_time, name: 'Expand deadline', description: 'Expand Demand deadline', module: 'demand', parameter: [] },
47
+ { permissionIndex: permission_1.PermissionIndex.demand_guard, name: 'Guard', description: 'Set Demand guard', module: 'demand', parameter: [] },
48
+ { permissionIndex: permission_1.PermissionIndex.demand_description, name: 'Description', description: 'Set Demand description', module: 'demand', parameter: [] },
49
+ { permissionIndex: permission_1.PermissionIndex.demand_yes, name: 'Yes', description: 'Pick the Deamand serice', module: 'demand', parameter: [] },
50
+ { permissionIndex: permission_1.PermissionIndex.machine, name: 'Machine', description: 'Launch new Machine', module: 'machine', parameter: [] },
51
+ { permissionIndex: permission_1.PermissionIndex.machine_description, name: 'Description', description: 'Set Machine description', module: 'machine', parameter: [] },
52
+ { permissionIndex: permission_1.PermissionIndex.machine_repository, name: 'Repository', description: 'Set Machine repository', module: 'machine', parameter: [] },
53
+ { permissionIndex: permission_1.PermissionIndex.machine_clone, name: 'Clone', description: 'Clone Machine', module: 'machine', parameter: [] },
54
+ { permissionIndex: permission_1.PermissionIndex.machine_node, name: 'Node', description: 'Set Machine nodes', module: 'machine', parameter: [] },
55
+ { permissionIndex: permission_1.PermissionIndex.machine_endpoint, name: 'Endpoint', description: 'Set Machine endpoint', module: 'machine', parameter: [] },
56
+ { permissionIndex: permission_1.PermissionIndex.machine_pause, name: 'Pause', description: 'Pause/Unpause Machine', module: 'machine', parameter: [] },
57
+ { permissionIndex: permission_1.PermissionIndex.machine_publish, name: 'Publish', description: 'Allowing the creation of Progress', module: 'machine', parameter: [] },
58
+ { permissionIndex: permission_1.PermissionIndex.progress, name: 'Progress', description: 'Launch new Progress', module: 'progress', parameter: [] },
59
+ { permissionIndex: permission_1.PermissionIndex.progress_namedOperator, name: 'Operator', description: 'Set Progress operators', module: 'progress', parameter: [] },
60
+ { permissionIndex: permission_1.PermissionIndex.progress_bind_task, name: 'Bind', description: 'Set Progress task', module: 'progress', parameter: [] },
61
+ { permissionIndex: permission_1.PermissionIndex.progress_context_repository, name: 'Repository', description: 'Set Progress repository', module: 'progress', parameter: [] },
62
+ { permissionIndex: permission_1.PermissionIndex.progress_unhold, name: 'Unhold', description: 'Release Progress holdings', module: 'progress', parameter: [] },
63
+ { permissionIndex: permission_1.PermissionIndex.progress_parent, name: 'Parent', description: 'Set Progress parent', module: 'progress', parameter: [] },
64
+ { permissionIndex: permission_1.PermissionIndex.treasury, name: 'Treasury', description: 'Launch new Treasury', module: 'treasury', parameter: [] },
65
+ { permissionIndex: permission_1.PermissionIndex.treasury_deposit, name: 'Deposit', description: 'Deposit coins', module: 'treasury', parameter: [] },
66
+ { permissionIndex: permission_1.PermissionIndex.treasury_receive, name: 'Receive', description: 'Receive coins from some address sent', module: 'treasury', parameter: [] },
67
+ { permissionIndex: permission_1.PermissionIndex.treasury_withdraw, name: 'Withdraw', description: 'Withdraw coins', module: 'treasury', parameter: [] },
68
+ { permissionIndex: permission_1.PermissionIndex.treasury_withdraw_guard, name: 'Withdraw Guard', description: 'Add/Remove Treasury withdraw guard', module: 'treasury', parameter: [] },
69
+ { permissionIndex: permission_1.PermissionIndex.treasury_withdraw_mode, name: 'Withdraw mode', description: 'Set Treasury withdraw mode', module: 'treasury', parameter: [] },
70
+ { permissionIndex: permission_1.PermissionIndex.treasury_deposit_guard, name: 'Deposit Guard', description: 'Set Treasury deposit guard', module: 'treasury', parameter: [] },
71
+ { permissionIndex: permission_1.PermissionIndex.treasury_descritption, name: 'Description', description: 'Set Treasury description', module: 'treasury', parameter: [] },
72
+ { permissionIndex: permission_1.PermissionIndex.arbitration, name: 'Arbitration', description: 'Launch new Arbitration', module: 'arbitration', parameter: [] },
73
+ { permissionIndex: permission_1.PermissionIndex.arbitration_description, name: 'Description', description: 'Set Arbitration description', module: 'arbitration', parameter: [] },
74
+ { permissionIndex: permission_1.PermissionIndex.arbitration_endpoint, name: 'Endpoint', description: 'Set Arbitration endpoint', module: 'arbitration', parameter: [] },
75
+ { permissionIndex: permission_1.PermissionIndex.arbitration_fee, name: 'Fee', description: 'Set Arbitration fee', module: 'arbitration', parameter: [] },
76
+ { permissionIndex: permission_1.PermissionIndex.arbitration_guard, name: 'Guard', description: 'Set Guard to apply for arbitration', module: 'arbitration', parameter: [] },
77
+ { permissionIndex: permission_1.PermissionIndex.arbitration_arbitration, name: 'Arbitrate', description: 'Determine the outcome of arbitration', module: 'arbitration', parameter: [] },
78
+ { permissionIndex: permission_1.PermissionIndex.arbitration_pause, name: 'Pause', description: 'Allowing/forbidding the creation of Arb', module: 'arbitration', parameter: [] },
79
+ { permissionIndex: permission_1.PermissionIndex.arbitration_voting_guard, name: 'Voting Guard', description: 'Add/Remove voting Guard', module: 'arbitration', parameter: [] },
80
+ { permissionIndex: permission_1.PermissionIndex.arbitration_vote, name: 'Vote', description: 'Vote on the application for arbitration', module: 'arbitration', parameter: [] },
81
+ { permissionIndex: permission_1.PermissionIndex.arbitration_withdraw, name: 'Withdraw', description: 'Withdraw the arbitration fee', module: 'arbitration', parameter: [] },
82
+ { permissionIndex: permission_1.PermissionIndex.arbitration_treasury, name: 'Withdraw', description: 'Set Treasury that fees was collected at the time of withdrawal', module: 'arbitration', parameter: [] },
80
83
  ];
@@ -1,53 +1,122 @@
1
+ "use strict";
1
2
  /**
2
3
  * Provide AI with Basic WoWok event queries:
3
4
  * for real-time detail tracking.
4
5
  */
5
- import { Protocol } from '../protocol';
6
- export var EVENT_QUERY;
6
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
7
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
8
+ return new (P || (P = Promise))(function (resolve, reject) {
9
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
10
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
11
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
12
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
13
+ });
14
+ };
15
+ var __generator = (this && this.__generator) || function (thisArg, body) {
16
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
17
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
18
+ function verb(n) { return function (v) { return step([n, v]); }; }
19
+ function step(op) {
20
+ if (f) throw new TypeError("Generator is already executing.");
21
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
22
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
23
+ if (y = 0, t) op = [op[0] & 2, t.value];
24
+ switch (op[0]) {
25
+ case 0: case 1: t = op; break;
26
+ case 4: _.label++; return { value: op[1], done: false };
27
+ case 5: _.label++; y = op[1]; op = [0]; continue;
28
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
29
+ default:
30
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
31
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
32
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
33
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
34
+ if (t[2]) _.ops.pop();
35
+ _.trys.pop(); continue;
36
+ }
37
+ op = body.call(thisArg, _);
38
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
39
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
40
+ }
41
+ };
42
+ Object.defineProperty(exports, "__esModule", { value: true });
43
+ exports.EVENT_QUERY = void 0;
44
+ var protocol_1 = require("../protocol");
45
+ var EVENT_QUERY;
7
46
  (function (EVENT_QUERY) {
8
- EVENT_QUERY.newArbEvents = async (option) => {
9
- return await queryEvents(Protocol.Instance().Package('wowok') + '::arb::NewArbEvent', option);
10
- };
11
- EVENT_QUERY.presentServiceEvents = async (option) => {
12
- return await queryEvents(Protocol.Instance().Package('wowok') + '::demand::PresentEvent', option);
13
- };
14
- EVENT_QUERY.newProgressEvents = async (option) => {
15
- return await queryEvents(Protocol.Instance().Package('wowok') + '::progress::NewProgressEvent', option);
16
- };
17
- EVENT_QUERY.newOrderEvents = async (option) => {
18
- return await queryEvents(Protocol.Instance().Package('wowok') + '::order::NewOrderEvent', option);
19
- };
20
- const queryEvents = async (type, option) => {
21
- const res = await Protocol.Client().queryEvents({ query: { MoveEventType: type }, cursor: option?.cursor, limit: option?.limit, order: option?.order });
22
- const data = res?.data?.map((v) => {
23
- if (v?.packageId === Protocol.Instance().Package('wowok')) {
24
- if (v?.type?.includes('::order::NewOrderEvent')) {
25
- return {
26
- id: v?.id, time: v?.timestampMs, type_raw: v?.type, sender: v?.sender, type: 'NewOrderEvent',
27
- order: v?.parsedJson?.object, service: v?.parsedJson?.service, progress: v?.parsedJson?.progress, amount: v?.parsedJson?.amount
28
- };
29
- }
30
- else if (v?.type?.includes('::demand::PresentEvent')) {
31
- return {
32
- id: v?.id, time: v?.timestampMs, type_raw: v?.type, sender: v?.sender, type: 'NewOrderEvent',
33
- demand: v?.parsedJson?.object, service: v?.parsedJson?.service, recommendation: v?.parsedJson?.tips
34
- };
35
- }
36
- else if (v?.type?.includes('::progress::NewProgressEvent')) {
37
- return {
38
- id: v?.id, time: v?.timestampMs, type_raw: v?.type, sender: v?.sender, type: 'NewOrderEvent',
39
- progress: v?.parsedJson?.object, machine: v?.parsedJson?.machine, task: v?.parsedJson?.task
40
- };
41
- }
42
- else if (v?.type?.includes('::arb::NewArbEvent')) {
43
- return {
44
- id: v?.id, time: v?.timestampMs, type_raw: v?.type, sender: v?.sender, type: 'NewOrderEvent',
45
- arb: v?.parsedJson?.object, arbitration: v?.parsedJson?.arbitration, order: v?.parsedJson?.order
46
- };
47
- }
47
+ var _this = this;
48
+ EVENT_QUERY.newArbEvents = function (option) { return __awaiter(_this, void 0, void 0, function () {
49
+ return __generator(this, function (_a) {
50
+ switch (_a.label) {
51
+ case 0: return [4 /*yield*/, queryEvents(protocol_1.Protocol.Instance().Package('wowok') + '::arb::NewArbEvent', option)];
52
+ case 1: return [2 /*return*/, _a.sent()];
53
+ }
54
+ });
55
+ }); };
56
+ EVENT_QUERY.presentServiceEvents = function (option) { return __awaiter(_this, void 0, void 0, function () {
57
+ return __generator(this, function (_a) {
58
+ switch (_a.label) {
59
+ case 0: return [4 /*yield*/, queryEvents(protocol_1.Protocol.Instance().Package('wowok') + '::demand::PresentEvent', option)];
60
+ case 1: return [2 /*return*/, _a.sent()];
61
+ }
62
+ });
63
+ }); };
64
+ EVENT_QUERY.newProgressEvents = function (option) { return __awaiter(_this, void 0, void 0, function () {
65
+ return __generator(this, function (_a) {
66
+ switch (_a.label) {
67
+ case 0: return [4 /*yield*/, queryEvents(protocol_1.Protocol.Instance().Package('wowok') + '::progress::NewProgressEvent', option)];
68
+ case 1: return [2 /*return*/, _a.sent()];
69
+ }
70
+ });
71
+ }); };
72
+ EVENT_QUERY.newOrderEvents = function (option) { return __awaiter(_this, void 0, void 0, function () {
73
+ return __generator(this, function (_a) {
74
+ switch (_a.label) {
75
+ case 0: return [4 /*yield*/, queryEvents(protocol_1.Protocol.Instance().Package('wowok') + '::order::NewOrderEvent', option)];
76
+ case 1: return [2 /*return*/, _a.sent()];
77
+ }
78
+ });
79
+ }); };
80
+ var queryEvents = function (type, option) { return __awaiter(_this, void 0, void 0, function () {
81
+ var res, data;
82
+ var _a;
83
+ return __generator(this, function (_b) {
84
+ switch (_b.label) {
85
+ case 0: return [4 /*yield*/, protocol_1.Protocol.Client().queryEvents({ query: { MoveEventType: type }, cursor: option === null || option === void 0 ? void 0 : option.cursor, limit: option === null || option === void 0 ? void 0 : option.limit, order: option === null || option === void 0 ? void 0 : option.order })];
86
+ case 1:
87
+ res = _b.sent();
88
+ data = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.map(function (v) {
89
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
90
+ if ((v === null || v === void 0 ? void 0 : v.packageId) === protocol_1.Protocol.Instance().Package('wowok')) {
91
+ if ((_a = v === null || v === void 0 ? void 0 : v.type) === null || _a === void 0 ? void 0 : _a.includes('::order::NewOrderEvent')) {
92
+ return {
93
+ id: v === null || v === void 0 ? void 0 : v.id, time: v === null || v === void 0 ? void 0 : v.timestampMs, type_raw: v === null || v === void 0 ? void 0 : v.type, sender: v === null || v === void 0 ? void 0 : v.sender, type: 'NewOrderEvent',
94
+ order: (_b = v === null || v === void 0 ? void 0 : v.parsedJson) === null || _b === void 0 ? void 0 : _b.object, service: (_c = v === null || v === void 0 ? void 0 : v.parsedJson) === null || _c === void 0 ? void 0 : _c.service, progress: (_d = v === null || v === void 0 ? void 0 : v.parsedJson) === null || _d === void 0 ? void 0 : _d.progress, amount: (_e = v === null || v === void 0 ? void 0 : v.parsedJson) === null || _e === void 0 ? void 0 : _e.amount
95
+ };
96
+ }
97
+ else if ((_f = v === null || v === void 0 ? void 0 : v.type) === null || _f === void 0 ? void 0 : _f.includes('::demand::PresentEvent')) {
98
+ return {
99
+ id: v === null || v === void 0 ? void 0 : v.id, time: v === null || v === void 0 ? void 0 : v.timestampMs, type_raw: v === null || v === void 0 ? void 0 : v.type, sender: v === null || v === void 0 ? void 0 : v.sender, type: 'NewOrderEvent',
100
+ demand: (_g = v === null || v === void 0 ? void 0 : v.parsedJson) === null || _g === void 0 ? void 0 : _g.object, service: (_h = v === null || v === void 0 ? void 0 : v.parsedJson) === null || _h === void 0 ? void 0 : _h.service, recommendation: (_j = v === null || v === void 0 ? void 0 : v.parsedJson) === null || _j === void 0 ? void 0 : _j.tips
101
+ };
102
+ }
103
+ else if ((_k = v === null || v === void 0 ? void 0 : v.type) === null || _k === void 0 ? void 0 : _k.includes('::progress::NewProgressEvent')) {
104
+ return {
105
+ id: v === null || v === void 0 ? void 0 : v.id, time: v === null || v === void 0 ? void 0 : v.timestampMs, type_raw: v === null || v === void 0 ? void 0 : v.type, sender: v === null || v === void 0 ? void 0 : v.sender, type: 'NewOrderEvent',
106
+ progress: (_l = v === null || v === void 0 ? void 0 : v.parsedJson) === null || _l === void 0 ? void 0 : _l.object, machine: (_m = v === null || v === void 0 ? void 0 : v.parsedJson) === null || _m === void 0 ? void 0 : _m.machine, task: (_o = v === null || v === void 0 ? void 0 : v.parsedJson) === null || _o === void 0 ? void 0 : _o.task
107
+ };
108
+ }
109
+ else if ((_p = v === null || v === void 0 ? void 0 : v.type) === null || _p === void 0 ? void 0 : _p.includes('::arb::NewArbEvent')) {
110
+ return {
111
+ id: v === null || v === void 0 ? void 0 : v.id, time: v === null || v === void 0 ? void 0 : v.timestampMs, type_raw: v === null || v === void 0 ? void 0 : v.type, sender: v === null || v === void 0 ? void 0 : v.sender, type: 'NewOrderEvent',
112
+ arb: (_q = v === null || v === void 0 ? void 0 : v.parsedJson) === null || _q === void 0 ? void 0 : _q.object, arbitration: (_r = v === null || v === void 0 ? void 0 : v.parsedJson) === null || _r === void 0 ? void 0 : _r.arbitration, order: (_s = v === null || v === void 0 ? void 0 : v.parsedJson) === null || _s === void 0 ? void 0 : _s.order
113
+ };
114
+ }
115
+ }
116
+ return { id: v === null || v === void 0 ? void 0 : v.id, time: v === null || v === void 0 ? void 0 : v.timestampMs, type_raw: v === null || v === void 0 ? void 0 : v.type, sender: v === null || v === void 0 ? void 0 : v.sender, type: '', };
117
+ });
118
+ return [2 /*return*/, { data: data, hasNextPage: res === null || res === void 0 ? void 0 : res.hasNextPage, nextCursor: res === null || res === void 0 ? void 0 : res.nextCursor }];
48
119
  }
49
- return { id: v?.id, time: v?.timestampMs, type_raw: v?.type, sender: v?.sender, type: '', };
50
120
  });
51
- return { data: data, hasNextPage: res?.hasNextPage, nextCursor: res?.nextCursor };
52
- };
53
- })(EVENT_QUERY || (EVENT_QUERY = {}));
121
+ }); };
122
+ })(EVENT_QUERY || (exports.EVENT_QUERY = EVENT_QUERY = {}));