squarefi-bff-api-module 1.36.41 → 1.36.44

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.
@@ -33,5 +33,11 @@ export declare const frontend: {
33
33
  deposit: ({ sub_account_id, ...data }: API.Frontend.Issuing.SubAccounts.Deposit.Request) => Promise<API.Frontend.Issuing.SubAccounts.Deposit.Response>;
34
34
  withdraw: ({ sub_account_id, ...data }: API.Frontend.Issuing.SubAccounts.Withdraw.Request) => Promise<API.Frontend.Issuing.SubAccounts.Withdraw.Response>;
35
35
  };
36
+ config: {
37
+ programs: {
38
+ getAll: (params?: API.Frontend.Issuing.Config.Programs.List.Request) => Promise<API.Frontend.Issuing.Config.Programs.List.Response>;
39
+ getById: ({ id, ...params }: API.Frontend.Issuing.Config.Programs.Get.Request) => Promise<API.Frontend.Issuing.Config.Programs.Get.Response>;
40
+ };
41
+ };
36
42
  };
37
43
  };
@@ -85,5 +85,15 @@ export const frontend = {
85
85
  // taken from the sub-account, so only the amount is needed.
86
86
  withdraw: ({ sub_account_id, ...data }) => apiClientV1Frontend.postRequest(`/frontend/issuing/sub-accounts/${sub_account_id}/withdraw`, { data }),
87
87
  },
88
+ // Program catalogue. Unlike the legacy `issuing.config.programs` (GET
89
+ // /issuing/config/programs), the frontend route carries each program's
90
+ // `cardholder_requirements` (the per-program cardholder KYC bar) and keeps
91
+ // `kyc_rails_id` so the wallet can hide programs on a closed/rejected rail.
92
+ config: {
93
+ programs: {
94
+ getAll: (params = {}) => apiClientV1Frontend.getRequest('/frontend/issuing/config/programs', { params }),
95
+ getById: ({ id, ...params }) => apiClientV1Frontend.getRequest(`/frontend/issuing/config/programs/${id}`, { params }),
96
+ },
97
+ },
88
98
  },
89
99
  };
