@plyaz/types 1.19.2 → 1.19.4

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.
@@ -5,3 +5,4 @@ export type * from './infobip';
5
5
  export type * from './virustotal';
6
6
  export type * from './cdn';
7
7
  export type * from './types';
8
+ export type * from './payments';
@@ -0,0 +1 @@
1
+ export type * from './types';
@@ -0,0 +1,22 @@
1
+ import type { ProcessPaymentRequest, PaymentResult, RefundParams, RefundResult, PAYMENT_PROVIDER_TYPE, SubscriptionResult, PayoutParams, PayoutResult, TransactionHistoryParams, TransactionHistory, CreateSubscriptionParams } from '../../../payments';
2
+ import type { Endpoint, Req } from 'fetchff';
3
+ export interface PaymentEndpointTypes {
4
+ processPayment: Endpoint<Req<PaymentResult, ProcessPaymentRequest>>;
5
+ cancelPayment: Endpoint<Req<void, {
6
+ provider: PAYMENT_PROVIDER_TYPE;
7
+ transactionId: string;
8
+ reason?: string;
9
+ }>>;
10
+ refundPayment: Endpoint<Req<RefundResult, RefundParams & {
11
+ provider: PAYMENT_PROVIDER_TYPE;
12
+ }>>;
13
+ createSubscription: Endpoint<Req<SubscriptionResult, CreateSubscriptionParams & {
14
+ provider: PAYMENT_PROVIDER_TYPE;
15
+ }>>;
16
+ processPayout: Endpoint<Req<PayoutResult, PayoutParams & {
17
+ provider: PAYMENT_PROVIDER_TYPE;
18
+ }>>;
19
+ getTransactionHistory: Endpoint<Req<TransactionHistory, TransactionHistoryParams & {
20
+ provider: PAYMENT_PROVIDER_TYPE;
21
+ }>>;
22
+ }
@@ -4,6 +4,7 @@ import type { InfobipEndpointTypes } from './infobip';
4
4
  import type { VirusTotalEndpointTypes } from './virustotal';
5
5
  import type { CloudflareEndpointTypes, CloudFrontEndpointTypes, FastlyEndpointTypes } from './cdn';
6
6
  import type { FeatureFlagEndpointTypes } from './featureFlags';
7
+ import type { PaymentEndpointTypes } from './payments';
7
8
  /**
8
9
  * Query parameters type - matches fetchff's flexible param handling
9
10
  * Supports objects, URLSearchParams, and arrays of name-value pairs
@@ -12,5 +13,5 @@ export type QueryParams = Record<string, string | number | boolean | string[] |
12
13
  /**
13
14
  * All endpoint types combined
14
15
  */
