checkout-intents 0.1.0 → 0.3.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/CHANGELOG.md +49 -0
- package/LICENSE +4 -198
- package/README.md +155 -21
- package/client.d.mts +21 -7
- package/client.d.mts.map +1 -1
- package/client.d.ts +21 -7
- package/client.d.ts.map +1 -1
- package/client.js +37 -10
- package/client.js.map +1 -1
- package/client.mjs +37 -10
- package/client.mjs.map +1 -1
- package/internal/to-file.d.mts +1 -1
- package/internal/to-file.d.ts +1 -1
- package/internal/to-file.js +1 -1
- package/internal/to-file.mjs +1 -1
- package/internal/tslib.js +17 -17
- package/internal/utils/values.js +3 -3
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs +3 -3
- package/internal/utils/values.mjs.map +1 -1
- package/package.json +3 -3
- package/resources/brands.d.mts +31 -0
- package/resources/brands.d.mts.map +1 -0
- package/resources/brands.d.ts +31 -0
- package/resources/brands.d.ts.map +1 -0
- package/resources/{api/v1/brands.js → brands.js} +5 -5
- package/resources/brands.js.map +1 -0
- package/resources/brands.mjs +15 -0
- package/resources/brands.mjs.map +1 -0
- package/resources/checkout-intents.d.mts +320 -0
- package/resources/checkout-intents.d.mts.map +1 -0
- package/resources/checkout-intents.d.ts +320 -0
- package/resources/checkout-intents.d.ts.map +1 -0
- package/resources/checkout-intents.js +248 -0
- package/resources/checkout-intents.js.map +1 -0
- package/resources/checkout-intents.mjs +244 -0
- package/resources/checkout-intents.mjs.map +1 -0
- package/resources/index.d.mts +2 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -5
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -2
- package/resources/index.mjs.map +1 -1
- package/src/client.ts +84 -14
- package/src/internal/to-file.ts +1 -1
- package/src/internal/utils/values.ts +3 -3
- package/src/resources/{api/v1/brands.ts → brands.ts} +9 -9
- package/src/resources/checkout-intents.ts +531 -0
- package/src/resources/index.ts +14 -2
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/api/api.d.mts +0 -10
- package/resources/api/api.d.mts.map +0 -1
- package/resources/api/api.d.ts +0 -10
- package/resources/api/api.d.ts.map +0 -1
- package/resources/api/api.js +0 -17
- package/resources/api/api.js.map +0 -1
- package/resources/api/api.mjs +0 -12
- package/resources/api/api.mjs.map +0 -1
- package/resources/api/index.d.mts +0 -3
- package/resources/api/index.d.mts.map +0 -1
- package/resources/api/index.d.ts +0 -3
- package/resources/api/index.d.ts.map +0 -1
- package/resources/api/index.js +0 -9
- package/resources/api/index.js.map +0 -1
- package/resources/api/index.mjs +0 -4
- package/resources/api/index.mjs.map +0 -1
- package/resources/api/v1/brands.d.mts +0 -31
- package/resources/api/v1/brands.d.mts.map +0 -1
- package/resources/api/v1/brands.d.ts +0 -31
- package/resources/api/v1/brands.d.ts.map +0 -1
- package/resources/api/v1/brands.js.map +0 -1
- package/resources/api/v1/brands.mjs +0 -15
- package/resources/api/v1/brands.mjs.map +0 -1
- package/resources/api/v1/checkout-intents.d.mts +0 -117
- package/resources/api/v1/checkout-intents.d.mts.map +0 -1
- package/resources/api/v1/checkout-intents.d.ts +0 -117
- package/resources/api/v1/checkout-intents.d.ts.map +0 -1
- package/resources/api/v1/checkout-intents.js +0 -33
- package/resources/api/v1/checkout-intents.js.map +0 -1
- package/resources/api/v1/checkout-intents.mjs +0 -29
- package/resources/api/v1/checkout-intents.mjs.map +0 -1
- package/resources/api/v1/index.d.mts +0 -4
- package/resources/api/v1/index.d.mts.map +0 -1
- package/resources/api/v1/index.d.ts +0 -4
- package/resources/api/v1/index.d.ts.map +0 -1
- package/resources/api/v1/index.js +0 -11
- package/resources/api/v1/index.js.map +0 -1
- package/resources/api/v1/index.mjs +0 -5
- package/resources/api/v1/index.mjs.map +0 -1
- package/resources/api/v1/v1.d.mts +0 -14
- package/resources/api/v1/v1.d.mts.map +0 -1
- package/resources/api/v1/v1.d.ts +0 -14
- package/resources/api/v1/v1.d.ts.map +0 -1
- package/resources/api/v1/v1.js +0 -21
- package/resources/api/v1/v1.js.map +0 -1
- package/resources/api/v1/v1.mjs +0 -16
- package/resources/api/v1/v1.mjs.map +0 -1
- package/resources/api/v1.d.mts +0 -2
- package/resources/api/v1.d.mts.map +0 -1
- package/resources/api/v1.d.ts +0 -2
- package/resources/api/v1.d.ts.map +0 -1
- package/resources/api/v1.js +0 -6
- package/resources/api/v1.js.map +0 -1
- package/resources/api/v1.mjs +0 -3
- package/resources/api/v1.mjs.map +0 -1
- package/resources/api.d.mts +0 -2
- package/resources/api.d.mts.map +0 -1
- package/resources/api.d.ts +0 -2
- package/resources/api.d.ts.map +0 -1
- package/resources/api.js +0 -6
- package/resources/api.js.map +0 -1
- package/resources/api.mjs +0 -3
- package/resources/api.mjs.map +0 -1
- package/resources/health.d.mts +0 -17
- package/resources/health.d.mts.map +0 -1
- package/resources/health.d.ts +0 -17
- package/resources/health.d.ts.map +0 -1
- package/resources/health.js +0 -15
- package/resources/health.js.map +0 -1
- package/resources/health.mjs +0 -11
- package/resources/health.mjs.map +0 -1
- package/src/resources/api/api.ts +0 -15
- package/src/resources/api/index.ts +0 -4
- package/src/resources/api/v1/checkout-intents.ts +0 -207
- package/src/resources/api/v1/index.ts +0 -15
- package/src/resources/api/v1/v1.ts +0 -41
- package/src/resources/api/v1.ts +0 -3
- package/src/resources/api.ts +0 -3
- package/src/resources/health.ts +0 -24
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.0 (2025-11-06)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.2.0...v0.3.0](https://github.com/rye-com/checkout-intents-sdk/compare/v0.2.0...v0.3.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** add pollUntil helper functions ([f115fa0](https://github.com/rye-com/checkout-intents-sdk/commit/f115fa0d853763070b70c252e32339ccbd7b76e9))
|
|
10
|
+
* **api:** auto infer environment from api key ([3427e20](https://github.com/rye-com/checkout-intents-sdk/commit/3427e20153d52c5a1c4b1bbc6663efe7380c593a))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Documentation
|
|
14
|
+
|
|
15
|
+
* **api:** add polling functions ([4335fd3](https://github.com/rye-com/checkout-intents-sdk/commit/4335fd3d71c146a593aaf05c24921e5aedb26ba7))
|
|
16
|
+
|
|
17
|
+
## 0.2.0 (2025-10-28)
|
|
18
|
+
|
|
19
|
+
Full Changelog: [v0.1.0...v0.2.0](https://github.com/rye-com/checkout-intents-sdk/compare/v0.1.0...v0.2.0)
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* **api:** manual updates ([331e1d4](https://github.com/rye-com/checkout-intents-sdk/commit/331e1d4f5cad412b14ab65f34c7f2166137bcab1))
|
|
24
|
+
* **api:** manual updates ([f82341d](https://github.com/rye-com/checkout-intents-sdk/commit/f82341d4f7b134e1b8e63f98af7e88e6eee9ca0b))
|
|
25
|
+
* **api:** manual updates ([51267f5](https://github.com/rye-com/checkout-intents-sdk/commit/51267f5c6fa4e7e05a2ce0102a66df96e7f37129))
|
|
26
|
+
* **api:** manual updates ([098c026](https://github.com/rye-com/checkout-intents-sdk/commit/098c026df38d82b479ebdf0b3cdba0f704973fef))
|
|
27
|
+
* **api:** manual updates ([604f474](https://github.com/rye-com/checkout-intents-sdk/commit/604f474d6c2c78cf6b469e19ab0711e00b566017))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
* coerce nullable values to undefined ([7c8b73f](https://github.com/rye-com/checkout-intents-sdk/commit/7c8b73fdd2f14ec3a1f33e46e4cea315d35fa67e))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Performance Improvements
|
|
36
|
+
|
|
37
|
+
* faster formatting ([801020b](https://github.com/rye-com/checkout-intents-sdk/commit/801020b43aa79c2e4c75affa174fd0cb6553f220))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### Chores
|
|
41
|
+
|
|
42
|
+
* ci build action ([b25e9a2](https://github.com/rye-com/checkout-intents-sdk/commit/b25e9a27a1475b541960731f04830044e7caf230))
|
|
43
|
+
* do not install brew dependencies in ./scripts/bootstrap by default ([1894473](https://github.com/rye-com/checkout-intents-sdk/commit/1894473dda990e25992fdcfc3660f001f602f11b))
|
|
44
|
+
* **internal:** codegen related update ([532b280](https://github.com/rye-com/checkout-intents-sdk/commit/532b28008e458d657cb05dc7f7c3497c9082b60d))
|
|
45
|
+
* **internal:** fix incremental formatting in some cases ([d68a4ef](https://github.com/rye-com/checkout-intents-sdk/commit/d68a4ef214f16c7764d617e0ce6785dccb1e9f26))
|
|
46
|
+
* **internal:** ignore .eslintcache ([2712360](https://github.com/rye-com/checkout-intents-sdk/commit/27123608348099f05997629c6f115766ee0c0288))
|
|
47
|
+
* **internal:** remove .eslintcache ([7b2fe5e](https://github.com/rye-com/checkout-intents-sdk/commit/7b2fe5e3c43b8c02abfd122182c61b00b9c96d9a))
|
|
48
|
+
* **internal:** remove deprecated `compilerOptions.baseUrl` from tsconfig.json ([56a2d07](https://github.com/rye-com/checkout-intents-sdk/commit/56a2d079855c28411cd87c738c9a4a4682ba8ca3))
|
|
49
|
+
* **internal:** use npm pack for build uploads ([3aafc7c](https://github.com/rye-com/checkout-intents-sdk/commit/3aafc7c407bc371c49a25ab13a29b43d164893db))
|
|
50
|
+
* **jsdoc:** fix [@link](https://github.com/link) annotations to refer only to parts of the package‘s public interface ([9e9f246](https://github.com/rye-com/checkout-intents-sdk/commit/9e9f2469a0a2d54aba24bde8eb98baf62daba976))
|
|
51
|
+
|
|
3
52
|
## 0.1.0 (2025-09-02)
|
|
4
53
|
|
|
5
54
|
Full Changelog: [v0.0.2...v0.1.0](https://github.com/rye-com/checkout-intents-sdk/compare/v0.0.2...v0.1.0)
|
package/LICENSE
CHANGED
|
@@ -1,201 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
1
|
+
Copyright 2025 Checkout Intents
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright 2025 Checkout Intents
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
This library provides convenient access to the Checkout Intents REST API from server-side TypeScript or JavaScript.
|
|
6
6
|
|
|
7
|
-
The full API of this library can be found in [api.md](api.md).
|
|
7
|
+
The REST API documentation can be found on [docs.rye.com](https://docs.rye.com). The full API of this library can be found in [api.md](api.md).
|
|
8
8
|
|
|
9
9
|
It is generated with [Stainless](https://www.stainless.com/).
|
|
10
10
|
|
|
@@ -22,13 +22,82 @@ The full API of this library can be found in [api.md](api.md).
|
|
|
22
22
|
```js
|
|
23
23
|
import CheckoutIntents from 'checkout-intents';
|
|
24
24
|
|
|
25
|
-
const client = new CheckoutIntents(
|
|
25
|
+
const client = new CheckoutIntents({
|
|
26
|
+
apiKey: process.env['CHECKOUT_INTENTS_API_KEY'], // This is the default and can be omitted
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const checkoutIntent = await client.checkoutIntents.create({
|
|
30
|
+
buyer: {
|
|
31
|
+
address1: '123 Main St',
|
|
32
|
+
city: 'New York',
|
|
33
|
+
country: 'United States',
|
|
34
|
+
email: 'john.doe@example.com',
|
|
35
|
+
firstName: 'John',
|
|
36
|
+
lastName: 'Doe',
|
|
37
|
+
phone: '+1234567890',
|
|
38
|
+
postalCode: '10001',
|
|
39
|
+
province: 'NY',
|
|
40
|
+
},
|
|
41
|
+
productUrl: 'https://rye-protocol.myshopify.com/products/rye-sticker',
|
|
42
|
+
quantity: 1,
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Polling Helpers
|
|
47
|
+
|
|
48
|
+
This SDK includes helper methods for the asynchronous checkout flow. The recommended pattern follows Rye's two-phase checkout:
|
|
49
|
+
|
|
50
|
+
<!-- prettier-ignore -->
|
|
51
|
+
```js
|
|
52
|
+
// Phase 1: Create and wait for offer
|
|
53
|
+
const intent = await client.checkoutIntents.createAndPoll({
|
|
54
|
+
buyer: {
|
|
55
|
+
address1: '123 Main St',
|
|
56
|
+
city: 'New York',
|
|
57
|
+
country: 'United States',
|
|
58
|
+
email: 'john.doe@example.com',
|
|
59
|
+
firstName: 'John',
|
|
60
|
+
lastName: 'Doe',
|
|
61
|
+
phone: '+1234567890',
|
|
62
|
+
postalCode: '10001',
|
|
63
|
+
province: 'NY',
|
|
64
|
+
},
|
|
65
|
+
productUrl: 'https://example.com/product',
|
|
66
|
+
quantity: 1,
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// Handle failure during offer retrieval
|
|
70
|
+
if (intent.state === 'failed') {
|
|
71
|
+
console.log('Failed:', intent.failureReason);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
26
74
|
|
|
27
|
-
|
|
75
|
+
// Review pricing with user
|
|
76
|
+
console.log('Total:', intent.offer.cost.total);
|
|
28
77
|
|
|
29
|
-
|
|
78
|
+
// Phase 2: Confirm and wait for completion
|
|
79
|
+
const completed = await client.checkoutIntents.confirmAndPoll(intent.id, {
|
|
80
|
+
paymentMethod: {
|
|
81
|
+
type: 'stripe_token',
|
|
82
|
+
stripeToken: 'tok_visa',
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
console.log('Status:', completed.state);
|
|
30
87
|
```
|
|
31
88
|
|
|
89
|
+
For more examples, see the [`examples/`](./examples) directory:
|
|
90
|
+
|
|
91
|
+
- [`complete-checkout-intent.ts`](./examples/complete-checkout-intent.ts) - Recommended two-phase flow
|
|
92
|
+
- [`error-handling.ts`](./examples/error-handling.ts) - Timeout and error handling
|
|
93
|
+
|
|
94
|
+
Available polling methods:
|
|
95
|
+
|
|
96
|
+
- `createAndPoll()` - Create and poll until offer is ready (awaiting_confirmation or failed)
|
|
97
|
+
- `confirmAndPoll()` - Confirm and poll until completion (completed or failed)
|
|
98
|
+
- `pollUntilCompleted()` - Poll until completed or failed
|
|
99
|
+
- `pollUntilAwaitingConfirmation()` - Poll until offer is ready or failed
|
|
100
|
+
|
|
32
101
|
### Request & Response types
|
|
33
102
|
|
|
34
103
|
This library includes TypeScript definitions for all request params and response fields. You may import and use them like so:
|
|
@@ -37,9 +106,26 @@ This library includes TypeScript definitions for all request params and response
|
|
|
37
106
|
```ts
|
|
38
107
|
import CheckoutIntents from 'checkout-intents';
|
|
39
108
|
|
|
40
|
-
const client = new CheckoutIntents(
|
|
109
|
+
const client = new CheckoutIntents({
|
|
110
|
+
apiKey: process.env['CHECKOUT_INTENTS_API_KEY'], // This is the default and can be omitted
|
|
111
|
+
});
|
|
41
112
|
|
|
42
|
-
const
|
|
113
|
+
const params: CheckoutIntents.CheckoutIntentCreateParams = {
|
|
114
|
+
buyer: {
|
|
115
|
+
address1: '123 Main St',
|
|
116
|
+
city: 'New York',
|
|
117
|
+
country: 'United States',
|
|
118
|
+
email: 'john.doe@example.com',
|
|
119
|
+
firstName: 'John',
|
|
120
|
+
lastName: 'Doe',
|
|
121
|
+
phone: '+1234567890',
|
|
122
|
+
postalCode: '10001',
|
|
123
|
+
province: 'NY',
|
|
124
|
+
},
|
|
125
|
+
productUrl: 'https://rye-protocol.myshopify.com/products/rye-sticker',
|
|
126
|
+
quantity: 1,
|
|
127
|
+
};
|
|
128
|
+
const checkoutIntent: CheckoutIntents.CheckoutIntent = await client.checkoutIntents.create(params);
|
|
43
129
|
```
|
|
44
130
|
|
|
45
131
|
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
|
|
@@ -52,15 +138,31 @@ a subclass of `APIError` will be thrown:
|
|
|
52
138
|
|
|
53
139
|
<!-- prettier-ignore -->
|
|
54
140
|
```ts
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
141
|
+
const checkoutIntent = await client.checkoutIntents
|
|
142
|
+
.create({
|
|
143
|
+
buyer: {
|
|
144
|
+
address1: '123 Main St',
|
|
145
|
+
city: 'New York',
|
|
146
|
+
country: 'United States',
|
|
147
|
+
email: 'john.doe@example.com',
|
|
148
|
+
firstName: 'John',
|
|
149
|
+
lastName: 'Doe',
|
|
150
|
+
phone: '+1234567890',
|
|
151
|
+
postalCode: '10001',
|
|
152
|
+
province: 'NY',
|
|
153
|
+
},
|
|
154
|
+
productUrl: 'https://rye-protocol.myshopify.com/products/rye-sticker',
|
|
155
|
+
quantity: 1,
|
|
156
|
+
})
|
|
157
|
+
.catch(async (err) => {
|
|
158
|
+
if (err instanceof CheckoutIntents.APIError) {
|
|
159
|
+
console.log(err.status); // 400
|
|
160
|
+
console.log(err.name); // BadRequestError
|
|
161
|
+
console.log(err.headers); // {server: 'nginx', ...}
|
|
162
|
+
} else {
|
|
163
|
+
throw err;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
64
166
|
```
|
|
65
167
|
|
|
66
168
|
Error codes are as follows:
|
|
@@ -92,7 +194,7 @@ const client = new CheckoutIntents({
|
|
|
92
194
|
});
|
|
93
195
|
|
|
94
196
|
// Or, configure per-request:
|
|
95
|
-
await client.
|
|
197
|
+
await client.checkoutIntents.create({ buyer: { address1: '123 Main St', city: 'New York', country: 'United States', email: 'john.doe@example.com', firstName: 'John', lastName: 'Doe', phone: '+1234567890', postalCode: '10001', province: 'NY' }, productUrl: 'https://rye-protocol.myshopify.com/products/rye-sticker', quantity: 1 }, {
|
|
96
198
|
maxRetries: 5,
|
|
97
199
|
});
|
|
98
200
|
```
|
|
@@ -109,7 +211,7 @@ const client = new CheckoutIntents({
|
|
|
109
211
|
});
|
|
110
212
|
|
|
111
213
|
// Override per-request:
|
|
112
|
-
await client.
|
|
214
|
+
await client.checkoutIntents.create({ buyer: { address1: '123 Main St', city: 'New York', country: 'United States', email: 'john.doe@example.com', firstName: 'John', lastName: 'Doe', phone: '+1234567890', postalCode: '10001', province: 'NY' }, productUrl: 'https://rye-protocol.myshopify.com/products/rye-sticker', quantity: 1 }, {
|
|
113
215
|
timeout: 5 * 1000,
|
|
114
216
|
});
|
|
115
217
|
```
|
|
@@ -132,13 +234,45 @@ Unlike `.asResponse()` this method consumes the body, returning once it is parse
|
|
|
132
234
|
```ts
|
|
133
235
|
const client = new CheckoutIntents();
|
|
134
236
|
|
|
135
|
-
const response = await client.
|
|
237
|
+
const response = await client.checkoutIntents
|
|
238
|
+
.create({
|
|
239
|
+
buyer: {
|
|
240
|
+
address1: '123 Main St',
|
|
241
|
+
city: 'New York',
|
|
242
|
+
country: 'United States',
|
|
243
|
+
email: 'john.doe@example.com',
|
|
244
|
+
firstName: 'John',
|
|
245
|
+
lastName: 'Doe',
|
|
246
|
+
phone: '+1234567890',
|
|
247
|
+
postalCode: '10001',
|
|
248
|
+
province: 'NY',
|
|
249
|
+
},
|
|
250
|
+
productUrl: 'https://rye-protocol.myshopify.com/products/rye-sticker',
|
|
251
|
+
quantity: 1,
|
|
252
|
+
})
|
|
253
|
+
.asResponse();
|
|
136
254
|
console.log(response.headers.get('X-My-Header'));
|
|
137
255
|
console.log(response.statusText); // access the underlying Response object
|
|
138
256
|
|
|
139
|
-
const { data:
|
|
257
|
+
const { data: checkoutIntent, response: raw } = await client.checkoutIntents
|
|
258
|
+
.create({
|
|
259
|
+
buyer: {
|
|
260
|
+
address1: '123 Main St',
|
|
261
|
+
city: 'New York',
|
|
262
|
+
country: 'United States',
|
|
263
|
+
email: 'john.doe@example.com',
|
|
264
|
+
firstName: 'John',
|
|
265
|
+
lastName: 'Doe',
|
|
266
|
+
phone: '+1234567890',
|
|
267
|
+
postalCode: '10001',
|
|
268
|
+
province: 'NY',
|
|
269
|
+
},
|
|
270
|
+
productUrl: 'https://rye-protocol.myshopify.com/products/rye-sticker',
|
|
271
|
+
quantity: 1,
|
|
272
|
+
})
|
|
273
|
+
.withResponse();
|
|
140
274
|
console.log(raw.headers.get('X-My-Header'));
|
|
141
|
-
console.log(
|
|
275
|
+
console.log(checkoutIntent);
|
|
142
276
|
```
|
|
143
277
|
|
|
144
278
|
### Logging
|
|
@@ -218,7 +352,7 @@ parameter. This library doesn't validate at runtime that the request matches the
|
|
|
218
352
|
send will be sent as-is.
|
|
219
353
|
|
|
220
354
|
```ts
|
|
221
|
-
client.
|
|
355
|
+
client.checkoutIntents.create({
|
|
222
356
|
// ...
|
|
223
357
|
// @ts-expect-error baz is not yet public
|
|
224
358
|
baz: 'undocumented option',
|
package/client.d.mts
CHANGED
|
@@ -6,17 +6,30 @@ import * as Errors from "./core/error.mjs";
|
|
|
6
6
|
import * as Uploads from "./core/uploads.mjs";
|
|
7
7
|
import * as API from "./resources/index.mjs";
|
|
8
8
|
import { APIPromise } from "./core/api-promise.mjs";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { BrandRetrieveResponse, Brands } from "./resources/brands.mjs";
|
|
10
|
+
import { BaseCheckoutIntent, Buyer, CheckoutIntent, CheckoutIntentAddPaymentParams, CheckoutIntentConfirmParams, CheckoutIntentCreateParams, CheckoutIntentsResource, Money, Offer, PaymentMethod, VariantSelection } from "./resources/checkout-intents.mjs";
|
|
11
11
|
import { type Fetch } from "./internal/builtin-types.mjs";
|
|
12
12
|
import { HeadersLike, NullableHeaders } from "./internal/headers.mjs";
|
|
13
13
|
import { FinalRequestOptions, RequestOptions } from "./internal/request-options.mjs";
|
|
14
14
|
import { type LogLevel, type Logger } from "./internal/utils/log.mjs";
|
|
15
|
+
declare const environments: {
|
|
16
|
+
staging: string;
|
|
17
|
+
production: string;
|
|
18
|
+
};
|
|
19
|
+
type Environment = keyof typeof environments;
|
|
15
20
|
export interface ClientOptions {
|
|
16
21
|
/**
|
|
17
|
-
* Rye API key. Format: `
|
|
22
|
+
* Rye API key. Format: `RYE/{environment}-abcdef`
|
|
18
23
|
*/
|
|
19
24
|
apiKey?: string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Specifies the environment to use for the API.
|
|
27
|
+
*
|
|
28
|
+
* Each environment maps to a different base URL:
|
|
29
|
+
* - `staging` corresponds to `https://staging.api.rye.com/`
|
|
30
|
+
* - `production` corresponds to `https://api.rye.com/`
|
|
31
|
+
*/
|
|
32
|
+
environment?: Environment | undefined;
|
|
20
33
|
/**
|
|
21
34
|
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
22
35
|
*
|
|
@@ -97,6 +110,7 @@ export declare class CheckoutIntents {
|
|
|
97
110
|
* API Client for interfacing with the Checkout Intents API.
|
|
98
111
|
*
|
|
99
112
|
* @param {string | undefined} [opts.apiKey=process.env['CHECKOUT_INTENTS_API_KEY'] ?? undefined]
|
|
113
|
+
* @param {Environment} [opts.environment=staging] - Specifies the environment URL to use for the API.
|
|
100
114
|
* @param {string} [opts.baseURL=process.env['CHECKOUT_INTENTS_BASE_URL'] ?? https://staging.api.rye.com/] - Override the default base URL for the API.
|
|
101
115
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
102
116
|
* @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
|
|
@@ -172,12 +186,12 @@ export declare class CheckoutIntents {
|
|
|
172
186
|
static PermissionDeniedError: typeof Errors.PermissionDeniedError;
|
|
173
187
|
static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
|
|
174
188
|
static toFile: typeof Uploads.toFile;
|
|
175
|
-
|
|
176
|
-
|
|
189
|
+
checkoutIntents: API.CheckoutIntentsResource;
|
|
190
|
+
brands: API.Brands;
|
|
177
191
|
}
|
|
178
192
|
export declare namespace CheckoutIntents {
|
|
179
193
|
export type RequestOptions = Opts.RequestOptions;
|
|
180
|
-
export {
|
|
181
|
-
export {
|
|
194
|
+
export { CheckoutIntentsResource as CheckoutIntentsResource, type BaseCheckoutIntent as BaseCheckoutIntent, type Buyer as Buyer, type CheckoutIntent as CheckoutIntent, type Money as Money, type Offer as Offer, type PaymentMethod as PaymentMethod, type VariantSelection as VariantSelection, type CheckoutIntentCreateParams as CheckoutIntentCreateParams, type CheckoutIntentAddPaymentParams as CheckoutIntentAddPaymentParams, type CheckoutIntentConfirmParams as CheckoutIntentConfirmParams, };
|
|
195
|
+
export { Brands as Brands, type BrandRetrieveResponse as BrandRetrieveResponse };
|
|
182
196
|
}
|
|
183
197
|
//# sourceMappingURL=client.d.mts.map
|
package/client.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.mts","sourceRoot":"","sources":["src/client.ts"],"names":[],"mappings":"OAEO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAY;OAC3C,KAAK,EAAc,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE;YAIvE,EAAE,MAAM,EAAE,QAAQ,EAAE;OAKzB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,CAAC,mBAAmB,oCAA8B;IACxD,MAAM,CAAC,mBAAmB,oCAA8B;IACxD,MAAM,CAAC,qBAAqB,sCAAgC;IAC5D,MAAM,CAAC,wBAAwB,yCAAmC;IAElE,MAAM,CAAC,MAAM,wBAAkB;IAE/B,eAAe,EAAE,GAAG,CAAC,uBAAuB,CAAyC;IACrF,MAAM,EAAE,GAAG,CAAC,MAAM,CAAwB;CAC3C;AAKD,MAAM,CAAC,OAAO,WAAW,eAAe,CAAC;IACvC,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;IAEjD,OAAO,EACL,uBAAuB,IAAI,uBAAuB,EAClD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,KAAK,IAAI,KAAK,EACnB,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,KAAK,IAAI,KAAK,EACnB,KAAK,KAAK,IAAI,KAAK,EACnB,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,2BAA2B,IAAI,2BAA2B,GAChE,CAAC;IAEF,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,KAAK,qBAAqB,IAAI,qBAAqB,EAAE,CAAC;CAClF"}
|
package/client.d.ts
CHANGED
|
@@ -6,17 +6,30 @@ import * as Errors from "./core/error.js";
|
|
|
6
6
|
import * as Uploads from "./core/uploads.js";
|
|
7
7
|
import * as API from "./resources/index.js";
|
|
8
8
|
import { APIPromise } from "./core/api-promise.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { BrandRetrieveResponse, Brands } from "./resources/brands.js";
|
|
10
|
+
import { BaseCheckoutIntent, Buyer, CheckoutIntent, CheckoutIntentAddPaymentParams, CheckoutIntentConfirmParams, CheckoutIntentCreateParams, CheckoutIntentsResource, Money, Offer, PaymentMethod, VariantSelection } from "./resources/checkout-intents.js";
|
|
11
11
|
import { type Fetch } from "./internal/builtin-types.js";
|
|
12
12
|
import { HeadersLike, NullableHeaders } from "./internal/headers.js";
|
|
13
13
|
import { FinalRequestOptions, RequestOptions } from "./internal/request-options.js";
|
|
14
14
|
import { type LogLevel, type Logger } from "./internal/utils/log.js";
|
|
15
|
+
declare const environments: {
|
|
16
|
+
staging: string;
|
|
17
|
+
production: string;
|
|
18
|
+
};
|
|
19
|
+
type Environment = keyof typeof environments;
|
|
15
20
|
export interface ClientOptions {
|
|
16
21
|
/**
|
|
17
|
-
* Rye API key. Format: `
|
|
22
|
+
* Rye API key. Format: `RYE/{environment}-abcdef`
|
|
18
23
|
*/
|
|
19
24
|
apiKey?: string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Specifies the environment to use for the API.
|
|
27
|
+
*
|
|
28
|
+
* Each environment maps to a different base URL:
|
|
29
|
+
* - `staging` corresponds to `https://staging.api.rye.com/`
|
|
30
|
+
* - `production` corresponds to `https://api.rye.com/`
|
|
31
|
+
*/
|
|
32
|
+
environment?: Environment | undefined;
|
|
20
33
|
/**
|
|
21
34
|
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
22
35
|
*
|
|
@@ -97,6 +110,7 @@ export declare class CheckoutIntents {
|
|
|
97
110
|
* API Client for interfacing with the Checkout Intents API.
|
|
98
111
|
*
|
|
99
112
|
* @param {string | undefined} [opts.apiKey=process.env['CHECKOUT_INTENTS_API_KEY'] ?? undefined]
|
|
113
|
+
* @param {Environment} [opts.environment=staging] - Specifies the environment URL to use for the API.
|
|
100
114
|
* @param {string} [opts.baseURL=process.env['CHECKOUT_INTENTS_BASE_URL'] ?? https://staging.api.rye.com/] - Override the default base URL for the API.
|
|
101
115
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
102
116
|
* @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
|
|
@@ -172,12 +186,12 @@ export declare class CheckoutIntents {
|
|
|
172
186
|
static PermissionDeniedError: typeof Errors.PermissionDeniedError;
|
|
173
187
|
static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
|
|
174
188
|
static toFile: typeof Uploads.toFile;
|
|
175
|
-
|
|
176
|
-
|
|
189
|
+
checkoutIntents: API.CheckoutIntentsResource;
|
|
190
|
+
brands: API.Brands;
|
|
177
191
|
}
|
|
178
192
|
export declare namespace CheckoutIntents {
|
|
179
193
|
export type RequestOptions = Opts.RequestOptions;
|
|
180
|
-
export {
|
|
181
|
-
export {
|
|
194
|
+
export { CheckoutIntentsResource as CheckoutIntentsResource, type BaseCheckoutIntent as BaseCheckoutIntent, type Buyer as Buyer, type CheckoutIntent as CheckoutIntent, type Money as Money, type Offer as Offer, type PaymentMethod as PaymentMethod, type VariantSelection as VariantSelection, type CheckoutIntentCreateParams as CheckoutIntentCreateParams, type CheckoutIntentAddPaymentParams as CheckoutIntentAddPaymentParams, type CheckoutIntentConfirmParams as CheckoutIntentConfirmParams, };
|
|
195
|
+
export { Brands as Brands, type BrandRetrieveResponse as BrandRetrieveResponse };
|
|
182
196
|
}
|
|
183
197
|
//# sourceMappingURL=client.d.ts.map
|