@@ -3860,23 +3860,55 @@ export interface paths {
3860
3860
  success?: boolean;
3861
3861
  data?: {
3862
3862
  /** Format: uuid */
3863
- id?: string;
3864
- name?: string;
3863
+ id: string;
3864
+ name: string;
3865
3865
  description?: string | null;
3866
3866
  /** @enum {string} */
3867
- form_factor?: "VIRTUAL" | "PHYSICAL";
3867
+ form_factor: "VIRTUAL" | "PHYSICAL";
3868
3868
  /** @enum {string} */
3869
- type?: "DEBIT" | "CREDIT" | "PREPAID";
3869
+ type: "DEBIT" | "CREDIT" | "PREPAID";
3870
3870
  /** @enum {string} */
3871
- brand?: "VISA" | "MASTERCARD";
3871
+ brand: "VISA" | "MASTERCARD";
3872
3872
  /** @enum {string} */
3873
- sub_account_type?: "prepaid" | "balance";
3873
+ sub_account_type: "prepaid" | "balance";
3874
3874
  /** Format: uuid */
3875
- account_currency?: string;
3875
+ account_currency: string;
3876
+ /**
3877
+ * Format: uuid
3878
+ * @description The program's KYC rail. Returned on the frontend route so the wallet UI
3879
+ * can hide programs whose rail is closed for submission and unusable
3880
+ * (never submitted or rejected).
3881
+ *
3882
+ */
3883
+ kyc_rails_id?: string | null;
3884
+ /** @description What a cardholder on this program must carry. Set per program in the
3885
+ * vendor config, so it can change without a release — read it instead of
3886
+ * hardcoding the form. Absent only when the program has no vendor config.
3887
+ * */
3888
+ cardholder_requirements?: {
3889
+ /** @enum {string} */
3890
+ level?: "minimal" | "basic" | "full";
3891
+ /** @description Required field names; address fields are dotted (address.line1). */
3892
+ required?: string[];
3893
+ required_documents?: ("gov_id_front" | "gov_id_back" | "selfie")[];
3894
+ /** @description Human-readable constraints the field list cannot express. */
3895
+ notes?: string[];
3896
+ /** @description What each country changes, keyed by ISO 3166-1 alpha-3 with a `default`
3897
+ * entry; empty when the vendor reviews nothing.
3898
+ * */
3899
+ country_rules?: {
3900
+ [key: string]: {
3901
+ gov_id_types?: string[];
3902
+ required_by_nationality?: string[];
3903
+ required_by_address?: string[];
3904
+ notes?: string[];
3905
+ };
3906
+ };
3907
+ };
3876
3908
  /** @description Required fields for card creation */
3877
3909
  required_fields?: Record<string, never>;
3878
3910
  /** @description Array of order type IDs */
3879
- order_types?: string[];
3911
+ order_types: string[];
3880
3912
  /** @description Card issuing price from user group settings */
3881
3913
  issuing_price_usd?: number;
3882
3914
  /** @description Maximum cards allowed from group settings */
@@ -3886,11 +3918,11 @@ export interface paths {
3886
3918
  /** @description Monthly card creation limit from group settings */
3887
3919
  cards_per_month?: number | null;
3888
3920
  /** @enum {string} */
3889
- status?: "ACTIVE" | "INACTIVE";
3921
+ status: "ACTIVE" | "INACTIVE";
3890
3922
  /** @description Default card spending limit */
3891
- card_limit?: number;
3923
+ card_limit: number;
3892
3924
  /** @description Whether card supports Apple/Google Pay */
3893
- tokenizable?: boolean;
3925
+ tokenizable: boolean;
3894
3926
  /** @description Icon URL for UI display */
3895
3927
  icon?: string | null;
3896
3928
  /** @description Program code */
@@ -3983,21 +4015,53 @@ export interface paths {
3983
4015
  success?: boolean;
3984
4016
  data?: {
3985
4017
  /** Format: uuid */
3986
- id?: string;
3987
- name?: string;
4018
+ id: string;
4019
+ name: string;
3988
4020
  description?: string | null;
3989
4021
  /** @enum {string} */
3990
- form_factor?: "VIRTUAL" | "PHYSICAL";
4022
+ form_factor: "VIRTUAL" | "PHYSICAL";
3991
4023
  /** @enum {string} */
3992
- type?: "DEBIT" | "CREDIT" | "PREPAID";
4024
+ type: "DEBIT" | "CREDIT" | "PREPAID";
3993
4025
  /** @enum {string} */
3994
- brand?: "VISA" | "MASTERCARD";
4026
+ brand: "VISA" | "MASTERCARD";
3995
4027
  /** @enum {string} */
3996
- sub_account_type?: "prepaid" | "balance";
4028
+ sub_account_type: "prepaid" | "balance";
3997
4029
  /** Format: uuid */
3998
- account_currency?: string;
4030
+ account_currency: string;
4031
+ /**
4032
+ * Format: uuid
4033
+ * @description The program's KYC rail. Returned on the frontend route so the wallet UI
4034
+ * can hide programs whose rail is closed for submission and unusable
4035
+ * (never submitted or rejected).
4036
+ *
4037
+ */
4038
+ kyc_rails_id?: string | null;
4039
+ /** @description What a cardholder on this program must carry. Set per program in the
4040
+ * vendor config, so it can change without a release — read it instead of
4041
+ * hardcoding the form. Absent only when the program has no vendor config.
4042
+ * */
4043
+ cardholder_requirements?: {
4044
+ /** @enum {string} */
4045
+ level?: "minimal" | "basic" | "full";
4046
+ /** @description Required field names; address fields are dotted (address.line1). */
4047
+ required?: string[];
4048
+ required_documents?: ("gov_id_front" | "gov_id_back" | "selfie")[];
4049
+ /** @description Human-readable constraints the field list cannot express. */
4050
+ notes?: string[];
4051
+ /** @description What each country changes, keyed by ISO 3166-1 alpha-3 with a `default`
4052
+ * entry; empty when the vendor reviews nothing.
4053
+ * */
4054
+ country_rules?: {
4055
+ [key: string]: {
4056
+ gov_id_types?: string[];
4057
+ required_by_nationality?: string[];
4058
+ required_by_address?: string[];
4059
+ notes?: string[];
4060
+ };
4061
+ };
4062
+ };
3999
4063
  required_fields?: Record<string, never>;
4000
- order_types?: {
4064
+ order_types: {
4001
4065
  /** @description Order type ID (e.g. TRANSFER_CARD_SUBACCOUNT) */
4002
4066
  id?: string;
4003
4067
  tokens?: {
@@ -4524,6 +4588,10 @@ export interface paths {
4524
4588
  * - `PENDING` — a verification review is in flight; wait.
4525
4589
  * - `NEEDS_VERIFICATION` — no approved verification or no KYC applicant; the member has
4526
4590
  * to (re)run identity verification.
4591
+ * - `NEEDS_VERIFICATION_UPGRADE` — the member IS verified, but not to the level this program
4592
+ * demands (a required document — usually the selfie — was never captured). Read
4593
+ * `required_level` to name the bar ("requires FULL verification"). Same remediation as
4594
+ * `NEEDS_VERIFICATION`, run to add the missing step.
4527
4595
  * - `REJECTED` — a verification came back with a FINAL rejection; re-running it from the
4528
4596
  * app is not possible (support resets it), so never render a "verify now" action.
4529
4597
  * - `NOT_MEMBER` — the uuid is not an active member of this wallet.
@@ -4576,7 +4644,7 @@ export interface paths {
4576
4644
  /** Format: uuid */
4577
4645
  user_data_id: string;
4578
4646
  /** @enum {string} */
4579
- verdict: "READY" | "DRAFT" | "CAN_CREATE" | "PENDING" | "NEEDS_VERIFICATION" | "REJECTED" | "NOT_MEMBER";
4647
+ verdict: "READY" | "DRAFT" | "CAN_CREATE" | "PENDING" | "NEEDS_VERIFICATION" | "NEEDS_VERIFICATION_UPGRADE" | "REJECTED" | "NOT_MEMBER";
4580
4648
  /**
4581
4649
  * Format: uuid
4582
4650
  * @description The linked cardholder for READY/DRAFT verdicts
@@ -4584,6 +4652,14 @@ export interface paths {
4584
4652
  cardholder_id: string | null;
4585
4653
  /** @description Fields to collect by hand (submit `missing` vocabulary) */
4586
4654
  will_require: string[];
4655
+ /**
4656
+ * @description The KYC level this program demands. Lets the client name the bar in
4657
+ * the copy (e.g. "requires FULL verification" on a NEEDS_VERIFICATION
4658
+ * row). Null when the program bar could not be read.
4659
+ *
4660
+ * @enum {string|null}
4661
+ */
4662
+ required_level?: "minimal" | "basic" | "full" | null;
4587
4663
  }[];
4588
4664
  };
4589
4665
  };
@@ -850,6 +850,13 @@ export declare namespace API {
850
850
  | 'PENDING'
851
851
  /** No approved verification or no KYC applicant — the member must verify. */
852
852
  | 'NEEDS_VERIFICATION'
853
+ /**
854
+ * The member IS verified, but not to the level THIS program demands (a
855
+ * required document — usually the selfie — was never captured). Same
856
+ * remediation as NEEDS_VERIFICATION; read the program's
857
+ * `cardholder_requirements.level` to name the bar ("requires FULL").
858
+ */
859
+ | 'NEEDS_VERIFICATION_UPGRADE'
853
860
  /**
854
861
  * A verification came back with a FINAL rejection — only support can
855
862
  * reset it. Never render an actionable "verify now" for this state.
@@ -870,6 +877,14 @@ export declare namespace API {
870
877
  cardholder_id: string | null;
871
878
  /** Fields to collect by hand (submit `missing` vocabulary). */
872
879
  will_require: string[];
880
+ /**
881
+ * The KYC level this program demands, named for the copy on a
882
+ * NEEDS_VERIFICATION_UPGRADE row. Prefer the program's
883
+ * `cardholder_requirements.level` when the program is in hand; this is
884
+ * the same value carried on the verdict for convenience. Null when the
885
+ * program bar could not be read.
886
+ */
887
+ required_level?: 'minimal' | 'basic' | 'full' | null;
873
888
  };
874
889
  type Response = {
875
890
  success?: boolean;
@@ -919,6 +934,42 @@ export declare namespace API {
919
934
  }
920
935
  export {};
921
936
  }
937
+ export namespace Config {
938
+ namespace Programs {
939
+ type ProgramsRoot = pathsV1Frontend['/frontend/issuing/config/programs'];
940
+ type ProgramByIdRoot = pathsV1Frontend['/frontend/issuing/config/programs/{id}'];
941
+ /**
942
+ * A program as the frontend config route returns it — including `cardholder_requirements`
943
+ * (the per-program cardholder KYC bar) and `kyc_rails_id` (the wallet UI hides programs on
944
+ * a closed/rejected rail). Both come straight from the generated spec.
945
+ */
946
+ export type Program = NonNullable<ProgramsRoot['get']['responses']['200']['content']['application/json']['data']>[number];
947
+ /**
948
+ * The per-program cardholder KYC bar (`level` / `required` / `required_documents` /
949
+ * `country_rules`). Set in the program's vendor config, so it can change without a
950
+ * release — read it instead of hardcoding the form.
951
+ */
952
+ export type CardholderRequirements = NonNullable<Program['cardholder_requirements']>;
953
+ /** The KYC level a program demands. */
954
+ export type CardholderKycLevel = NonNullable<CardholderRequirements['level']>;
955
+ /** What each country changes about the cardholder dossier (a `country_rules` entry). */
956
+ export type CountryRule = NonNullable<NonNullable<CardholderRequirements['country_rules']>[string]>;
957
+ export namespace List {
958
+ /** The spec omits `wallet_id`, but the handler reads it to resolve the tariff group. */
959
+ type Request = NonNullable<ProgramsRoot['get']['parameters']['query']> & {
960
+ wallet_id?: string;
961
+ };
962
+ type Response = ProgramsRoot['get']['responses']['200']['content']['application/json'];
963
+ }
964
+ export namespace Get {
965
+ type Request = {
966
+ id: string;
967
+ } & NonNullable<ProgramByIdRoot['get']['parameters']['query']>;
968
+ type Response = ProgramByIdRoot['get']['responses']['200']['content']['application/json'];
969
+ }
970
+ export {};
971
+ }
972
+ }
922
973
  export {};
923
974
  }
924
975
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "squarefi-bff-api-module",
3
- "version": "1.36.41",
3
+ "version": "1.36.44",
4
4
  "description": "Squarefi BFF API client module",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",