15
- export interface EndpointTypes extends CampaignEndpointTypes, PollingEndpointTypes, InfobipEndpointTypes, VirusTotalEndpointTypes, CloudflareEndpointTypes, CloudFrontEndpointTypes, FastlyEndpointTypes, FeatureFlagEndpointTypes {
16
+ export interface EndpointTypes extends CampaignEndpointTypes, PaymentEndpointTypes, PollingEndpointTypes, InfobipEndpointTypes, VirusTotalEndpointTypes, CloudflareEndpointTypes, CloudFrontEndpointTypes, FastlyEndpointTypes, FeatureFlagEndpointTypes {
16
17
  }
@@ -5,9 +5,29 @@
5
5
  * including table schemas, query interfaces, and data transformation types.
6
6
  * These types ensure type safety across the entire database layer.
7
7
  */
8
- import type { FEATURES } from '@plyaz/config';
9
8
  import type { FeatureFlagCondition, FeatureFlagConfig, FeatureFlagValue } from '../../features';
10
9
  import type { ApiClientWithEvents } from '../../api';
10
+ /**
11
+ * Feature flags for authentication providers and other features
12
+ */
13
+ export declare const FEATURES: {
14
+ /**
15
+ * Enable Google OAuth authentication
16
+ */
17
+ readonly AUTH_GOOGLE: true;
18
+ /**
19
+ * Enable Discord OAuth authentication (dev only)
20
+ */
21
+ readonly AUTH_DISCORD: false;
22
+ /**
23
+ * Enable Facebook OAuth authentication
24
+ */
25
+ readonly AUTH_FACEBOOK: false;
26
+ /**
27
+ * Enable GitHub OAuth authentication
28
+ */
29
+ readonly AUTH_GITHUB: true;
30
+ };
11
31
  /**
12
32
  * Raw database row interface for feature flags table
13
33
  */
@@ -47,9 +47,9 @@ export declare const QueryExampleSchema: z.ZodObject<{
47
47
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
48
48
  sort_by: z.ZodDefault<z.ZodEnum<{
49
49
  name: "name";
50
+ amount: "amount";
50
51
  created_at: "created_at";
51
52
  updated_at: "updated_at";
52
- amount: "amount";
53
53
  }>>;
54
54
  sort_order: z.ZodDefault<z.ZodEnum<{
55
55
  asc: "asc";
package/dist/index.cjs CHANGED
@@ -6485,6 +6485,10 @@ var PAYMENT_EVENT_TYPE = /* @__PURE__ */ ((PAYMENT_EVENT_TYPE2) => {
6485
6485
  PAYMENT_EVENT_TYPE2["RefundCompleted"] = "refund.completed";
6486
6486
  PAYMENT_EVENT_TYPE2["RefundFailed"] = "refund.failed";
6487
6487
  PAYMENT_EVENT_TYPE2["RefundCancelled"] = "refund.cancelled";
6488
+ PAYMENT_EVENT_TYPE2["WithdrawalRequested"] = "withdrawal.requested";
6489
+ PAYMENT_EVENT_TYPE2["WithdrawalProcessed"] = "withdrawal.processed";
6490
+ PAYMENT_EVENT_TYPE2["WithdrawalFailed"] = "withdrawal.failed";
6491
+ PAYMENT_EVENT_TYPE2["WithdrawalCancelled"] = "withdrawal.cancelled";
6488
6492
  PAYMENT_EVENT_TYPE2["ProviderWebhookReceived"] = "provider.webhook.received";
6489
6493
  PAYMENT_EVENT_TYPE2["ProviderWebhookProcessed"] = "provider.webhook.processed";
6490
6494
  PAYMENT_EVENT_TYPE2["ProviderWebhookFailed"] = "provider.webhook.failed";
@@ -6526,6 +6530,12 @@ var PAYMENT_EVENT_TYPE = /* @__PURE__ */ ((PAYMENT_EVENT_TYPE2) => {
6526
6530
  PAYMENT_EVENT_TYPE2["SubscriptionFailed"] = "subscription.failed";
6527
6531
  PAYMENT_EVENT_TYPE2["SubscriptionTrialStarted"] = "subscription.trial_started";
6528
6532
  PAYMENT_EVENT_TYPE2["SubscriptionTrialEnded"] = "subscription.trial_ended";
6533
+ PAYMENT_EVENT_TYPE2["ProductCreated"] = "product.created";
6534
+ PAYMENT_EVENT_TYPE2["ProductUpdated"] = "product.updated";
6535
+ PAYMENT_EVENT_TYPE2["ProductDeleted"] = "product.deleted";
6536
+ PAYMENT_EVENT_TYPE2["PriceCreated"] = "price.created";
6537
+ PAYMENT_EVENT_TYPE2["PriceUpdated"] = "price.updated";
6538
+ PAYMENT_EVENT_TYPE2["PriceDeleted"] = "price.deleted";
6529
6539
  PAYMENT_EVENT_TYPE2["PaymentLimitsUpdated"] = "payment_limits.updated";
6530
6540
  PAYMENT_EVENT_TYPE2["PaymentLimitsExceeded"] = "payment_limits.exceeded";
6531
6541
  PAYMENT_EVENT_TYPE2["ProviderConfigUpdated"] = "provider.config_updated";