@pc-nexus/event 0.5.0 → 0.8.0-next.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/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/lib/webhook.d.ts +11 -11
- package/lib/webhook.d.ts.map +1 -1
- package/lib/webhook.js +7 -13
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "./lib/app.js";
|
|
2
2
|
export * from "./lib/webhook.js";
|
|
3
|
-
export type { AppEventPayload, AppEventResult, EventPayload, LifecycleEventPayload,
|
|
3
|
+
export type { AppEventPayload, AppEventResult, EventPayload, LifecycleEventPayload, SystemEventPayload, ScheduledEventPayload, WebhookEventPayload, } from "@pc-nexus/internal";
|
|
4
4
|
export { SystemEventSource } from "@pc-nexus/internal";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,YAAY,EACR,eAAe,EACf,cAAc,EACd,YAAY,EACZ,qBAAqB,EACrB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,YAAY,EACR,eAAe,EACf,cAAc,EACd,YAAY,EACZ,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/lib/webhook.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface WebhookQueryUrlResult {
|
|
2
2
|
webTriggerKey: string;
|
|
3
3
|
url: string;
|
|
4
4
|
}
|
|
5
|
-
export interface
|
|
5
|
+
export interface WebhookGetUrlOptions {
|
|
6
6
|
forceCreate?: boolean;
|
|
7
7
|
}
|
|
8
|
-
interface
|
|
9
|
-
getUrl(webTriggerKey: string, options?:
|
|
10
|
-
deleteUrl(
|
|
11
|
-
queryUrls(webTriggerKey?: string): Promise<
|
|
8
|
+
interface WebhookAPI {
|
|
9
|
+
getUrl(webTriggerKey: string, options?: WebhookGetUrlOptions): Promise<string>;
|
|
10
|
+
deleteUrl(webhookUrl: string): Promise<void>;
|
|
11
|
+
queryUrls(webTriggerKey?: string): Promise<WebhookQueryUrlResult[]>;
|
|
12
12
|
}
|
|
13
|
-
declare class
|
|
14
|
-
getUrl(webTriggerKey: string, options?:
|
|
15
|
-
deleteUrl(
|
|
16
|
-
queryUrls(webTriggerKey?: string): Promise<
|
|
13
|
+
declare class WebhookEvent implements WebhookAPI {
|
|
14
|
+
getUrl(webTriggerKey: string, options?: WebhookGetUrlOptions): Promise<string>;
|
|
15
|
+
deleteUrl(webhookUrl: string): Promise<void>;
|
|
16
|
+
queryUrls(webTriggerKey?: string): Promise<WebhookQueryUrlResult[]>;
|
|
17
17
|
}
|
|
18
|
-
export declare const webhook:
|
|
18
|
+
export declare const webhook: WebhookEvent;
|
|
19
19
|
export {};
|
|
20
20
|
//# sourceMappingURL=webhook.d.ts.map
|
package/lib/webhook.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../src/lib/webhook.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../src/lib/webhook.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,qBAAqB;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,UAAU,UAAU;IAChB,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/E,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,SAAS,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAAC;CACvE;AAED,cAAM,YAAa,YAAW,UAAU;IACvB,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC;IAS9E,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO5C,SAAS,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;CAOnF;AAED,eAAO,MAAM,OAAO,cAAqB,CAAC"}
|
package/lib/webhook.js
CHANGED
|
@@ -1,31 +1,25 @@
|
|
|
1
1
|
import { invoke } from "@pc-nexus/internal";
|
|
2
|
-
class
|
|
2
|
+
class WebhookEvent {
|
|
3
3
|
async getUrl(webTriggerKey, options) {
|
|
4
4
|
const response = await invoke("event", "webhook/get-url", {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
force_create: options?.forceCreate,
|
|
8
|
-
},
|
|
5
|
+
web_trigger_key: webTriggerKey,
|
|
6
|
+
force_create: options?.forceCreate,
|
|
9
7
|
});
|
|
10
8
|
const result = (await response.json());
|
|
11
9
|
return result.value;
|
|
12
10
|
}
|
|
13
|
-
async deleteUrl(
|
|
11
|
+
async deleteUrl(webhookUrl) {
|
|
14
12
|
const response = await invoke("event", "webhook/delete-url", {
|
|
15
|
-
|
|
16
|
-
web_hook_url: webHookUrl,
|
|
17
|
-
},
|
|
13
|
+
web_hook_url: webhookUrl,
|
|
18
14
|
});
|
|
19
15
|
await response.json();
|
|
20
16
|
}
|
|
21
17
|
async queryUrls(webTriggerKey) {
|
|
22
18
|
const response = await invoke("event", "webhook/query-urls", {
|
|
23
|
-
|
|
24
|
-
web_trigger_key: webTriggerKey,
|
|
25
|
-
},
|
|
19
|
+
web_trigger_key: webTriggerKey,
|
|
26
20
|
});
|
|
27
21
|
const result = (await response.json());
|
|
28
22
|
return result.value;
|
|
29
23
|
}
|
|
30
24
|
}
|
|
31
|
-
export const webhook = new
|
|
25
|
+
export const webhook = new WebhookEvent();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pc-nexus/event",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0-next.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"type": "module",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@pc-nexus/internal": "0.
|
|
31
|
+
"@pc-nexus/internal": "0.8.0-next.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {},
|
|
34
34
|
"peerDependencies": {}
|