mailmeteor 0.0.10 → 0.0.12

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/index.d.ts CHANGED
@@ -322,7 +322,7 @@ type ErrorResponse = {
322
322
  code?: 'url_invalid' | 'authentication_required' | 'rate_limit' | 'resource_missing' | 'resource_conflict' | 'resource_exhausted' | 'resource_already_exists' | 'resource_action_required' | 'account_verification_required' | 'account_unauthorized' | 'account_blocked' | 'parameter_missing' | 'parameter_invalid' | 'esp_unsupported' | 'unknown_error' | 'api_error' | 'quota_exceeded' | 'sender_missing_service' | 'sender_insufficient_permission' | 'admin_role_required' | 'TEST_ERROR';
323
323
  };
324
324
  type UserIdQuery = {
325
- expand?: Array<'subscription'>;
325
+ expand?: Array<'billing' | 'billing.subscription'>;
326
326
  };
327
327
  type UserIdParams = {
328
328
  user_id: string;
@@ -338,8 +338,8 @@ type UserIdResponse200 = {
338
338
  limit: number;
339
339
  usage: number;
340
340
  available: number;
341
- updated: string;
342
- refreshDate?: string;
341
+ updated_at: number;
342
+ reset_at?: number | null;
343
343
  };
344
344
  organization: string | null;
345
345
  /**
@@ -378,39 +378,43 @@ type UserIdResponse200 = {
378
378
  api_key?: string;
379
379
  };
380
380
  };
381
- subscription?: {
382
- id: string;
383
- created_at: number;
384
- /**
385
- * Whether the user is a billing admin
386
- */
387
- admin: boolean;
388
- current_period_start: number;
389
- current_period_end: number;
390
- quantity: number;
391
- currency: string;
392
- amount: number | null;
393
- discount_percentage?: number | null;
394
- name: string | null;
395
- billing_period: 'day' | 'week' | 'month' | 'year' | null;
396
- plan: 'free' | 'starter' | 'pro' | 'premium' | 'business' | null;
397
- default_payment_method: {
398
- type: string;
399
- brand?: string | null;
400
- last4: string | null;
401
- exp_month: number | null;
402
- exp_year: number | null;
403
- bank_name?: string | null;
404
- } | null;
405
- addons: {
406
- senders?: {
407
- quantity: number;
408
- };
409
- email_warmups?: {
410
- quantity: number;
381
+ billing?: {
382
+ customer?: string | null;
383
+ currency?: string | null;
384
+ subscription?: {
385
+ id: string;
386
+ created_at: number;
387
+ /**
388
+ * Whether the user is a billing admin
389
+ */
390
+ admin: boolean;
391
+ current_period_start: number;
392
+ current_period_end: number;
393
+ quantity: number;
394
+ currency: string;
395
+ amount: number | null;
396
+ discount_percentage?: number | null;
397
+ name: string | null;
398
+ billing_period: 'day' | 'week' | 'month' | 'year' | null;
399
+ plan: 'free' | 'starter' | 'pro' | 'premium' | 'business' | null;
400
+ default_payment_method: {
401
+ type: string;
402
+ brand?: string | null;
403
+ last4: string | null;
404
+ exp_month: number | null;
405
+ exp_year: number | null;
406
+ bank_name?: string | null;
407
+ } | null;
408
+ addons: {
409
+ senders?: {
410
+ quantity: number;
411
+ };
412
+ email_warmups?: {
413
+ quantity: number;
414
+ };
411
415
  };
412
- };
413
- } | null;
416
+ } | null;
417
+ };
414
418
  };
