@trigora/sdk 0.4.0 → 0.5.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/dist/defineFlow.d.ts +10 -2
- package/dist/github.d.ts +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/stripe.d.ts +2 -2
- package/dist/webhookSignature.d.ts +2 -2
- package/package.json +2 -2
package/dist/defineFlow.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import type { CronFlowDefinition, JsonValue, ManualFlowDefinition, WebhookFlowDefinition } from '@trigora/contracts';
|
|
1
|
+
import type { CronEventPayload, CronFlowDefinition, FlowDefinition, FlowRunFn, JsonValue, ManualFlowDefinition, ManualTrigger, Trigger, WebhookTrigger, WebhookFlowDefinition, CronTrigger } from '@trigora/contracts';
|
|
2
|
+
type DefineFlowInput<TPayload, TEnv extends Record<string, string>, TTrigger extends Trigger> = {
|
|
3
|
+
id: string;
|
|
4
|
+
trigger: TTrigger;
|
|
5
|
+
run: TTrigger extends ManualTrigger ? FlowRunFn<TPayload, TEnv, ManualTrigger> : TTrigger extends WebhookTrigger ? FlowRunFn<TPayload, TEnv, WebhookTrigger> : TTrigger extends CronTrigger ? FlowRunFn<CronEventPayload, TEnv, CronTrigger> : never;
|
|
6
|
+
};
|
|
7
|
+
type DefineFlowOutput<TPayload, TEnv extends Record<string, string>, TTrigger extends Trigger> = TTrigger extends ManualTrigger ? ManualFlowDefinition<TPayload, TEnv> : TTrigger extends WebhookTrigger ? WebhookFlowDefinition<TPayload, TEnv> : TTrigger extends CronTrigger ? CronFlowDefinition<TEnv> : FlowDefinition<TPayload, TEnv, TTrigger>;
|
|
2
8
|
/**
|
|
3
9
|
* Define a Trigora flow.
|
|
4
10
|
*
|
|
@@ -29,6 +35,8 @@ import type { CronFlowDefinition, JsonValue, ManualFlowDefinition, WebhookFlowDe
|
|
|
29
35
|
* });
|
|
30
36
|
* ```
|
|
31
37
|
*/
|
|
38
|
+
export declare function defineFlow<TTrigger extends Trigger, TPayload = JsonValue, TEnv extends Record<string, string> = Record<string, string>>(flow: DefineFlowInput<TPayload, TEnv, TTrigger>): DefineFlowOutput<TPayload, TEnv, TTrigger>;
|
|
32
39
|
export declare function defineFlow<TPayload = JsonValue, TEnv extends Record<string, string> = Record<string, string>>(flow: ManualFlowDefinition<TPayload, TEnv>): ManualFlowDefinition<TPayload, TEnv>;
|
|
33
40
|
export declare function defineFlow<TPayload = JsonValue, TEnv extends Record<string, string> = Record<string, string>>(flow: WebhookFlowDefinition<TPayload, TEnv>): WebhookFlowDefinition<TPayload, TEnv>;
|
|
34
|
-
export declare function defineFlow<
|
|
41
|
+
export declare function defineFlow<TEnv extends Record<string, string> = Record<string, string>>(flow: CronFlowDefinition<TEnv>): CronFlowDefinition<TEnv>;
|
|
42
|
+
export {};
|
package/dist/github.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WebhookFlowEvent } from '@trigora/contracts';
|
|
2
2
|
export type VerifyGitHubWebhookOptions = {
|
|
3
3
|
secret: string | undefined;
|
|
4
4
|
};
|
|
5
5
|
export declare class GitHubWebhookVerificationError extends Error {
|
|
6
6
|
name: string;
|
|
7
7
|
}
|
|
8
|
-
export declare function verifyGitHubWebhook<T = unknown>(event:
|
|
8
|
+
export declare function verifyGitHubWebhook<T = unknown>(event: WebhookFlowEvent, options: VerifyGitHubWebhookOptions): Promise<T>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { defineFlow } from './defineFlow';
|
|
2
|
-
export type { FlowContext, FlowDefinition, FlowEvent, FlowRunFn, JsonValue, Trigger, WebhookFlowResult, } from '@trigora/contracts';
|
|
2
|
+
export type { CronEventPayload, CronFlowEvent, FlowContext, FlowDefinition, FlowEvent, FlowRunFn, JsonValue, ManualFlowEvent, Trigger, WebhookFlowEvent, WebhookFlowResult, } from '@trigora/contracts';
|
package/dist/stripe.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WebhookFlowEvent } from '@trigora/contracts';
|
|
2
2
|
export type VerifyStripeWebhookOptions = {
|
|
3
3
|
secret: string | undefined;
|
|
4
4
|
toleranceSeconds?: number;
|
|
@@ -6,4 +6,4 @@ export type VerifyStripeWebhookOptions = {
|
|
|
6
6
|
export declare class StripeWebhookVerificationError extends Error {
|
|
7
7
|
name: string;
|
|
8
8
|
}
|
|
9
|
-
export declare function verifyStripeWebhook<T = unknown>(event:
|
|
9
|
+
export declare function verifyStripeWebhook<T = unknown>(event: WebhookFlowEvent, options: VerifyStripeWebhookOptions): Promise<T>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { WebhookFlowEvent } from '@trigora/contracts';
|
|
2
2
|
export declare function encodeUtf8(value: string): Uint8Array;
|
|
3
3
|
export declare function toArrayBuffer(bytes: Uint8Array): ArrayBuffer;
|
|
4
4
|
export declare function bytesToHex(bytes: Uint8Array): string;
|
|
@@ -6,7 +6,7 @@ export declare function getHeaderCaseInsensitive(headers: Record<string, string>
|
|
|
6
6
|
export declare function isHexString(value: string): boolean;
|
|
7
7
|
export declare function timingSafeEqualStrings(left: string, right: string): boolean;
|
|
8
8
|
export declare function computeHmacSha256Hex(secret: string, signedPayload: string): Promise<string>;
|
|
9
|
-
export declare function requireWebhookRequestParts(event:
|
|
9
|
+
export declare function requireWebhookRequestParts(event: WebhookFlowEvent, providerName: string): {
|
|
10
10
|
headers: Record<string, string>;
|
|
11
11
|
rawBody: string;
|
|
12
12
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trigora/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/trigora-dev/trigora"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@trigora/contracts": "0.
|
|
48
|
+
"@trigora/contracts": "0.5.5"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"tsup": "^8.5.1"
|