-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: NPM | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
publish: | ||
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/v')) | ||
name: Publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 22 | ||
registry-url: https://registry.npmjs.org/ | ||
cache: npm | ||
cache-dependency-path: package.json | ||
|
||
- name: Install Dependencies | ||
run: npm install | ||
|
||
# - name: Set up TS | ||
# run: npm install typescript@4.7.3 | ||
|
||
- name: Generate Package JSON | ||
run: ./scripts/generate-package-json.sh | ||
|
||
- name: Set Publish Config | ||
run: ./scripts/package-publish-config-tag.sh | ||
|
||
- name: Build Dist | ||
run: npm run dist | ||
|
||
- name: Check Branch | ||
id: check-branch | ||
run: | | ||
if [[ ${{ github.ref }} =~ ^refs/heads/(main|v[0-9]+\.[0-9]+.*)$ ]]; then | ||
echo ::set-output name=match::true | ||
fi # See: https://stackoverflow.com/a/58869470/1123955 | ||
- name: Is A Publish Branch | ||
if: steps.check-branch.outputs.match == 'true' | ||
run: | | ||
NAME=$(npx pkg-jq -r .name) | ||
VERSION=$(npx pkg-jq -r .version) | ||
if npx version-exists "$NAME" "$VERSION" | ||
then echo "$NAME@$VERSION exists on NPM, skipped." | ||
else npm publish | ||
fi | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.JUZI_ADMIN_SCOPE_NPM_TOKEN }} | ||
- name: Is Not A Publish Branch | ||
if: steps.check-branch.outputs.match != 'true' | ||
run: echo 'Not A Publish Branch' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { PuppetRabbit, PuppetRabbitOptions } from './puppet.js'; | ||
import { log } from '@juzi/wechaty-puppet'; | ||
export { log, PuppetRabbit }; | ||
export type { PuppetRabbitOptions }; | ||
export default PuppetRabbit; | ||
//# sourceMappingURL=mod.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
export interface MqSendMessage { | ||
traceId?: string; | ||
commandType: MqCommandType; | ||
data: string; | ||
} | ||
export interface MqReceiveMessage { | ||
traceId: string; | ||
type: MqMessageType; | ||
eventType?: MqEventType; | ||
data: string; | ||
code?: number; | ||
error?: string; | ||
} | ||
export declare enum MqMessageType { | ||
command = "command", | ||
event = "event" | ||
} | ||
export declare enum MqCommandType { | ||
start = "start", | ||
ding = "ding", | ||
contactPayload = "contactPayload", | ||
postSearch = "postSearch", | ||
postPayload = "postPayload", | ||
postPayloadSayable = "postPayloadSayable", | ||
postPublish = "postPublish", | ||
dirtyPayload = "dirtyPayload" | ||
} | ||
export declare enum MqEventType { | ||
dong = "dong", | ||
login = "login", | ||
loginUrl = "loginUrl", | ||
postComment = "postComment", | ||
dirty = "dirty", | ||
logout = "logout" | ||
} | ||
export interface MqCommandResponseWaiter { | ||
resolver: (data: any) => void; | ||
rejector: (e: Error) => void; | ||
traceId: string; | ||
timer: NodeJS.Timeout; | ||
} | ||
//# sourceMappingURL=mq.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export declare const getTokenQueueName: (token: string) => string; | ||
export declare const ClientExchangeName = "tiktok.message.to.client"; | ||
export declare const ServerExchangeName = "tiktok.message.to.server"; | ||
//# sourceMappingURL=config.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { MqSendMessage } from '../model/mq.js'; | ||
import EventEmitter from 'events'; | ||
export declare class MqManager extends EventEmitter { | ||
private static _instance; | ||
static get Instance(): MqManager; | ||
private puppetConnection; | ||
private puppetChannel; | ||
private connected; | ||
private restartingConnection; | ||
private restartingChannel; | ||
private token; | ||
private static MqCommandResponsePool; | ||
private static consumption; | ||
init(token?: string, mqUri?: string): Promise<void>; | ||
private initConnect; | ||
private initChannel; | ||
private prepareConnectListener; | ||
private createChannelService; | ||
private prepareChannelListener; | ||
private reconnectMainConnect; | ||
reconnectChannel(): Promise<void>; | ||
startConsume(): Promise<void>; | ||
stopConsume(): Promise<void>; | ||
private startConsumer; | ||
sendToServer(message: MqSendMessage): Promise<any>; | ||
private handleEvent; | ||
private prepareQueue; | ||
} | ||
//# sourceMappingURL=mq-manager.d.ts.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.