415
419
  type CurrentOrganizationParams = {
416
420
  user_id: string;
@@ -440,6 +444,7 @@ type MembersParams = {
440
444
  organization_id: string;
441
445
  };
442
446
  type MembersResponse200 = Array<{
447
+ status: 'active' | 'cancel_at_period_end';
443
448
  user: string;
444
449
  roles: Array<'admin' | 'member'>;
445
450
  created_at: number;
@@ -456,6 +461,7 @@ type MembersBody = {
456
461
  roles: Array<'admin' | 'member'>;
457
462
  };
458
463
  type MembersResponse201 = {
464
+ status: 'active' | 'cancel_at_period_end';
459
465
  user: string;
460
466
  roles: Array<'admin' | 'member'>;
461
467
  created_at: number;
@@ -475,6 +481,7 @@ type MemberIdParams = {
475
481
  member_id: string;
476
482
  };
477
483
  type MemberIdResponse200 = {
484
+ status: 'active' | 'cancel_at_period_end';
478
485
  user: string;
479
486
  roles: Array<'admin' | 'member'>;
480
487
  created_at: number;
@@ -868,7 +875,7 @@ type UsersRetrieveData = {
868
875
  user_id: string;
869
876
  };
870
877
  query?: {
871
- expand?: Array<'subscription'>;
878
+ expand?: Array<'billing' | 'billing.subscription'>;
872
879
  };
873
880
  url: '/users/{user_id}';
874
881
  };
@@ -894,8 +901,8 @@ type UsersRetrieveResponses = {
894
901
  limit: number;
895
902
  usage: number;
896
903
  available: number;
897
- updated: string;
898
- refreshDate?: string;
904
+ updated_at: number;
905
+ reset_at?: number | null;
899
906
  };
900
907
  organization: string | null;
901
908
  /**
@@ -934,39 +941,43 @@ type UsersRetrieveResponses = {
934
941
  api_key?: string;
935
942
  };
936
943
  };
937
- subscription?: {
938
- id: string;
939
- created_at: number;
940
- /**
941
- * Whether the user is a billing admin
942
- */
943
- admin: boolean;
944
- current_period_start: number;
945
- current_period_end: number;
946
- quantity: number;
947
- currency: string;
948
- amount: number | null;
949
- discount_percentage?: number | null;
950
- name: string | null;
951
- billing_period: 'day' | 'week' | 'month' | 'year' | null;
952
- plan: 'free' | 'starter' | 'pro' | 'premium' | 'business' | null;
953
- default_payment_method: {
954
- type: string;
955
- brand?: string | null;
956
- last4: string | null;
957
- exp_month: number | null;
958
- exp_year: number | null;
959
- bank_name?: string | null;
960
- } | null;
961
- addons: {
962
- senders?: {
963
- quantity: number;
964
- };
965
- email_warmups?: {
966
- quantity: number;
944
+ billing?: {
945
+ customer?: string | null;
946
+ currency?: string | null;
947
+ subscription?: {
948
+ id: string;
949
+ created_at: number;
950
+ /**
951
+ * Whether the user is a billing admin
952
+ */
953
+ admin: boolean;
954
+ current_period_start: number;
955
+ current_period_end: number;
956
+ quantity: number;
957
+ currency: string;
958
+ amount: number | null;
959
+ discount_percentage?: number | null;
960
+ name: string | null;
961
+ billing_period: 'day' | 'week' | 'month' | 'year' | null;
962
+ plan: 'free' | 'starter' | 'pro' | 'premium' | 'business' | null;
963
+ default_payment_method: {
964
+ type: string;
965
+ brand?: string | null;
966
+ last4: string | null;
967
+ exp_month: number | null;
968
+ exp_year: number | null;
969
+ bank_name?: string | null;
970
+ } | null;
971
+ addons: {
972
+ senders?: {
973
+ quantity: number;
974
+ };
975
+ email_warmups?: {
976
+ quantity: number;
977
+ };
967
978
  };
968
- };
969
- } | null;
979
+ } | null;
980
+ };
970
981
  };
971
982
  };
972
983
  type UsersRetrieveResponse = UsersRetrieveResponses[keyof UsersRetrieveResponses];
@@ -1091,6 +1102,7 @@ type OrganizationMembersListResponses = {
1091
1102
  * Response
1092
1103
  */
1093
1104
  200: Array<{
1105
+ status: 'active' | 'cancel_at_period_end';
1094
1106
  user: string;
1095
1107
  roles: Array<'admin' | 'member'>;
1096
1108
  created_at: number;
@@ -1127,6 +1139,7 @@ type OrganizationMembersCreateResponses = {
1127
1139
  * Response
1128
1140
  */
1129
1141
  201: {
1142
+ status: 'active' | 'cancel_at_period_end';
1130
1143
  user: string;
1131
1144
  roles: Array<'admin' | 'member'>;
1132
1145
  created_at: number;
@@ -1186,6 +1199,7 @@ type OrganizationMembersUpdateResponses = {
1186
1199
  * Response
1187
1200
  */
1188
1201
  200: {
1202
+ status: 'active' | 'cancel_at_period_end';
1189
1203
  user: string;
1190
1204
  roles: Array<'admin' | 'member'>;
1191
1205
  created_at: number;
@@ -2582,7 +2596,7 @@ declare class HeyApiClient {
2582
2596
  }
2583
2597
  declare class Users extends HeyApiClient {
2584
2598
  retrieve<ThrowOnError extends boolean = true>(user_id: string, parameters?: {
2585
- expand?: Array<'subscription'>;
2599
+ expand?: Array<'billing' | 'billing.subscription'>;
2586
2600
  }, options?: Options<never, ThrowOnError>): RequestResult<UsersRetrieveResponses, UsersRetrieveErrors, ThrowOnError, "data">;
2587
2601
  getCurrentOrganization<ThrowOnError extends boolean = true>(user_id: string, options?: Options<never, ThrowOnError>): RequestResult<UsersGetCurrentOrganizationResponses, UsersGetCurrentOrganizationErrors, ThrowOnError, "data">;
2588
2602
  setCurrentOrganization<ThrowOnError extends boolean = true>(user_id: string, parameters?: {
package/dist/index.mjs CHANGED
@@ -1607,12 +1607,29 @@ var types_gen = /*#__PURE__*/Object.freeze({
1607
1607
  __proto__: null
1608
1608
  });
1609
1609
 
1610
+ function querySerializer(query) {
1611
+ const parts = [];
1612
+ for (const [key, value] of Object.entries(query)) {
1613
+ if (value === undefined || value === null)
1614
+ continue;
1615
+ if (Array.isArray(value)) {
1616
+ for (const item of value) {
1617
+ parts.push(`${encodeURIComponent(key)}[]=${encodeURIComponent(String(item))}`);
1618
+ }
1619
+ }
1620
+ else {
1621
+ parts.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
1622
+ }
1623
+ }
1624
+ return parts.join('&');
1625
+ }
1610
1626
  class Mailmeteor {
1611
1627
  constructor(key, config) {
1612
1628
  const baseUrl = config?.baseUrl || "https://api.mailmeteor.com/v1";
1613
1629
  this.client = createClient(createConfig({
1614
1630
  baseUrl,
1615
1631
  throwOnError: true,
1632
+ querySerializer,
1616
1633
  headers: {
1617
1634
  'Authorization': `Bearer ${key}`,
1618
1635
  },