@hexclave/shared 1.0.33 → 1.0.34

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.
@@ -6,7 +6,7 @@ import { InferType } from "yup";
6
6
  declare const transactionEntrySchema: yup$1.MixedSchema<{
7
7
  type: "money_transfer";
8
8
  customer_id: string;
9
- customer_type: "team" | "user" | "custom";
9
+ customer_type: "user" | "team" | "custom";
10
10
  charged_amount: {
11
11
  USD?: string | undefined;
12
12
  EUR?: string | undefined;
@@ -23,28 +23,21 @@ declare const transactionEntrySchema: yup$1.MixedSchema<{
23
23
  adjusted_entry_index: number | null;
24
24
  } | {
25
25
  type: "item_quantity_change";
26
+ quantity: number;
26
27
  item_id: string;
27
28
  customer_id: string;
28
- quantity: number;
29
- customer_type: "team" | "user" | "custom";
29
+ customer_type: "user" | "team" | "custom";
30
30
  adjusted_transaction_id: string | null;
31
31
  adjusted_entry_index: number | null;
32
32
  } | {
33
33
  one_time_purchase_id?: string | undefined;
34
34
  subscription_id?: string | undefined;
35
35
  type: "product_grant";
36
- customer_id: string;
37
- product_id: string | null;
38
- quantity: number;
39
- customer_type: "team" | "user" | "custom";
40
36
  product: {
41
- free_trial?: DayInterval | undefined;
42
37
  client_metadata?: {} | null | undefined;
43
38
  client_read_only_metadata?: {} | null | undefined;
44
39
  server_metadata?: {} | null | undefined;
45
- display_name: string;
46
- server_only: boolean;
47
- customer_type: "team" | "user" | "custom";
40
+ free_trial?: DayInterval | undefined;
48
41
  stackable: boolean;
49
42
  prices: Record<string, {
50
43
  interval?: DayInterval | undefined;
@@ -57,12 +50,19 @@ declare const transactionEntrySchema: yup$1.MixedSchema<{
57
50
  CAD?: string | undefined;
58
51
  free_trial?: DayInterval | undefined;
59
52
  }>;
53
+ display_name: string;
54
+ server_only: boolean;
55
+ customer_type: "user" | "team" | "custom";
60
56
  included_items: Record<string, {
61
- quantity?: number | undefined;
62
57
  repeat?: "never" | DayInterval | undefined;
58
+ quantity?: number | undefined;
63
59
  expires?: "never" | "when-purchase-expires" | "when-repeated" | undefined;
64
60
  }>;
65
61
  };
62
+ quantity: number;
63
+ customer_id: string;
64
+ product_id: string | null;
65
+ customer_type: "user" | "team" | "custom";
66
66
  adjusted_transaction_id: string | null;
67
67
  adjusted_entry_index: number | null;
68
68
  price_id: string | null;
@@ -85,12 +85,12 @@ declare const transactionSchema: yup$1.ObjectSchema<{
85
85
  created_at_millis: number;
86
86
  effective_at_millis: number;
87
87
  type: "purchase" | "subscription-cancellation" | "subscription-renewal" | "manual-item-quantity-change" | "refund" | "chargeback" | "product-change" | null;
88
- customer_type: "team" | "user" | "custom";
88
+ customer_type: "user" | "team" | "custom";
89
89
  customer_id: string;
90
90
  entries: ({
91
91
  type: "money_transfer";
92
92
  customer_id: string;
93
- customer_type: "team" | "user" | "custom";
93
+ customer_type: "user" | "team" | "custom";
94
94
  charged_amount: {
95
95
  USD?: string | undefined;
96
96
  EUR?: string | undefined;
@@ -107,28 +107,21 @@ declare const transactionSchema: yup$1.ObjectSchema<{
107
107
  adjusted_entry_index: number | null;
108
108
  } | {
109
109
  type: "item_quantity_change";
110
+ quantity: number;
110
111
  item_id: string;
111
112
  customer_id: string;
112
- quantity: number;
113
- customer_type: "team" | "user" | "custom";
113
+ customer_type: "user" | "team" | "custom";
114
114
  adjusted_transaction_id: string | null;
115
115
  adjusted_entry_index: number | null;
116
116
  } | {
117
117
  one_time_purchase_id?: string | undefined;
118
118
  subscription_id?: string | undefined;
119
119
  type: "product_grant";
120
- customer_id: string;
121
- product_id: string | null;
122
- quantity: number;
123
- customer_type: "team" | "user" | "custom";
124
120
  product: {
125
- free_trial?: DayInterval | undefined;
126
121
  client_metadata?: {} | null | undefined;
127
122
  client_read_only_metadata?: {} | null | undefined;
128
123
  server_metadata?: {} | null | undefined;
129
- display_name: string;
130
- server_only: boolean;
131
- customer_type: "team" | "user" | "custom";
124
+ free_trial?: DayInterval | undefined;
132
125
  stackable: boolean;
133
126
  prices: Record<string, {
134
127
  interval?: DayInterval | undefined;
@@ -141,12 +134,19 @@ declare const transactionSchema: yup$1.ObjectSchema<{
141
134
  CAD?: string | undefined;
142
135
  free_trial?: DayInterval | undefined;
143
136
  }>;
137
+ display_name: string;
138
+ server_only: boolean;
139
+ customer_type: "user" | "team" | "custom";
144
140
  included_items: Record<string, {
145
- quantity?: number | undefined;
146
141
  repeat?: "never" | DayInterval | undefined;
142
+ quantity?: number | undefined;
147
143
  expires?: "never" | "when-purchase-expires" | "when-repeated" | undefined;
148
144
  }>;
149
145
  };
146
+ quantity: number;
147
+ customer_id: string;
148
+ product_id: string | null;
149
+ customer_type: "user" | "team" | "custom";
150
150
  adjusted_transaction_id: string | null;
151
151
  adjusted_entry_index: number | null;
152
152
  price_id: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"transactions.d.ts","names":[],"sources":["../../../src/interface/crud/transactions.ts"],"mappings":";;;;;cAwFa,sBAAA,QAAsB,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMxB,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEC,gBAAA,GAAmB,SAAA,QAAiB,sBAAA;AAAA,cAEnC,iBAAA;AAAA,KAUD,eAAA,WAA0B,iBAAA;AAAA,cAEzB,iBAAA,QAAiB,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAkBlB,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEA,WAAA,GAAc,SAAA,QAAiB,iBAAA"}
1
+ {"version":3,"file":"transactions.d.ts","names":[],"sources":["../../../src/interface/crud/transactions.ts"],"mappings":";;;;;cAwFa,sBAAA,QAAsB,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMxB,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEC,gBAAA,GAAmB,SAAA,QAAiB,sBAAA;AAAA,cAEnC,iBAAA;AAAA,KAUD,eAAA,WAA0B,iBAAA;AAAA,cAEzB,iBAAA,QAAiB,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAkBlB,WAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEA,WAAA,GAAc,SAAA,QAAiB,iBAAA"}
@@ -162,12 +162,12 @@ declare const usersCrudServerReadSchema: yup$1.ObjectSchema<{
162
162
  requires_totp_mfa: undefined;
163
163
  }, "">;
164
164
  declare const usersCrudServerCreateSchema: yup$1.ObjectSchema<{
165
+ password: string | null | undefined;
165
166
  country_code: string | null | undefined;
166
167
  display_name: string | null | undefined;
167
168
  primary_email: string | null | undefined;
168
169
  profile_image_url: string | null | undefined;
169
170
  is_anonymous: boolean | undefined;
170
- password: string | null | undefined;
171
171
  client_metadata: {} | null | undefined;
172
172
  client_read_only_metadata: {} | null | undefined;
173
173
  server_metadata: {} | null | undefined;
@@ -368,12 +368,12 @@ declare const usersCrud: CrudSchemaFromOptions<{
368
368
  };
369
369
  }, "">;
370
370
  serverCreateSchema: yup$1.ObjectSchema<{
371
+ password: string | null | undefined;
371
372
  country_code: string | null | undefined;
372
373
  display_name: string | null | undefined;
373
374
  primary_email: string | null | undefined;
374
375
  profile_image_url: string | null | undefined;
375
376
  is_anonymous: boolean | undefined;
376
- password: string | null | undefined;
377
377
  client_metadata: {} | null | undefined;
378
378
  client_read_only_metadata: {} | null | undefined;
379
379
  server_metadata: {} | null | undefined;
@@ -98,7 +98,7 @@ declare const KnownErrors: {
98
98
  };
99
99
  AccessTypeWithoutProjectId: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
100
100
  constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
101
- } & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"ACCESS_TYPE_WITHOUT_PROJECT_ID">, [accessType: "client" | "server" | "admin"]> & {
101
+ } & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"ACCESS_TYPE_WITHOUT_PROJECT_ID">, [accessType: "server" | "admin" | "client"]> & {
102
102
  errorCode: "ACCESS_TYPE_WITHOUT_PROJECT_ID";
103
103
  };
104
104
  AccessTypeRequired: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
@@ -111,7 +111,7 @@ declare const KnownErrors: {
111
111
  };
112
112
  InsufficientAccessType: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
113
113
  constructorArgs: [statusCode: number, humanReadableMessage: string, details?: Json | undefined];
114
- } & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INSUFFICIENT_ACCESS_TYPE">, [actualAccessType: "client" | "server" | "admin", allowedAccessTypes: ("client" | "server" | "admin")[]]> & {
114
+ } & KnownErrorBrand<"INVALID_PROJECT_AUTHENTICATION"> & KnownErrorBrand<"INSUFFICIENT_ACCESS_TYPE">, [actualAccessType: "server" | "admin" | "client", allowedAccessTypes: ("server" | "admin" | "client")[]]> & {
115
115
  errorCode: "INSUFFICIENT_ACCESS_TYPE";
116
116
  };
117
117
  InvalidPublishableClientKey: KnownErrorConstructor<KnownError & KnownErrorBrand<"PROJECT_AUTHENTICATION_ERROR"> & {
@@ -369,7 +369,7 @@ declare const KnownErrors: {
369
369
  PermissionNotFound: KnownErrorConstructor<KnownError & KnownErrorBrand<"PERMISSION_NOT_FOUND">, [permissionId: string]> & {
370
370
  errorCode: "PERMISSION_NOT_FOUND";
371
371
  };
372
- PermissionScopeMismatch: KnownErrorConstructor<KnownError & KnownErrorBrand<"WRONG_PERMISSION_SCOPE">, [permissionId: string, expectedScope: "team" | "project", actualScope: "team" | "project" | null]> & {
372
+ PermissionScopeMismatch: KnownErrorConstructor<KnownError & KnownErrorBrand<"WRONG_PERMISSION_SCOPE">, [permissionId: string, expectedScope: "project" | "team", actualScope: "project" | "team" | null]> & {
373
373
  errorCode: "WRONG_PERMISSION_SCOPE";
374
374
  };
375
375
  ContainedPermissionNotFound: KnownErrorConstructor<KnownError & KnownErrorBrand<"CONTAINED_PERMISSION_NOT_FOUND">, [permissionId: string]> & {
@@ -512,7 +512,7 @@ declare const KnownErrors: {
512
512
  ItemNotFound: KnownErrorConstructor<KnownError & KnownErrorBrand<"ITEM_NOT_FOUND">, [itemId: string]> & {
513
513
  errorCode: "ITEM_NOT_FOUND";
514
514
  };
515
- ItemCustomerTypeDoesNotMatch: KnownErrorConstructor<KnownError & KnownErrorBrand<"ITEM_CUSTOMER_TYPE_DOES_NOT_MATCH">, [itemId: string, customerId: string, itemCustomerType: "team" | "user" | "custom" | undefined, actualCustomerType: "team" | "user" | "custom"]> & {
515
+ ItemCustomerTypeDoesNotMatch: KnownErrorConstructor<KnownError & KnownErrorBrand<"ITEM_CUSTOMER_TYPE_DOES_NOT_MATCH">, [itemId: string, customerId: string, itemCustomerType: "user" | "team" | "custom" | undefined, actualCustomerType: "user" | "team" | "custom"]> & {
516
516
  errorCode: "ITEM_CUSTOMER_TYPE_DOES_NOT_MATCH";
517
517
  };
518
518
  CustomerDoesNotExist: KnownErrorConstructor<KnownError & KnownErrorBrand<"CUSTOMER_DOES_NOT_EXIST">, [customerId: string]> & {
@@ -521,7 +521,7 @@ declare const KnownErrors: {
521
521
  ProductDoesNotExist: KnownErrorConstructor<KnownError & KnownErrorBrand<"PRODUCT_DOES_NOT_EXIST">, [productId: string, context: "item_exists" | "server_only" | null]> & {
522
522
  errorCode: "PRODUCT_DOES_NOT_EXIST";
523
523
  };
524
- ProductCustomerTypeDoesNotMatch: KnownErrorConstructor<KnownError & KnownErrorBrand<"PRODUCT_CUSTOMER_TYPE_DOES_NOT_MATCH">, [productId: string | undefined, customerId: string, productCustomerType: "team" | "user" | "custom" | undefined, actualCustomerType: "team" | "user" | "custom"]> & {
524
+ ProductCustomerTypeDoesNotMatch: KnownErrorConstructor<KnownError & KnownErrorBrand<"PRODUCT_CUSTOMER_TYPE_DOES_NOT_MATCH">, [productId: string | undefined, customerId: string, productCustomerType: "user" | "team" | "custom" | undefined, actualCustomerType: "user" | "team" | "custom"]> & {
525
525
  errorCode: "PRODUCT_CUSTOMER_TYPE_DOES_NOT_MATCH";
526
526
  };
527
527
  ProductAlreadyGranted: KnownErrorConstructor<KnownError & KnownErrorBrand<"PRODUCT_ALREADY_GRANTED">, [productId: string, customerId: string]> & {
@@ -548,7 +548,7 @@ declare const KnownErrors: {
548
548
  StripeAccountInfoNotFound: KnownErrorConstructor<KnownError & KnownErrorBrand<"STRIPE_ACCOUNT_INFO_NOT_FOUND">, []> & {
549
549
  errorCode: "STRIPE_ACCOUNT_INFO_NOT_FOUND";
550
550
  };
551
- DefaultPaymentMethodRequired: KnownErrorConstructor<KnownError & KnownErrorBrand<"DEFAULT_PAYMENT_METHOD_REQUIRED">, [customerType: "team" | "user", customerId: string]> & {
551
+ DefaultPaymentMethodRequired: KnownErrorConstructor<KnownError & KnownErrorBrand<"DEFAULT_PAYMENT_METHOD_REQUIRED">, [customerType: "user" | "team", customerId: string]> & {
552
552
  errorCode: "DEFAULT_PAYMENT_METHOD_REQUIRED";
553
553
  };
554
554
  NewPurchasesBlocked: KnownErrorConstructor<KnownError & KnownErrorBrand<"NEW_PURCHASES_BLOCKED">, []> & {
@@ -113,7 +113,7 @@ declare const moneyAmountSchema: (currency: Currency) => yup$1.StringSchema<stri
113
113
  */
114
114
  declare const strictEmailSchema: (message: string | undefined) => yup$1.StringSchema<string | undefined, yup$1.AnyObject, undefined, "">;
115
115
  declare const emailSchema: yup$1.StringSchema<string | undefined, yup$1.AnyObject, undefined, "">;
116
- declare const clientOrHigherAuthTypeSchema: yup$1.StringSchema<"client" | "server" | "admin", yup$1.AnyObject, undefined, "">;
116
+ declare const clientOrHigherAuthTypeSchema: yup$1.StringSchema<"server" | "admin" | "client", yup$1.AnyObject, undefined, "">;
117
117
  declare const serverOrHigherAuthTypeSchema: yup$1.StringSchema<"server" | "admin", yup$1.AnyObject, undefined, "">;
118
118
  declare const adminAuthTypeSchema: yup$1.StringSchema<"admin", yup$1.AnyObject, undefined, "">;
119
119
  declare const projectIdSchema: yup$1.StringSchema<string | undefined, yup$1.AnyObject, undefined, "">;
@@ -174,7 +174,7 @@ declare const customDashboardsSchema: yup$1.MixedSchema<Record<string, {
174
174
  displayName: string;
175
175
  tsxSource: string;
176
176
  }>, yup$1.AnyObject, undefined, "">;
177
- declare const customerTypeSchema: yup$1.StringSchema<"team" | "user" | "custom" | undefined, yup$1.AnyObject, undefined, "">;
177
+ declare const customerTypeSchema: yup$1.StringSchema<"user" | "team" | "custom" | undefined, yup$1.AnyObject, undefined, "">;
178
178
  /**
179
179
  * Schema for a single product price. Each currency field (USD, EUR, etc.) is a decimal string
180
180
  * like `"9.99"` or `"1000"` — never cent integers. See `MoneyAmount` for the exact format.
@@ -218,7 +218,7 @@ declare const productSchema: yup$1.ObjectSchema<{
218
218
  displayName: string | undefined;
219
219
  productLineId: string | undefined;
220
220
  isAddOnTo: false | Record<string, true> | undefined;
221
- customerType: "team" | "user" | "custom";
221
+ customerType: "user" | "team" | "custom";
222
222
  freeTrial: DayInterval | undefined;
223
223
  serverOnly: boolean | undefined;
224
224
  stackable: boolean | undefined;
@@ -257,7 +257,7 @@ declare const productSchemaWithMetadata: yup$1.ObjectSchema<{
257
257
  displayName: string | undefined;
258
258
  productLineId: string | undefined;
259
259
  isAddOnTo: false | Record<string, true> | undefined;
260
- customerType: "team" | "user" | "custom";
260
+ customerType: "user" | "team" | "custom";
261
261
  freeTrial: DayInterval | undefined;
262
262
  serverOnly: boolean | undefined;
263
263
  stackable: boolean | undefined;
@@ -298,7 +298,7 @@ declare const productSchemaWithMetadata: yup$1.ObjectSchema<{
298
298
  }, "">;
299
299
  declare const inlineProductSchema: yup$1.ObjectSchema<{
300
300
  display_name: string;
301
- customer_type: "team" | "user" | "custom";
301
+ customer_type: "user" | "team" | "custom";
302
302
  free_trial: DayInterval | undefined;
303
303
  server_only: boolean;
304
304
  stackable: boolean;
@@ -314,8 +314,8 @@ declare const inlineProductSchema: yup$1.ObjectSchema<{
314
314
  free_trial?: DayInterval | undefined;
315
315
  }>;
316
316
  included_items: Record<string, {
317
- quantity?: number | undefined;
318
317
  repeat?: "never" | DayInterval | undefined;
318
+ quantity?: number | undefined;
319
319
  expires?: "never" | "when-purchase-expires" | "when-repeated" | undefined;
320
320
  }>;
321
321
  client_metadata: {} | null | undefined;
@@ -469,8 +469,8 @@ declare function yupDefinedWhen<S extends yup$1.AnyObject>(schema: S, triggers:
469
469
  declare function yupDefinedAndNonEmptyWhen<S extends yup$1.StringSchema>(schema: S, triggers: Record<string, any>): S;
470
470
  declare const branchConfigSourceSchema: yup$1.MixedSchema<{
471
471
  workflow_path?: string | undefined;
472
- type: "pushed-from-github";
473
472
  branch: string;
473
+ type: "pushed-from-github";
474
474
  owner: string;
475
475
  repo: string;
476
476
  commit_hash: string;
@@ -9,8 +9,8 @@ declare class AccessToken {
9
9
  private constructor();
10
10
  get payload(): {
11
11
  exp?: number | undefined;
12
- name: string | null;
13
12
  sub: string;
13
+ name: string | null;
14
14
  iat: number;
15
15
  iss: string;
16
16
  aud: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hexclave/shared",
3
- "version": "1.0.33",
3
+ "version": "1.0.34",
4
4
  "repository": "https://github.com/hexclave/hexclave",
5
5
  "files": [
6
6
  "README.md",