@rich-automation/lotto 0.1.7 → 1.0.0

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/README.md CHANGED
@@ -1,4 +1,121 @@
1
1
  # @rich-automation/lotto
2
2
 
3
+ [![npm](https://img.shields.io/npm/v/@rich-automation/lotto.svg?style=popout&colorB=yellow)](https://www.npmjs.com/package/@rich-automation/lotto)
3
4
  [![ci](https://github.com/rich-automation/lotto-module/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/rich-automation/lotto-module/actions/workflows/ci.yml)
4
5
  [![codecov](https://codecov.io/gh/rich-automation/lotto-module/branch/main/graph/badge.svg?token=18IAW1OW77)](https://codecov.io/gh/rich-automation/lotto-module)
6
+
7
+ `@rich-automation/lotto` 패키지는 headless browser를 이용해 js환경에서 자동으로 로또를 구매할 수 있는 인터페이스를 제공합니다.
8
+
9
+
10
+
11
+ ## Installation
12
+ ```shell
13
+ # npm
14
+ npm install @rich-automation/lotto
15
+
16
+ # yarn
17
+ yarn add @rich-automation/lotto
18
+ ```
19
+
20
+ ## Preparation
21
+ 1. 내부적으로 playwright/puppeteer를 사용하므로 머신에 chromium 을 미리 설치해주셔야 합니다. ([link](https://github.com/rich-automation/lotto-module/blob/main/package.json#L38-L39))
22
+ 2. [동행복권](https://dhlottery.co.kr/common.do?method=main) 사이트를 통해 구매가 이루어지며 예치금 충전은 지원하지 않으므로 미리 동행복권 계정에 예치금을 충전해두어야합니다.
23
+
24
+ ## Usage
25
+ ### 공통
26
+ lottoService 객체 인스턴스를 생성합니다.
27
+ ```js
28
+ import { LottoService } from '@rich-automation/lotto';
29
+
30
+ const lottoService = new LottoService();
31
+ //...
32
+ ```
33
+ LottoService 클래스의 생성자는 BrowserConfigs를 인수로 받을 수 있습니다. 인수로 전달된 configs는 다음과 같은 속성을 가질 수 있습니다:
34
+
35
+ - `controller(default: 'playwright')`: 내부적으로 어떤 컨트롤러(puppeteer/playwright)를 사용할 지 지정할 수 있습니다.
36
+ - `headless(default: false)`: 브라우저의 헤드리스 모드 여부를 설정합니다.
37
+ - `defaultViewport(default: { width: 1080, height: 1024 })`: 브라우저의 기본 뷰포트 크기를 설정합니다.
38
+ - `logLevel(default:2)`:콘솔 로그 수준을 설정합니다. (NONE = -1, ERROR = 0, WARN = 1, INFO = 2, DEBUG = 3)
39
+ ```js
40
+ //example
41
+ import {LottoService, LogLevel} from '@rich-automation/lotto'
42
+
43
+ const lottoService = new LottoService({
44
+ headless: true,
45
+ defaultViewport: { width: 1280, height: 720 },
46
+ logLevel: LogLevel.DEBUG
47
+ });
48
+ ```
49
+ ### 구매
50
+ ```js
51
+ import {LottoService} from "@rich-automation/lotto";
52
+
53
+ const ID = "<YOUR_ID>";
54
+ const PWD = "<YOUR_PASSWORD>";
55
+
56
+ const lottoService = new LottoService({
57
+ headless:true
58
+ });
59
+
60
+ await lottoService.signIn(ID,PWD);
61
+
62
+ const numbers = await lottoService.purchase(5);
63
+ console.log(numbers); //[[ 1, 14, 21, 27, 30, 44 ],[ 4, 5, 27, 29, 40, 44 ],[ 9, 18, 19, 24, 38, 42 ],[ 4, 6, 13, 20, 38, 39 ],[ 8, 9, 10, 19, 32, 40 ]]
64
+
65
+
66
+
67
+ ```
68
+
69
+ ### 당첨 확인
70
+ 이번 회차 당첨 확인
71
+ ```js
72
+ import {getLastLottoRound,LottoService} from "@rich-automation/lotto";
73
+
74
+ const numbers = "[[1,2,3,4,5,6],[5,6,7,8,9,10]";
75
+
76
+ const lottoService = new LottoService({
77
+ headless:true
78
+ });
79
+
80
+ const currentRound = getLastLottoRound();
81
+
82
+ const result = await lottoService.check(numbers,currentRound)
83
+ console.log(result) //[{rank:1,matchedNumbers:[1,2,3,4,5,6]},{rank:5,matchedNumbers:[5,6]]
84
+ ```
85
+ 다음 회차 당첨 링크 생성
86
+ ```js
87
+ import {getNextLottoRound,LottoService} from "@rich-automation/lotto";
88
+
89
+ const numbers = "[[1,2,3,4,5,6],[5,6,7,8,9,10]";
90
+
91
+
92
+ const lottoService = new LottoService({
93
+ headless:true
94
+ });
95
+
96
+ const nextRound = getNextLottoRound();
97
+ const link = lottoService.getCheckWinningLink(numbers,nextRound);
98
+ console.log(link) //"https://dhlottery.co.kr/qr.do?method=winQr&v=1071q010203040506q050607080910";
99
+
100
+ ```
101
+
102
+
103
+ ## Method
104
+ ### signIn
105
+ - `(id: string, password: string) => Promise<string>`
106
+ - description: id와 pwd를 입력받아 동행복권에 로그인합니다. 성공할경우 로그인 쿠키를 반환합니다.
107
+ ### signInWithCookie
108
+ - `(cookies: string) => Promise<string>`
109
+ - description: 로그인 쿠키를 입력받아 동행복권에 로그인합니다. 성공할경우 로그인 쿠키를 반환합니다.
110
+ ### purchase
111
+ - `(amount?: number) => Promise<number[][]>`
112
+ - description: 구매할 게임 횟수를 입력받아 로또를 구매하고, 구매한 번호를 이차원 배열 형태로 반환합니다. amount는 1~5사이 값을 가집니다.
113
+ ### check
114
+ - `(numbers: number[][], round?: number) => Promise<{ rank:number; matchedNumbers:number[] }[]>`
115
+ - description: 회차와 해당 회차에 구매한 로또번호를 입력받아 당첨 등수(rank)와 맞춘 번호(matchedNumbers)목록을 반환합니다. 회차를 지정하지 않으면 최신 회차를 기준으로 확인합니다.
116
+ ### getCheckWinningLink
117
+ - `(numbers: number[][], round?: number) => string`
118
+ - description: 회차와 구매한 로또 번호를 입력받아 당첨 확인 링크를 생성합니다. 로또 번호는 해당 회차에 구매한 모든 게임을 이차원 배열 형태로 입력받습니다. 회차를 지정하지 않으면 다음 회차를 기준으로 링크를 생성합니다.
119
+ ### destroy
120
+ - `() => Promise<void>`
121
+ - description: LottoService 인스턴스에서 사용한 브라우저 컨트롤러를 종료합니다.
@@ -9,5 +9,5 @@ exports.CONST = {
9
9
  BROWSER_PAGE_POPUP_WAIT: 1500,
10
10
  BROWSER_PAGE_DIALOG_WAIT: 10000,
11
11
  WEEK_TO_MILLISECOND: 604800000,
12
- THOUSAND_ROUND_DATE: '2022-01-29T11:50:00'
12
+ THOUSAND_ROUND_DATE: '2022-01-29T11:50:00Z'
13
13
  };
package/lib/cjs/index.js CHANGED
@@ -14,11 +14,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.LogLevel = exports.getCurrentLottoRound = exports.LottoService = void 0;
17
+ exports.checkWinning = exports.getCheckWinningLink = exports.getNextLottoRound = exports.getLastLottoRound = exports.LogLevel = exports.LottoService = void 0;
18
18
  var lottoService_1 = require("./lottoService");
19
19
  Object.defineProperty(exports, "LottoService", { enumerable: true, get: function () { return lottoService_1.LottoService; } });
20
- var getCurrentLottoRound_1 = require("./utils/getCurrentLottoRound");
21
- Object.defineProperty(exports, "getCurrentLottoRound", { enumerable: true, get: function () { return getCurrentLottoRound_1.getCurrentLottoRound; } });
22
20
  var logger_1 = require("./logger");
23
21
  Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return logger_1.LogLevel; } });
24
22
  __exportStar(require("./types"), exports);
23
+ var getLastLottoRound_1 = require("./utils/getLastLottoRound");
24
+ Object.defineProperty(exports, "getLastLottoRound", { enumerable: true, get: function () { return getLastLottoRound_1.getLastLottoRound; } });
25
+ var getNextLottoRound_1 = require("./utils/getNextLottoRound");
26
+ Object.defineProperty(exports, "getNextLottoRound", { enumerable: true, get: function () { return getNextLottoRound_1.getNextLottoRound; } });
27
+ var getCheckWinningLink_1 = require("./utils/getCheckWinningLink");
28
+ Object.defineProperty(exports, "getCheckWinningLink", { enumerable: true, get: function () { return getCheckWinningLink_1.getCheckWinningLink; } });
29
+ var checkWinning_1 = require("./utils/checkWinning");
30
+ Object.defineProperty(exports, "checkWinning", { enumerable: true, get: function () { return checkWinning_1.checkWinning; } });
@@ -21,12 +21,13 @@ const deferred_1 = require("./utils/deferred");
21
21
  const constants_1 = require("./constants");
22
22
  const lazyRun_1 = require("./utils/lazyRun");
23
23
  const logger_1 = __importDefault(require("./logger"));
24
- const getCurrentLottoRound_1 = require("./utils/getCurrentLottoRound");
24
+ const getLastLottoRound_1 = require("./utils/getLastLottoRound");
25
25
  const validateLottoNumber_1 = require("./utils/validateLottoNumber");
26
26
  const getWinningNumbers_1 = require("./apis/dhlottery/getWinningNumbers");
27
27
  const checkWinning_1 = require("./utils/checkWinning");
28
28
  const validatePurchaseAvailability_1 = require("./utils/validatePurchaseAvailability");
29
29
  const getCheckWinningLink_1 = require("./utils/getCheckWinningLink");
30
+ const getNextLottoRound_1 = require("./utils/getNextLottoRound");
30
31
  class LottoService {
31
32
  constructor(configs) {
32
33
  var _a;
@@ -131,15 +132,15 @@ class LottoService {
131
132
  return elems.map(it => Array.from(it.children).map(child => Number(child.innerHTML)));
132
133
  });
133
134
  });
134
- this.check = (numbers, round = (0, getCurrentLottoRound_1.getCurrentLottoRound)()) => __awaiter(this, void 0, void 0, function* () {
135
- (0, validateLottoNumber_1.validateLottoNumber)(numbers);
135
+ this.check = (numbers, round = (0, getLastLottoRound_1.getLastLottoRound)()) => __awaiter(this, void 0, void 0, function* () {
136
+ numbers.forEach(number => (0, validateLottoNumber_1.validateLottoNumber)(number));
136
137
  this.logger.debug('[check]', 'getWinningNumbers');
137
138
  const winningNumbers = yield (0, getWinningNumbers_1.getWinningNumbers)(round);
138
- return (0, checkWinning_1.checkWinning)(numbers, winningNumbers);
139
+ return numbers.map(game => (0, checkWinning_1.checkWinning)(game, winningNumbers));
139
140
  });
140
- this.getCheckWinningLink = (round, numbers) => {
141
+ this.getCheckWinningLink = (numbers, round = (0, getNextLottoRound_1.getNextLottoRound)()) => {
141
142
  this.logger.debug('[getCheckWinningLink]', 'getCheckWinningLink');
142
- return (0, getCheckWinningLink_1.getCheckWinningLink)(round, numbers);
143
+ return (0, getCheckWinningLink_1.getCheckWinningLink)(numbers, round);
143
144
  };
144
145
  this.logger = new logger_1.default(configs === null || configs === void 0 ? void 0 : configs.logLevel, '[LottoService]');
145
146
  this.browserController = (0, factory_1.createBrowserController)((_a = configs === null || configs === void 0 ? void 0 : configs.controller) !== null && _a !== void 0 ? _a : 'playwright', Object.assign({ defaultViewport: { width: 1080, height: 1024 } }, configs), this.logger);
@@ -1,16 +1,7 @@
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
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.checkWinning = void 0;
13
- const checkWinning = (myNumber, winningNumbers) => __awaiter(void 0, void 0, void 0, function* () {
4
+ const checkWinning = (myNumber, winningNumbers) => {
14
5
  const mainWinningNumbers = winningNumbers.slice(0, 6);
15
6
  const bonusNumber = winningNumbers.at(-1);
16
7
  const matchedNumbers = myNumber.filter(n => mainWinningNumbers.includes(n));
@@ -33,5 +24,5 @@ const checkWinning = (myNumber, winningNumbers) => __awaiter(void 0, void 0, voi
33
24
  rank = 5;
34
25
  }
35
26
  return { rank, matchedNumbers };
36
- });
27
+ };
37
28
  exports.checkWinning = checkWinning;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getCheckWinningLink = void 0;
4
4
  const urls_1 = require("../constants/urls");
5
- function getCheckWinningLink(round, numbers) {
5
+ function getCheckWinningLink(numbers, round) {
6
6
  const nums = numbers.map(it => 'q' + it.map(n => String(n).padStart(2, '0')).join('')).join('');
7
7
  return `${urls_1.URLS.CHECK_WINNING}?method=winQr&v=${round}${nums}`;
8
8
  }
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCurrentLottoRound = void 0;
3
+ exports.getLastLottoRound = void 0;
4
4
  const constants_1 = require("../constants");
5
- const getCurrentLottoRound = () => {
5
+ const getLastLottoRound = () => {
6
6
  const standardDate = new Date(constants_1.CONST.THOUSAND_ROUND_DATE);
7
7
  const now = new Date(global.Date.now());
8
8
  const ADDITIONAL_ROUND = Math.floor((now.getTime() - standardDate.getTime()) / constants_1.CONST.WEEK_TO_MILLISECOND);
9
9
  return 1000 + ADDITIONAL_ROUND;
10
10
  };
11
- exports.getCurrentLottoRound = getCurrentLottoRound;
11
+ exports.getLastLottoRound = getLastLottoRound;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getNextLottoRound = void 0;
4
+ const constants_1 = require("../constants");
5
+ const getNextLottoRound = () => {
6
+ const standardDate = new Date(constants_1.CONST.THOUSAND_ROUND_DATE);
7
+ const now = new Date(global.Date.now());
8
+ const ADDITIONAL_ROUND = Math.floor((now.getTime() - standardDate.getTime()) / constants_1.CONST.WEEK_TO_MILLISECOND) + 1;
9
+ return 1000 + ADDITIONAL_ROUND;
10
+ };
11
+ exports.getNextLottoRound = getNextLottoRound;
@@ -6,5 +6,5 @@ export const CONST = {
6
6
  BROWSER_PAGE_POPUP_WAIT: 1500,
7
7
  BROWSER_PAGE_DIALOG_WAIT: 10000,
8
8
  WEEK_TO_MILLISECOND: 604800000,
9
- THOUSAND_ROUND_DATE: '2022-01-29T11:50:00'
9
+ THOUSAND_ROUND_DATE: '2022-01-29T11:50:00Z'
10
10
  };
package/lib/esm/index.js CHANGED
@@ -1,4 +1,7 @@
1
1
  export { LottoService } from './lottoService';
2
- export { getCurrentLottoRound } from './utils/getCurrentLottoRound';
3
2
  export { LogLevel } from './logger';
4
3
  export * from './types';
4
+ export { getLastLottoRound } from './utils/getLastLottoRound';
5
+ export { getNextLottoRound } from './utils/getNextLottoRound';
6
+ export { getCheckWinningLink } from './utils/getCheckWinningLink';
7
+ export { checkWinning } from './utils/checkWinning';
@@ -15,12 +15,13 @@ import { deferred } from './utils/deferred';
15
15
  import { CONST } from './constants';
16
16
  import { lazyRun } from './utils/lazyRun';
17
17
  import Logger, {} from './logger';
18
- import { getCurrentLottoRound } from './utils/getCurrentLottoRound';
18
+ import { getLastLottoRound } from './utils/getLastLottoRound';
19
19
  import { validateLottoNumber } from './utils/validateLottoNumber';
20
20
  import { getWinningNumbers } from './apis/dhlottery/getWinningNumbers';
21
21
  import { checkWinning } from './utils/checkWinning';
22
22
  import { validatePurchaseAvailability } from './utils/validatePurchaseAvailability';
23
23
  import { getCheckWinningLink } from './utils/getCheckWinningLink';
24
+ import { getNextLottoRound } from './utils/getNextLottoRound';
24
25
  export class LottoService {
25
26
  constructor(configs) {
26
27
  var _a;
@@ -125,15 +126,15 @@ export class LottoService {
125
126
  return elems.map(it => Array.from(it.children).map(child => Number(child.innerHTML)));
126
127
  });
127
128
  });
128
- this.check = (numbers, round = getCurrentLottoRound()) => __awaiter(this, void 0, void 0, function* () {
129
- validateLottoNumber(numbers);
129
+ this.check = (numbers, round = getLastLottoRound()) => __awaiter(this, void 0, void 0, function* () {
130
+ numbers.forEach(number => validateLottoNumber(number));
130
131
  this.logger.debug('[check]', 'getWinningNumbers');
131
132
  const winningNumbers = yield getWinningNumbers(round);
132
- return checkWinning(numbers, winningNumbers);
133
+ return numbers.map(game => checkWinning(game, winningNumbers));
133
134
  });
134
- this.getCheckWinningLink = (round, numbers) => {
135
+ this.getCheckWinningLink = (numbers, round = getNextLottoRound()) => {
135
136
  this.logger.debug('[getCheckWinningLink]', 'getCheckWinningLink');
136
- return getCheckWinningLink(round, numbers);
137
+ return getCheckWinningLink(numbers, round);
137
138
  };
138
139
  this.logger = new Logger(configs === null || configs === void 0 ? void 0 : configs.logLevel, '[LottoService]');
139
140
  this.browserController = createBrowserController((_a = configs === null || configs === void 0 ? void 0 : configs.controller) !== null && _a !== void 0 ? _a : 'playwright', Object.assign({ defaultViewport: { width: 1080, height: 1024 } }, configs), this.logger);
@@ -1,13 +1,4 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- export const checkWinning = (myNumber, winningNumbers) => __awaiter(void 0, void 0, void 0, function* () {
1
+ export const checkWinning = (myNumber, winningNumbers) => {
11
2
  const mainWinningNumbers = winningNumbers.slice(0, 6);
12
3
  const bonusNumber = winningNumbers.at(-1);
13
4
  const matchedNumbers = myNumber.filter(n => mainWinningNumbers.includes(n));
@@ -30,4 +21,4 @@ export const checkWinning = (myNumber, winningNumbers) => __awaiter(void 0, void
30
21
  rank = 5;
31
22
  }
32
23
  return { rank, matchedNumbers };
33
- });
24
+ };
@@ -1,5 +1,5 @@
1
1
  import { URLS } from '../constants/urls';
2
- export function getCheckWinningLink(round, numbers) {
2
+ export function getCheckWinningLink(numbers, round) {
3
3
  const nums = numbers.map(it => 'q' + it.map(n => String(n).padStart(2, '0')).join('')).join('');
4
4
  return `${URLS.CHECK_WINNING}?method=winQr&v=${round}${nums}`;
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import { CONST } from '../constants';
2
- export const getCurrentLottoRound = () => {
2
+ export const getLastLottoRound = () => {
3
3
  const standardDate = new Date(CONST.THOUSAND_ROUND_DATE);
4
4
  const now = new Date(global.Date.now());
5
5
  const ADDITIONAL_ROUND = Math.floor((now.getTime() - standardDate.getTime()) / CONST.WEEK_TO_MILLISECOND);
@@ -0,0 +1,7 @@
1
+ import { CONST } from '../constants';
2
+ export const getNextLottoRound = () => {
3
+ const standardDate = new Date(CONST.THOUSAND_ROUND_DATE);
4
+ const now = new Date(global.Date.now());
5
+ const ADDITIONAL_ROUND = Math.floor((now.getTime() - standardDate.getTime()) / CONST.WEEK_TO_MILLISECOND) + 1;
6
+ return 1000 + ADDITIONAL_ROUND;
7
+ };
@@ -1,4 +1,7 @@
1
1
  export { LottoService } from './lottoService';
2
- export { getCurrentLottoRound } from './utils/getCurrentLottoRound';
3
2
  export { LogLevel } from './logger';
4
3
  export * from './types';
4
+ export { getLastLottoRound } from './utils/getLastLottoRound';
5
+ export { getNextLottoRound } from './utils/getNextLottoRound';
6
+ export { getCheckWinningLink } from './utils/getCheckWinningLink';
7
+ export { checkWinning } from './utils/checkWinning';
@@ -11,9 +11,9 @@ export declare class LottoService implements LottoServiceInterface {
11
11
  signInWithCookie: (cookies: string) => Promise<string>;
12
12
  signIn: (id: string, password: string) => Promise<string>;
13
13
  purchase: (amount?: number) => Promise<number[][]>;
14
- check: (numbers: number[], round?: number) => Promise<{
14
+ check: (numbers: number[][], round?: number) => Promise<{
15
15
  rank: number;
16
16
  matchedNumbers: number[];
17
- }>;
18
- getCheckWinningLink: (round: number, numbers: number[][]) => string;
17
+ }[]>;
18
+ getCheckWinningLink: (numbers: number[][], round?: number) => string;
19
19
  }
@@ -3,12 +3,12 @@ export interface LottoServiceInterface {
3
3
  destroy(): Promise<void>;
4
4
  signIn(id: string, password: string): Promise<string>;
5
5
  signInWithCookie(cookie: string): Promise<string>;
6
- check(numbers: number[], volume?: number): Promise<{
6
+ check(numbers: number[][], volume?: number): Promise<{
7
7
  rank: number;
8
8
  matchedNumbers: number[];
9
- }>;
9
+ }[]>;
10
10
  purchase(amount: number): Promise<number[][]>;
11
- getCheckWinningLink(round: number, numbers: number[][]): string;
11
+ getCheckWinningLink(numbers: number[][], round: number): string;
12
12
  }
13
13
  export interface BrowserConfigs {
14
14
  controller?: 'puppeteer' | 'playwright';
@@ -1,4 +1,4 @@
1
- export declare const checkWinning: (myNumber: number[], winningNumbers: number[]) => Promise<{
1
+ export declare const checkWinning: (myNumber: number[], winningNumbers: number[]) => {
2
2
  rank: number;
3
3
  matchedNumbers: number[];
4
- }>;
4
+ };
@@ -1 +1 @@
1
- export declare function getCheckWinningLink(round: number, numbers: number[][]): string;
1
+ export declare function getCheckWinningLink(numbers: number[][], round: number): string;
@@ -0,0 +1 @@
1
+ export declare const getLastLottoRound: () => number;
@@ -0,0 +1 @@
1
+ export declare const getNextLottoRound: () => number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rich-automation/lotto",
3
- "version": "0.1.7",
3
+ "version": "1.0.0",
4
4
  "description": "Lotto module",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -1 +0,0 @@
1
- export declare const getCurrentLottoRound: () => number;