@happyvertical/smrt-commerce 0.37.11 → 0.38.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/AGENTS.md +2 -0
- package/dist/chunks/{types-B0DwBRVz.js → types-CRnln577.js} +8 -2
- package/dist/chunks/types-CRnln577.js.map +1 -0
- package/dist/collections/PaymentInstrumentCollection.d.ts +67 -0
- package/dist/collections/PaymentInstrumentCollection.d.ts.map +1 -0
- package/dist/collections/index.d.ts +1 -0
- package/dist/collections/index.d.ts.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +354 -108
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +455 -2
- package/dist/models/PaymentInstrument.d.ts +111 -0
- package/dist/models/PaymentInstrument.d.ts.map +1 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.d.ts.map +1 -1
- package/dist/smrt-knowledge.json +289 -8
- package/dist/types/index.d.ts +27 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +7 -7
- package/dist/chunks/types-B0DwBRVz.js.map +0 -1
package/dist/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "1.0.0",
|
|
3
|
-
"timestamp":
|
|
3
|
+
"timestamp": 1783111249719,
|
|
4
4
|
"packageName": "@happyvertical/smrt-commerce",
|
|
5
|
-
"packageVersion": "0.
|
|
5
|
+
"packageVersion": "0.38.0",
|
|
6
6
|
"objects": {
|
|
7
7
|
"@happyvertical/smrt-commerce:ContractCollection": {
|
|
8
8
|
"name": "contractcollection",
|
|
@@ -1783,6 +1783,181 @@
|
|
|
1783
1783
|
"version": "bf759c9b"
|
|
1784
1784
|
}
|
|
1785
1785
|
},
|
|
1786
|
+
"@happyvertical/smrt-commerce:PaymentInstrumentCollection": {
|
|
1787
|
+
"name": "paymentinstrumentcollection",
|
|
1788
|
+
"className": "PaymentInstrumentCollection",
|
|
1789
|
+
"qualifiedName": "@happyvertical/smrt-commerce:PaymentInstrumentCollection",
|
|
1790
|
+
"collection": "paymentinstruments",
|
|
1791
|
+
"filePath": "/home/runner/_work/smrt/smrt/packages/commerce/src/collections/PaymentInstrumentCollection.ts",
|
|
1792
|
+
"packageName": "@happyvertical/smrt-commerce",
|
|
1793
|
+
"fields": {},
|
|
1794
|
+
"methods": {
|
|
1795
|
+
"findByCustomer": {
|
|
1796
|
+
"name": "findByCustomer",
|
|
1797
|
+
"async": true,
|
|
1798
|
+
"parameters": [
|
|
1799
|
+
{
|
|
1800
|
+
"name": "customerId",
|
|
1801
|
+
"type": "string",
|
|
1802
|
+
"optional": false
|
|
1803
|
+
}
|
|
1804
|
+
],
|
|
1805
|
+
"returnType": "Promise<PaymentInstrument[]>",
|
|
1806
|
+
"isStatic": false,
|
|
1807
|
+
"isPublic": true
|
|
1808
|
+
},
|
|
1809
|
+
"findActiveByCustomer": {
|
|
1810
|
+
"name": "findActiveByCustomer",
|
|
1811
|
+
"async": true,
|
|
1812
|
+
"parameters": [
|
|
1813
|
+
{
|
|
1814
|
+
"name": "customerId",
|
|
1815
|
+
"type": "string",
|
|
1816
|
+
"optional": false
|
|
1817
|
+
}
|
|
1818
|
+
],
|
|
1819
|
+
"returnType": "Promise<PaymentInstrument[]>",
|
|
1820
|
+
"isStatic": false,
|
|
1821
|
+
"isPublic": true
|
|
1822
|
+
},
|
|
1823
|
+
"findDefaultForCustomer": {
|
|
1824
|
+
"name": "findDefaultForCustomer",
|
|
1825
|
+
"async": true,
|
|
1826
|
+
"parameters": [
|
|
1827
|
+
{
|
|
1828
|
+
"name": "customerId",
|
|
1829
|
+
"type": "string",
|
|
1830
|
+
"optional": false
|
|
1831
|
+
}
|
|
1832
|
+
],
|
|
1833
|
+
"returnType": "Promise<PaymentInstrument | null>",
|
|
1834
|
+
"isStatic": false,
|
|
1835
|
+
"isPublic": true
|
|
1836
|
+
},
|
|
1837
|
+
"findByProviderPaymentMethodId": {
|
|
1838
|
+
"name": "findByProviderPaymentMethodId",
|
|
1839
|
+
"async": true,
|
|
1840
|
+
"parameters": [
|
|
1841
|
+
{
|
|
1842
|
+
"name": "providerPaymentMethodId",
|
|
1843
|
+
"type": "string",
|
|
1844
|
+
"optional": false
|
|
1845
|
+
}
|
|
1846
|
+
],
|
|
1847
|
+
"returnType": "Promise<PaymentInstrument | null>",
|
|
1848
|
+
"isStatic": false,
|
|
1849
|
+
"isPublic": true
|
|
1850
|
+
},
|
|
1851
|
+
"setDefaultForCustomer": {
|
|
1852
|
+
"name": "setDefaultForCustomer",
|
|
1853
|
+
"async": true,
|
|
1854
|
+
"parameters": [
|
|
1855
|
+
{
|
|
1856
|
+
"name": "customerId",
|
|
1857
|
+
"type": "string",
|
|
1858
|
+
"optional": false
|
|
1859
|
+
},
|
|
1860
|
+
{
|
|
1861
|
+
"name": "instrumentId",
|
|
1862
|
+
"type": "string",
|
|
1863
|
+
"optional": false
|
|
1864
|
+
}
|
|
1865
|
+
],
|
|
1866
|
+
"returnType": "Promise<void>",
|
|
1867
|
+
"isStatic": false,
|
|
1868
|
+
"isPublic": true
|
|
1869
|
+
},
|
|
1870
|
+
"findByTenant": {
|
|
1871
|
+
"name": "findByTenant",
|
|
1872
|
+
"async": true,
|
|
1873
|
+
"parameters": [
|
|
1874
|
+
{
|
|
1875
|
+
"name": "tenantId",
|
|
1876
|
+
"type": "string",
|
|
1877
|
+
"optional": false
|
|
1878
|
+
}
|
|
1879
|
+
],
|
|
1880
|
+
"returnType": "Promise<PaymentInstrument[]>",
|
|
1881
|
+
"isStatic": false,
|
|
1882
|
+
"isPublic": true
|
|
1883
|
+
},
|
|
1884
|
+
"findGlobal": {
|
|
1885
|
+
"name": "findGlobal",
|
|
1886
|
+
"async": true,
|
|
1887
|
+
"parameters": [],
|
|
1888
|
+
"returnType": "Promise<PaymentInstrument[]>",
|
|
1889
|
+
"isStatic": false,
|
|
1890
|
+
"isPublic": true
|
|
1891
|
+
},
|
|
1892
|
+
"findWithGlobals": {
|
|
1893
|
+
"name": "findWithGlobals",
|
|
1894
|
+
"async": true,
|
|
1895
|
+
"parameters": [
|
|
1896
|
+
{
|
|
1897
|
+
"name": "tenantId",
|
|
1898
|
+
"type": "string",
|
|
1899
|
+
"optional": false
|
|
1900
|
+
}
|
|
1901
|
+
],
|
|
1902
|
+
"returnType": "Promise<PaymentInstrument[]>",
|
|
1903
|
+
"isStatic": false,
|
|
1904
|
+
"isPublic": true
|
|
1905
|
+
}
|
|
1906
|
+
},
|
|
1907
|
+
"decoratorConfig": {},
|
|
1908
|
+
"extends": "SmrtCollection",
|
|
1909
|
+
"extendsTypeArg": "PaymentInstrument",
|
|
1910
|
+
"exportName": "PaymentInstrumentCollection",
|
|
1911
|
+
"collectionExportName": "PaymentInstrumentCollectionCollection",
|
|
1912
|
+
"schema": {
|
|
1913
|
+
"tableName": "payment_instrument_collections",
|
|
1914
|
+
"ddl": "CREATE TABLE IF NOT EXISTS \"payment_instrument_collections\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
|
|
1915
|
+
"columns": {
|
|
1916
|
+
"id": {
|
|
1917
|
+
"type": "UUID",
|
|
1918
|
+
"primaryKey": true,
|
|
1919
|
+
"referenceKind": "id",
|
|
1920
|
+
"notNull": true
|
|
1921
|
+
},
|
|
1922
|
+
"slug": {
|
|
1923
|
+
"type": "TEXT",
|
|
1924
|
+
"notNull": true
|
|
1925
|
+
},
|
|
1926
|
+
"context": {
|
|
1927
|
+
"type": "TEXT",
|
|
1928
|
+
"notNull": true,
|
|
1929
|
+
"default": ""
|
|
1930
|
+
},
|
|
1931
|
+
"created_at": {
|
|
1932
|
+
"type": "TIMESTAMP",
|
|
1933
|
+
"notNull": true,
|
|
1934
|
+
"default": "current_timestamp"
|
|
1935
|
+
},
|
|
1936
|
+
"updated_at": {
|
|
1937
|
+
"type": "TIMESTAMP",
|
|
1938
|
+
"notNull": true,
|
|
1939
|
+
"default": "current_timestamp"
|
|
1940
|
+
}
|
|
1941
|
+
},
|
|
1942
|
+
"indexes": [
|
|
1943
|
+
{
|
|
1944
|
+
"name": "payment_instrument_collections_id_idx",
|
|
1945
|
+
"columns": [
|
|
1946
|
+
"id"
|
|
1947
|
+
]
|
|
1948
|
+
},
|
|
1949
|
+
{
|
|
1950
|
+
"name": "payment_instrument_collections_slug_context_idx",
|
|
1951
|
+
"columns": [
|
|
1952
|
+
"slug",
|
|
1953
|
+
"context"
|
|
1954
|
+
],
|
|
1955
|
+
"unique": true
|
|
1956
|
+
}
|
|
1957
|
+
],
|
|
1958
|
+
"version": "dd2ca72c"
|
|
1959
|
+
}
|
|
1960
|
+
},
|
|
1786
1961
|
"@happyvertical/smrt-commerce:PaymentIntentCollection": {
|
|
1787
1962
|
"name": "paymentintentcollection",
|
|
1788
1963
|
"className": "PaymentIntentCollection",
|
|
@@ -13264,6 +13439,284 @@
|
|
|
13264
13439
|
"version": "6868b743"
|
|
13265
13440
|
}
|
|
13266
13441
|
},
|
|
13442
|
+
"@happyvertical/smrt-commerce:PaymentInstrument": {
|
|
13443
|
+
"name": "paymentinstrument",
|
|
13444
|
+
"className": "PaymentInstrument",
|
|
13445
|
+
"qualifiedName": "@happyvertical/smrt-commerce:PaymentInstrument",
|
|
13446
|
+
"collection": "paymentinstruments",
|
|
13447
|
+
"filePath": "/home/runner/_work/smrt/smrt/packages/commerce/src/models/PaymentInstrument.ts",
|
|
13448
|
+
"packageName": "@happyvertical/smrt-commerce",
|
|
13449
|
+
"fields": {
|
|
13450
|
+
"tenantId": {
|
|
13451
|
+
"type": "text",
|
|
13452
|
+
"required": false,
|
|
13453
|
+
"_meta": {
|
|
13454
|
+
"sqlType": "UUID",
|
|
13455
|
+
"nullable": true,
|
|
13456
|
+
"__tenancy": {
|
|
13457
|
+
"isTenantIdField": true,
|
|
13458
|
+
"autoFilter": true,
|
|
13459
|
+
"required": false,
|
|
13460
|
+
"autoPopulate": true,
|
|
13461
|
+
"nullable": true,
|
|
13462
|
+
"mode": "optional",
|
|
13463
|
+
"field": "tenantId",
|
|
13464
|
+
"allowSuperAdminBypass": false
|
|
13465
|
+
}
|
|
13466
|
+
}
|
|
13467
|
+
},
|
|
13468
|
+
"customerId": {
|
|
13469
|
+
"type": "foreignKey",
|
|
13470
|
+
"required": false,
|
|
13471
|
+
"related": "Customer"
|
|
13472
|
+
},
|
|
13473
|
+
"backendId": {
|
|
13474
|
+
"type": "text",
|
|
13475
|
+
"required": false,
|
|
13476
|
+
"default": ""
|
|
13477
|
+
},
|
|
13478
|
+
"providerCustomerId": {
|
|
13479
|
+
"type": "text",
|
|
13480
|
+
"required": false,
|
|
13481
|
+
"default": ""
|
|
13482
|
+
},
|
|
13483
|
+
"providerPaymentMethodId": {
|
|
13484
|
+
"type": "text",
|
|
13485
|
+
"required": false,
|
|
13486
|
+
"default": ""
|
|
13487
|
+
},
|
|
13488
|
+
"type": {
|
|
13489
|
+
"type": "text",
|
|
13490
|
+
"required": false,
|
|
13491
|
+
"default": "card"
|
|
13492
|
+
},
|
|
13493
|
+
"brand": {
|
|
13494
|
+
"type": "text",
|
|
13495
|
+
"required": false,
|
|
13496
|
+
"default": ""
|
|
13497
|
+
},
|
|
13498
|
+
"last4": {
|
|
13499
|
+
"type": "text",
|
|
13500
|
+
"required": false,
|
|
13501
|
+
"default": ""
|
|
13502
|
+
},
|
|
13503
|
+
"expMonth": {
|
|
13504
|
+
"type": "integer",
|
|
13505
|
+
"required": false,
|
|
13506
|
+
"default": 0
|
|
13507
|
+
},
|
|
13508
|
+
"expYear": {
|
|
13509
|
+
"type": "integer",
|
|
13510
|
+
"required": false,
|
|
13511
|
+
"default": 0
|
|
13512
|
+
},
|
|
13513
|
+
"isDefault": {
|
|
13514
|
+
"type": "boolean",
|
|
13515
|
+
"required": false,
|
|
13516
|
+
"default": false
|
|
13517
|
+
},
|
|
13518
|
+
"status": {
|
|
13519
|
+
"type": "text",
|
|
13520
|
+
"required": false
|
|
13521
|
+
}
|
|
13522
|
+
},
|
|
13523
|
+
"methods": {
|
|
13524
|
+
"isActive": {
|
|
13525
|
+
"name": "isActive",
|
|
13526
|
+
"async": false,
|
|
13527
|
+
"parameters": [],
|
|
13528
|
+
"returnType": "boolean",
|
|
13529
|
+
"isStatic": false,
|
|
13530
|
+
"isPublic": true
|
|
13531
|
+
},
|
|
13532
|
+
"isExpired": {
|
|
13533
|
+
"name": "isExpired",
|
|
13534
|
+
"async": false,
|
|
13535
|
+
"parameters": [],
|
|
13536
|
+
"returnType": "boolean",
|
|
13537
|
+
"isStatic": false,
|
|
13538
|
+
"isPublic": true
|
|
13539
|
+
},
|
|
13540
|
+
"isRemoved": {
|
|
13541
|
+
"name": "isRemoved",
|
|
13542
|
+
"async": false,
|
|
13543
|
+
"parameters": [],
|
|
13544
|
+
"returnType": "boolean",
|
|
13545
|
+
"isStatic": false,
|
|
13546
|
+
"isPublic": true
|
|
13547
|
+
},
|
|
13548
|
+
"markExpired": {
|
|
13549
|
+
"name": "markExpired",
|
|
13550
|
+
"async": false,
|
|
13551
|
+
"parameters": [],
|
|
13552
|
+
"returnType": "void",
|
|
13553
|
+
"isStatic": false,
|
|
13554
|
+
"isPublic": true
|
|
13555
|
+
},
|
|
13556
|
+
"markRemoved": {
|
|
13557
|
+
"name": "markRemoved",
|
|
13558
|
+
"async": false,
|
|
13559
|
+
"parameters": [],
|
|
13560
|
+
"returnType": "void",
|
|
13561
|
+
"isStatic": false,
|
|
13562
|
+
"isPublic": true
|
|
13563
|
+
}
|
|
13564
|
+
},
|
|
13565
|
+
"decoratorConfig": {
|
|
13566
|
+
"api": {
|
|
13567
|
+
"include": [
|
|
13568
|
+
"list",
|
|
13569
|
+
"get",
|
|
13570
|
+
"create",
|
|
13571
|
+
"update"
|
|
13572
|
+
],
|
|
13573
|
+
"writable": [
|
|
13574
|
+
"customerId",
|
|
13575
|
+
"backendId",
|
|
13576
|
+
"providerCustomerId",
|
|
13577
|
+
"providerPaymentMethodId",
|
|
13578
|
+
"type",
|
|
13579
|
+
"brand",
|
|
13580
|
+
"last4",
|
|
13581
|
+
"expMonth",
|
|
13582
|
+
"expYear",
|
|
13583
|
+
"status"
|
|
13584
|
+
]
|
|
13585
|
+
},
|
|
13586
|
+
"mcp": {
|
|
13587
|
+
"include": [
|
|
13588
|
+
"list",
|
|
13589
|
+
"get"
|
|
13590
|
+
]
|
|
13591
|
+
},
|
|
13592
|
+
"cli": true,
|
|
13593
|
+
"tenantScoped": {
|
|
13594
|
+
"mode": "optional"
|
|
13595
|
+
}
|
|
13596
|
+
},
|
|
13597
|
+
"extends": "SmrtObject",
|
|
13598
|
+
"exportName": "PaymentInstrument",
|
|
13599
|
+
"collectionExportName": "PaymentInstrumentCollection",
|
|
13600
|
+
"schema": {
|
|
13601
|
+
"tableName": "payment_instruments",
|
|
13602
|
+
"ddl": "CREATE TABLE IF NOT EXISTS \"payment_instruments\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"customer_id\" UUID,\n \"backend_id\" TEXT DEFAULT '',\n \"provider_customer_id\" TEXT DEFAULT '',\n \"provider_payment_method_id\" TEXT DEFAULT '',\n \"type\" TEXT DEFAULT 'card',\n \"brand\" TEXT DEFAULT '',\n \"last4\" TEXT DEFAULT '',\n \"exp_month\" INTEGER DEFAULT 0,\n \"exp_year\" INTEGER DEFAULT 0,\n \"is_default\" BOOLEAN DEFAULT FALSE,\n \"status\" TEXT\n);",
|
|
13603
|
+
"columns": {
|
|
13604
|
+
"id": {
|
|
13605
|
+
"type": "UUID",
|
|
13606
|
+
"primaryKey": true,
|
|
13607
|
+
"referenceKind": "id",
|
|
13608
|
+
"notNull": true
|
|
13609
|
+
},
|
|
13610
|
+
"slug": {
|
|
13611
|
+
"type": "TEXT",
|
|
13612
|
+
"notNull": true
|
|
13613
|
+
},
|
|
13614
|
+
"context": {
|
|
13615
|
+
"type": "TEXT",
|
|
13616
|
+
"notNull": true,
|
|
13617
|
+
"default": ""
|
|
13618
|
+
},
|
|
13619
|
+
"created_at": {
|
|
13620
|
+
"type": "TIMESTAMP",
|
|
13621
|
+
"notNull": true,
|
|
13622
|
+
"default": "current_timestamp"
|
|
13623
|
+
},
|
|
13624
|
+
"updated_at": {
|
|
13625
|
+
"type": "TIMESTAMP",
|
|
13626
|
+
"notNull": true,
|
|
13627
|
+
"default": "current_timestamp"
|
|
13628
|
+
},
|
|
13629
|
+
"tenant_id": {
|
|
13630
|
+
"type": "UUID",
|
|
13631
|
+
"referenceKind": "tenantId",
|
|
13632
|
+
"notNull": false,
|
|
13633
|
+
"unique": false
|
|
13634
|
+
},
|
|
13635
|
+
"customer_id": {
|
|
13636
|
+
"type": "UUID",
|
|
13637
|
+
"referenceKind": "foreignKey",
|
|
13638
|
+
"notNull": false,
|
|
13639
|
+
"unique": false
|
|
13640
|
+
},
|
|
13641
|
+
"backend_id": {
|
|
13642
|
+
"type": "TEXT",
|
|
13643
|
+
"notNull": false,
|
|
13644
|
+
"unique": false,
|
|
13645
|
+
"default": ""
|
|
13646
|
+
},
|
|
13647
|
+
"provider_customer_id": {
|
|
13648
|
+
"type": "TEXT",
|
|
13649
|
+
"notNull": false,
|
|
13650
|
+
"unique": false,
|
|
13651
|
+
"default": ""
|
|
13652
|
+
},
|
|
13653
|
+
"provider_payment_method_id": {
|
|
13654
|
+
"type": "TEXT",
|
|
13655
|
+
"notNull": false,
|
|
13656
|
+
"unique": false,
|
|
13657
|
+
"default": ""
|
|
13658
|
+
},
|
|
13659
|
+
"type": {
|
|
13660
|
+
"type": "TEXT",
|
|
13661
|
+
"notNull": false,
|
|
13662
|
+
"unique": false,
|
|
13663
|
+
"default": "card"
|
|
13664
|
+
},
|
|
13665
|
+
"brand": {
|
|
13666
|
+
"type": "TEXT",
|
|
13667
|
+
"notNull": false,
|
|
13668
|
+
"unique": false,
|
|
13669
|
+
"default": ""
|
|
13670
|
+
},
|
|
13671
|
+
"last4": {
|
|
13672
|
+
"type": "TEXT",
|
|
13673
|
+
"notNull": false,
|
|
13674
|
+
"unique": false,
|
|
13675
|
+
"default": ""
|
|
13676
|
+
},
|
|
13677
|
+
"exp_month": {
|
|
13678
|
+
"type": "INTEGER",
|
|
13679
|
+
"notNull": false,
|
|
13680
|
+
"unique": false,
|
|
13681
|
+
"default": 0
|
|
13682
|
+
},
|
|
13683
|
+
"exp_year": {
|
|
13684
|
+
"type": "INTEGER",
|
|
13685
|
+
"notNull": false,
|
|
13686
|
+
"unique": false,
|
|
13687
|
+
"default": 0
|
|
13688
|
+
},
|
|
13689
|
+
"is_default": {
|
|
13690
|
+
"type": "BOOLEAN",
|
|
13691
|
+
"notNull": false,
|
|
13692
|
+
"unique": false,
|
|
13693
|
+
"default": false
|
|
13694
|
+
},
|
|
13695
|
+
"status": {
|
|
13696
|
+
"type": "TEXT",
|
|
13697
|
+
"notNull": false,
|
|
13698
|
+
"unique": false
|
|
13699
|
+
}
|
|
13700
|
+
},
|
|
13701
|
+
"indexes": [
|
|
13702
|
+
{
|
|
13703
|
+
"name": "payment_instruments_id_idx",
|
|
13704
|
+
"columns": [
|
|
13705
|
+
"id"
|
|
13706
|
+
]
|
|
13707
|
+
},
|
|
13708
|
+
{
|
|
13709
|
+
"name": "payment_instruments_slug_context_idx",
|
|
13710
|
+
"columns": [
|
|
13711
|
+
"slug",
|
|
13712
|
+
"context"
|
|
13713
|
+
],
|
|
13714
|
+
"unique": true
|
|
13715
|
+
}
|
|
13716
|
+
],
|
|
13717
|
+
"version": "0aace928"
|
|
13718
|
+
}
|
|
13719
|
+
},
|
|
13267
13720
|
"@happyvertical/smrt-commerce:PaymentIntent": {
|
|
13268
13721
|
"name": "paymentintent",
|
|
13269
13722
|
"className": "PaymentIntent",
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { SmrtObject } from '@happyvertical/smrt-core';
|
|
2
|
+
import { PaymentInstrumentOptions, PaymentInstrumentStatus } from '../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* PaymentInstrument stores a reusable payment method a customer has saved with
|
|
5
|
+
* a payment backend (e.g. a card vaulted by Stripe), so it can be charged later
|
|
6
|
+
* without the customer present.
|
|
7
|
+
*
|
|
8
|
+
* It holds only **references and non-sensitive display metadata** — the
|
|
9
|
+
* provider customer id (`cus_...`), the provider payment-method id (`pm_...`),
|
|
10
|
+
* and card display fields (brand / last4 / expiry). The actual card number is
|
|
11
|
+
* vaulted by the payment backend and is never stored here.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const instrument = await instruments.create({
|
|
16
|
+
* customerId: customer.id,
|
|
17
|
+
* backendId: 'stripe',
|
|
18
|
+
* providerCustomerId: 'cus_123',
|
|
19
|
+
* providerPaymentMethodId: 'pm_123',
|
|
20
|
+
* brand: 'visa',
|
|
21
|
+
* last4: '4242',
|
|
22
|
+
* expMonth: 12,
|
|
23
|
+
* expYear: 2030,
|
|
24
|
+
* isDefault: true,
|
|
25
|
+
* });
|
|
26
|
+
* await instrument.save();
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare class PaymentInstrument extends SmrtObject {
|
|
30
|
+
/**
|
|
31
|
+
* Tenant ID for multi-tenant isolation. Nullable to support both
|
|
32
|
+
* tenant-scoped and global instruments.
|
|
33
|
+
*/
|
|
34
|
+
tenantId: string | null;
|
|
35
|
+
/**
|
|
36
|
+
* Customer this saved method belongs to.
|
|
37
|
+
*/
|
|
38
|
+
customerId: string;
|
|
39
|
+
/**
|
|
40
|
+
* Stable identifier of the `PaymentBackend` adapter that vaulted the method —
|
|
41
|
+
* e.g. `stripe`. Mirrors {@link Payment.backendId}.
|
|
42
|
+
*/
|
|
43
|
+
backendId: string;
|
|
44
|
+
/**
|
|
45
|
+
* Provider customer reference (e.g. a Stripe `cus_...`). A reference, not
|
|
46
|
+
* card data.
|
|
47
|
+
*/
|
|
48
|
+
providerCustomerId: string;
|
|
49
|
+
/**
|
|
50
|
+
* Provider payment-method reference (e.g. a Stripe `pm_...`). Used, together
|
|
51
|
+
* with {@link providerCustomerId}, to charge the saved method off-session. A
|
|
52
|
+
* reference, not card data.
|
|
53
|
+
*/
|
|
54
|
+
providerPaymentMethodId: string;
|
|
55
|
+
/**
|
|
56
|
+
* Instrument type as reported by the backend — e.g. `card`,
|
|
57
|
+
* `us_bank_account`.
|
|
58
|
+
*/
|
|
59
|
+
type: string;
|
|
60
|
+
/**
|
|
61
|
+
* Card brand for display (e.g. `visa`). Display-only, not PCI-sensitive.
|
|
62
|
+
*/
|
|
63
|
+
brand: string;
|
|
64
|
+
/**
|
|
65
|
+
* Last four digits for display. Not the full card number.
|
|
66
|
+
*/
|
|
67
|
+
last4: string;
|
|
68
|
+
/**
|
|
69
|
+
* Card expiry month (1–12). `0` when unknown / not a card.
|
|
70
|
+
*/
|
|
71
|
+
expMonth: number;
|
|
72
|
+
/**
|
|
73
|
+
* Card expiry year (four digits). `0` when unknown / not a card.
|
|
74
|
+
*/
|
|
75
|
+
expYear: number;
|
|
76
|
+
/**
|
|
77
|
+
* Whether this is the customer's default instrument. Use
|
|
78
|
+
* {@link PaymentInstrumentCollection.setDefaultForCustomer} to flip the
|
|
79
|
+
* default so only one instrument per customer is marked default.
|
|
80
|
+
*/
|
|
81
|
+
isDefault: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Lifecycle status — `active` while chargeable, `expired` once the card has
|
|
84
|
+
* lapsed, `removed` when the customer detaches it.
|
|
85
|
+
*/
|
|
86
|
+
status: PaymentInstrumentStatus;
|
|
87
|
+
constructor(options?: PaymentInstrumentOptions);
|
|
88
|
+
/**
|
|
89
|
+
* True while the instrument is active (chargeable).
|
|
90
|
+
*/
|
|
91
|
+
isActive(): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* True once the instrument has been marked expired.
|
|
94
|
+
*/
|
|
95
|
+
isExpired(): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* True once the instrument has been removed/detached.
|
|
98
|
+
*/
|
|
99
|
+
isRemoved(): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Mark the instrument expired (e.g. the card lapsed). A removed instrument
|
|
102
|
+
* is not revived by this.
|
|
103
|
+
*/
|
|
104
|
+
markExpired(): void;
|
|
105
|
+
/**
|
|
106
|
+
* Mark the instrument removed/detached and clear its default flag.
|
|
107
|
+
*/
|
|
108
|
+
markRemoved(): void;
|
|
109
|
+
}
|
|
110
|
+
export default PaymentInstrument;
|
|
111
|
+
//# sourceMappingURL=PaymentInstrument.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaymentInstrument.d.ts","sourceRoot":"","sources":["../../src/models/PaymentInstrument.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAc,UAAU,EAAQ,MAAM,0BAA0B,CAAC;AAExE,OAAO,EACL,KAAK,wBAAwB,EAC7B,uBAAuB,EACxB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,qBA0Ba,iBAAkB,SAAQ,UAAU;IAC/C;;;OAGG;IAEH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/B;;OAEG;IAEH,UAAU,EAAE,MAAM,CAAM;IAExB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAM;IAEvB;;;OAGG;IACH,kBAAkB,EAAE,MAAM,CAAM;IAEhC;;;;OAIG;IACH,uBAAuB,EAAE,MAAM,CAAM;IAErC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAU;IAEtB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAM;IAEnB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAM;IAEnB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAK;IAErB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAK;IAEpB;;;;OAIG;IACH,SAAS,EAAE,OAAO,CAAS;IAE3B;;;OAGG;IACH,MAAM,EAAE,uBAAuB,CAAkC;gBAErD,OAAO,GAAE,wBAA6B;IAkBlD;;OAEG;IACH,QAAQ,IAAI,OAAO;IAInB;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;;OAGG;IACH,WAAW,IAAI,IAAI;IAKnB;;OAEG;IACH,WAAW,IAAI,IAAI;CAIpB;AAED,eAAe,iBAAiB,CAAC"}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export { Invoice } from './Invoice.js';
|
|
|
11
11
|
export { InvoiceLineItem } from './InvoiceLineItem.js';
|
|
12
12
|
export { Payment } from './Payment.js';
|
|
13
13
|
export { PaymentAllocation } from './PaymentAllocation.js';
|
|
14
|
+
export { PaymentInstrument } from './PaymentInstrument.js';
|
|
14
15
|
export { PaymentIntent } from './PaymentIntent.js';
|
|
15
16
|
export { Payout } from './Payout.js';
|
|
16
17
|
export { Vendor } from './Vendor.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,KAAK,qBAAqB,EAC1B,WAAW,EACX,KAAK,EACL,eAAe,EACf,aAAa,EACb,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,KAAK,qBAAqB,EAC1B,WAAW,EACX,KAAK,EACL,eAAe,EACf,aAAa,EACb,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
|