@naturalpay/sdk 1.6.37 → 1.6.38
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/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/cardSessions/client/Client.d.ts +29 -2
- package/dist/cjs/api/resources/cardSessions/client/Client.js +134 -6
- package/dist/cjs/api/resources/cardSessions/client/requests/ClaimCardSessionsRequest.d.ts +2 -0
- package/dist/cjs/api/resources/cardSessions/client/requests/CreateCardSessionsRequest.d.ts +6 -1
- package/dist/cjs/api/resources/cardSessions/client/requests/ListCardSessionsRequest.d.ts +17 -0
- package/dist/cjs/api/resources/cardSessions/client/requests/ListCardSessionsRequest.js +3 -0
- package/dist/cjs/api/resources/cardSessions/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/cardSessions/types/CreateCardSessionsResponse.d.ts +3 -1
- package/dist/cjs/api/resources/cardSessions/types/GetCardSessionsResponse.d.ts +3 -1
- package/dist/cjs/api/resources/cardSessions/types/ListCardSessionsRequestStatus.d.ts +9 -0
- package/dist/cjs/api/resources/cardSessions/types/ListCardSessionsRequestStatus.js +12 -0
- package/dist/cjs/api/resources/cardSessions/types/ListCardSessionsResponse.d.ts +5 -0
- package/dist/cjs/api/resources/cardSessions/types/ListCardSessionsResponse.js +3 -0
- package/dist/cjs/api/resources/cardSessions/types/ListCardSessionsResponseDataItem.d.ts +20 -0
- package/dist/cjs/api/resources/cardSessions/types/ListCardSessionsResponseDataItem.js +3 -0
- package/dist/cjs/api/resources/cardSessions/types/ListCardSessionsResponseDataItemCardSource.d.ts +6 -0
- package/dist/cjs/api/resources/cardSessions/types/ListCardSessionsResponseDataItemCardSource.js +9 -0
- package/dist/cjs/api/resources/cardSessions/types/ListCardSessionsResponseDataItemNote.d.ts +6 -0
- package/dist/cjs/api/resources/cardSessions/types/ListCardSessionsResponseDataItemNote.js +3 -0
- package/dist/cjs/api/resources/cardSessions/types/ListCardSessionsResponseDataItemStatus.d.ts +9 -0
- package/dist/cjs/api/resources/cardSessions/types/ListCardSessionsResponseDataItemStatus.js +12 -0
- package/dist/cjs/api/resources/cardSessions/types/ListCardSessionsResponseMeta.d.ts +4 -0
- package/dist/cjs/api/resources/cardSessions/types/ListCardSessionsResponseMeta.js +3 -0
- package/dist/cjs/api/resources/cardSessions/types/ListCardSessionsResponseMetaPagination.d.ts +6 -0
- package/dist/cjs/api/resources/cardSessions/types/ListCardSessionsResponseMetaPagination.js +3 -0
- package/dist/cjs/api/resources/cardSessions/types/index.d.ts +8 -0
- package/dist/cjs/api/resources/cardSessions/types/index.js +8 -0
- package/dist/cjs/serialization/resources/cardSessions/client/requests/CreateCardSessionsRequest.d.ts +2 -1
- package/dist/cjs/serialization/resources/cardSessions/client/requests/CreateCardSessionsRequest.js +1 -0
- package/dist/cjs/serialization/resources/cardSessions/types/CreateCardSessionsResponse.d.ts +1 -0
- package/dist/cjs/serialization/resources/cardSessions/types/CreateCardSessionsResponse.js +1 -0
- package/dist/cjs/serialization/resources/cardSessions/types/GetCardSessionsResponse.d.ts +1 -0
- package/dist/cjs/serialization/resources/cardSessions/types/GetCardSessionsResponse.js +1 -0
- package/dist/cjs/serialization/resources/cardSessions/types/ListCardSessionsRequestStatus.d.ts +7 -0
- package/dist/cjs/serialization/resources/cardSessions/types/ListCardSessionsRequestStatus.js +39 -0
- package/dist/cjs/serialization/resources/cardSessions/types/ListCardSessionsResponse.d.ts +12 -0
- package/dist/cjs/serialization/resources/cardSessions/types/ListCardSessionsResponse.js +44 -0
- package/dist/cjs/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItem.d.ts +22 -0
- package/dist/cjs/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItem.js +54 -0
- package/dist/cjs/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItemCardSource.d.ts +7 -0
- package/dist/cjs/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItemCardSource.js +39 -0
- package/dist/cjs/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItemNote.d.ts +10 -0
- package/dist/cjs/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItemNote.js +42 -0
- package/dist/cjs/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItemStatus.d.ts +7 -0
- package/dist/cjs/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItemStatus.js +39 -0
- package/dist/cjs/serialization/resources/cardSessions/types/ListCardSessionsResponseMeta.d.ts +10 -0
- package/dist/cjs/serialization/resources/cardSessions/types/ListCardSessionsResponseMeta.js +42 -0
- package/dist/cjs/serialization/resources/cardSessions/types/ListCardSessionsResponseMetaPagination.d.ts +10 -0
- package/dist/cjs/serialization/resources/cardSessions/types/ListCardSessionsResponseMetaPagination.js +42 -0
- package/dist/cjs/serialization/resources/cardSessions/types/index.d.ts +8 -0
- package/dist/cjs/serialization/resources/cardSessions/types/index.js +8 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/cardSessions/client/Client.d.mts +29 -2
- package/dist/esm/api/resources/cardSessions/client/Client.mjs +134 -6
- package/dist/esm/api/resources/cardSessions/client/requests/ClaimCardSessionsRequest.d.mts +2 -0
- package/dist/esm/api/resources/cardSessions/client/requests/CreateCardSessionsRequest.d.mts +6 -1
- package/dist/esm/api/resources/cardSessions/client/requests/ListCardSessionsRequest.d.mts +17 -0
- package/dist/esm/api/resources/cardSessions/client/requests/ListCardSessionsRequest.mjs +2 -0
- package/dist/esm/api/resources/cardSessions/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/cardSessions/types/CreateCardSessionsResponse.d.mts +3 -1
- package/dist/esm/api/resources/cardSessions/types/GetCardSessionsResponse.d.mts +3 -1
- package/dist/esm/api/resources/cardSessions/types/ListCardSessionsRequestStatus.d.mts +9 -0
- package/dist/esm/api/resources/cardSessions/types/ListCardSessionsRequestStatus.mjs +9 -0
- package/dist/esm/api/resources/cardSessions/types/ListCardSessionsResponse.d.mts +5 -0
- package/dist/esm/api/resources/cardSessions/types/ListCardSessionsResponse.mjs +2 -0
- package/dist/esm/api/resources/cardSessions/types/ListCardSessionsResponseDataItem.d.mts +20 -0
- package/dist/esm/api/resources/cardSessions/types/ListCardSessionsResponseDataItem.mjs +2 -0
- package/dist/esm/api/resources/cardSessions/types/ListCardSessionsResponseDataItemCardSource.d.mts +6 -0
- package/dist/esm/api/resources/cardSessions/types/ListCardSessionsResponseDataItemCardSource.mjs +6 -0
- package/dist/esm/api/resources/cardSessions/types/ListCardSessionsResponseDataItemNote.d.mts +6 -0
- package/dist/esm/api/resources/cardSessions/types/ListCardSessionsResponseDataItemNote.mjs +2 -0
- package/dist/esm/api/resources/cardSessions/types/ListCardSessionsResponseDataItemStatus.d.mts +9 -0
- package/dist/esm/api/resources/cardSessions/types/ListCardSessionsResponseDataItemStatus.mjs +9 -0
- package/dist/esm/api/resources/cardSessions/types/ListCardSessionsResponseMeta.d.mts +4 -0
- package/dist/esm/api/resources/cardSessions/types/ListCardSessionsResponseMeta.mjs +2 -0
- package/dist/esm/api/resources/cardSessions/types/ListCardSessionsResponseMetaPagination.d.mts +6 -0
- package/dist/esm/api/resources/cardSessions/types/ListCardSessionsResponseMetaPagination.mjs +2 -0
- package/dist/esm/api/resources/cardSessions/types/index.d.mts +8 -0
- package/dist/esm/api/resources/cardSessions/types/index.mjs +8 -0
- package/dist/esm/serialization/resources/cardSessions/client/requests/CreateCardSessionsRequest.d.mts +2 -1
- package/dist/esm/serialization/resources/cardSessions/client/requests/CreateCardSessionsRequest.mjs +1 -0
- package/dist/esm/serialization/resources/cardSessions/types/CreateCardSessionsResponse.d.mts +1 -0
- package/dist/esm/serialization/resources/cardSessions/types/CreateCardSessionsResponse.mjs +1 -0
- package/dist/esm/serialization/resources/cardSessions/types/GetCardSessionsResponse.d.mts +1 -0
- package/dist/esm/serialization/resources/cardSessions/types/GetCardSessionsResponse.mjs +1 -0
- package/dist/esm/serialization/resources/cardSessions/types/ListCardSessionsRequestStatus.d.mts +7 -0
- package/dist/esm/serialization/resources/cardSessions/types/ListCardSessionsRequestStatus.mjs +3 -0
- package/dist/esm/serialization/resources/cardSessions/types/ListCardSessionsResponse.d.mts +12 -0
- package/dist/esm/serialization/resources/cardSessions/types/ListCardSessionsResponse.mjs +8 -0
- package/dist/esm/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItem.d.mts +22 -0
- package/dist/esm/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItem.mjs +18 -0
- package/dist/esm/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItemCardSource.d.mts +7 -0
- package/dist/esm/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItemCardSource.mjs +3 -0
- package/dist/esm/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItemNote.d.mts +10 -0
- package/dist/esm/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItemNote.mjs +6 -0
- package/dist/esm/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItemStatus.d.mts +7 -0
- package/dist/esm/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItemStatus.mjs +3 -0
- package/dist/esm/serialization/resources/cardSessions/types/ListCardSessionsResponseMeta.d.mts +10 -0
- package/dist/esm/serialization/resources/cardSessions/types/ListCardSessionsResponseMeta.mjs +6 -0
- package/dist/esm/serialization/resources/cardSessions/types/ListCardSessionsResponseMetaPagination.d.mts +10 -0
- package/dist/esm/serialization/resources/cardSessions/types/ListCardSessionsResponseMetaPagination.mjs +6 -0
- package/dist/esm/serialization/resources/cardSessions/types/index.d.mts +8 -0
- package/dist/esm/serialization/resources/cardSessions/types/index.mjs +8 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +66 -2
|
@@ -8,6 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
11
22
|
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
23
|
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
13
24
|
import * as core from "../../../../core/index.mjs";
|
|
@@ -24,6 +35,115 @@ export class CardSessionsClient {
|
|
|
24
35
|
constructor(options = {}) {
|
|
25
36
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
26
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* List the card sessions you opened for the party you act for, newest first. It never includes card data.
|
|
40
|
+
*
|
|
41
|
+
* @param {Natural.ListCardSessionsRequest} request
|
|
42
|
+
* @param {CardSessionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
43
|
+
*
|
|
44
|
+
* @throws {@link Natural.BadRequestError}
|
|
45
|
+
* @throws {@link Natural.UnauthorizedError}
|
|
46
|
+
* @throws {@link Natural.ForbiddenError}
|
|
47
|
+
* @throws {@link Natural.NotFoundError}
|
|
48
|
+
* @throws {@link Natural.ConflictError}
|
|
49
|
+
* @throws {@link Natural.UnprocessableEntityError}
|
|
50
|
+
* @throws {@link Natural.PreconditionError}
|
|
51
|
+
* @throws {@link Natural.TooManyRequestsError}
|
|
52
|
+
* @throws {@link Natural.InternalServerError}
|
|
53
|
+
* @throws {@link Natural.NotImplementedError}
|
|
54
|
+
* @throws {@link Natural.BadGatewayError}
|
|
55
|
+
* @throws {@link Natural.ServiceUnavailableError}
|
|
56
|
+
* @throws {@link errors.NaturalError}
|
|
57
|
+
* @throws {@link errors.NaturalTimeoutError}
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* await client.cardSessions.list()
|
|
61
|
+
*/
|
|
62
|
+
list(request = {}, requestOptions) {
|
|
63
|
+
return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
|
|
64
|
+
}
|
|
65
|
+
__list() {
|
|
66
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
67
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
68
|
+
const { customerPartyId, status, reference, limit, cursor } = request;
|
|
69
|
+
const _queryParams = {
|
|
70
|
+
customerPartyId,
|
|
71
|
+
status: status != null
|
|
72
|
+
? serializers.ListCardSessionsRequestStatus.jsonOrThrow(status, {
|
|
73
|
+
unrecognizedObjectKeys: "strip",
|
|
74
|
+
omitUndefined: true,
|
|
75
|
+
})
|
|
76
|
+
: undefined,
|
|
77
|
+
reference,
|
|
78
|
+
limit,
|
|
79
|
+
cursor,
|
|
80
|
+
};
|
|
81
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
82
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "X-Instance-ID": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.instanceId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.instanceId }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
83
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
84
|
+
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.NaturalEnvironment.Production, "card-sessions"),
|
|
85
|
+
method: "GET",
|
|
86
|
+
headers: _headers,
|
|
87
|
+
queryString: core.url
|
|
88
|
+
.queryBuilder()
|
|
89
|
+
.addMany(_queryParams)
|
|
90
|
+
.mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
|
|
91
|
+
.build(),
|
|
92
|
+
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
93
|
+
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
94
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
95
|
+
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
96
|
+
logging: this._options.logging,
|
|
97
|
+
});
|
|
98
|
+
if (_response.ok) {
|
|
99
|
+
return {
|
|
100
|
+
data: serializers.ListCardSessionsResponse.parseOrThrow(_response.body, {
|
|
101
|
+
unrecognizedObjectKeys: "passthrough",
|
|
102
|
+
allowUnrecognizedUnionMembers: true,
|
|
103
|
+
allowUnrecognizedEnumValues: true,
|
|
104
|
+
skipValidation: true,
|
|
105
|
+
breadcrumbsPrefix: ["response"],
|
|
106
|
+
}),
|
|
107
|
+
rawResponse: _response.rawResponse,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
if (_response.error.reason === "status-code") {
|
|
111
|
+
switch (_response.error.statusCode) {
|
|
112
|
+
case 400:
|
|
113
|
+
throw new Natural.BadRequestError(_response.error.body, _response.rawResponse);
|
|
114
|
+
case 401:
|
|
115
|
+
throw new Natural.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
116
|
+
case 403:
|
|
117
|
+
throw new Natural.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
118
|
+
case 404:
|
|
119
|
+
throw new Natural.NotFoundError(_response.error.body, _response.rawResponse);
|
|
120
|
+
case 409:
|
|
121
|
+
throw new Natural.ConflictError(_response.error.body, _response.rawResponse);
|
|
122
|
+
case 422:
|
|
123
|
+
throw new Natural.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
124
|
+
case 428:
|
|
125
|
+
throw new Natural.PreconditionError(_response.error.body, _response.rawResponse);
|
|
126
|
+
case 429:
|
|
127
|
+
throw new Natural.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
128
|
+
case 500:
|
|
129
|
+
throw new Natural.InternalServerError(_response.error.body, _response.rawResponse);
|
|
130
|
+
case 501:
|
|
131
|
+
throw new Natural.NotImplementedError(_response.error.body, _response.rawResponse);
|
|
132
|
+
case 502:
|
|
133
|
+
throw new Natural.BadGatewayError(_response.error.body, _response.rawResponse);
|
|
134
|
+
case 503:
|
|
135
|
+
throw new Natural.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
136
|
+
default:
|
|
137
|
+
throw new errors.NaturalError({
|
|
138
|
+
statusCode: _response.error.statusCode,
|
|
139
|
+
body: _response.error.body,
|
|
140
|
+
rawResponse: _response.rawResponse,
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/card-sessions");
|
|
145
|
+
});
|
|
146
|
+
}
|
|
27
147
|
/**
|
|
28
148
|
* Open a session to pay for one purchase with one card. Poll it until the user approves, then claim it once for a stand-in card and proxy login.
|
|
29
149
|
*
|
|
@@ -54,7 +174,8 @@ export class CardSessionsClient {
|
|
|
54
174
|
* merchantName: "Blue Bottle Coffee",
|
|
55
175
|
* amount: 2450,
|
|
56
176
|
* currency: "USD"
|
|
57
|
-
* }
|
|
177
|
+
* },
|
|
178
|
+
* reference: "checkout_7f3a"
|
|
58
179
|
* })
|
|
59
180
|
*/
|
|
60
181
|
create(request, requestOptions) {
|
|
@@ -63,8 +184,12 @@ export class CardSessionsClient {
|
|
|
63
184
|
__create(request, requestOptions) {
|
|
64
185
|
return __awaiter(this, void 0, void 0, function* () {
|
|
65
186
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
187
|
+
const { idempotencyKey } = request, _body = __rest(request, ["idempotencyKey"]);
|
|
66
188
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
67
|
-
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
|
|
189
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
|
|
190
|
+
"Idempotency-Key": idempotencyKey,
|
|
191
|
+
"X-Instance-ID": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.instanceId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.instanceId,
|
|
192
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
68
193
|
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
69
194
|
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.NaturalEnvironment.Production, "card-sessions"),
|
|
70
195
|
method: "POST",
|
|
@@ -72,7 +197,7 @@ export class CardSessionsClient {
|
|
|
72
197
|
contentType: "application/json",
|
|
73
198
|
queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
|
|
74
199
|
requestType: "json",
|
|
75
|
-
body: mergeAdditionalBodyParameters(serializers.CreateCardSessionsRequest.jsonOrThrow(
|
|
200
|
+
body: mergeAdditionalBodyParameters(serializers.CreateCardSessionsRequest.jsonOrThrow(_body, {
|
|
76
201
|
unrecognizedObjectKeys: "strip",
|
|
77
202
|
omitUndefined: true,
|
|
78
203
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.additionalBodyParameters),
|
|
@@ -234,7 +359,7 @@ export class CardSessionsClient {
|
|
|
234
359
|
});
|
|
235
360
|
}
|
|
236
361
|
/**
|
|
237
|
-
* Claim the stand-in card and proxy login for an approved session. It succeeds once,
|
|
362
|
+
* Claim the stand-in card and proxy login for an approved session. It succeeds once; with an Idempotency-Key, retrying with the same key returns a fresh login until expiresAt.
|
|
238
363
|
*
|
|
239
364
|
* @param {Natural.ClaimCardSessionsRequest} request
|
|
240
365
|
* @param {CardSessionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -265,12 +390,15 @@ export class CardSessionsClient {
|
|
|
265
390
|
__claim(request, requestOptions) {
|
|
266
391
|
return __awaiter(this, void 0, void 0, function* () {
|
|
267
392
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
268
|
-
const { sessionId, customerPartyId } = request;
|
|
393
|
+
const { sessionId, customerPartyId, idempotencyKey } = request;
|
|
269
394
|
const _queryParams = {
|
|
270
395
|
customerPartyId,
|
|
271
396
|
};
|
|
272
397
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
273
|
-
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
|
|
398
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
|
|
399
|
+
"Idempotency-Key": idempotencyKey,
|
|
400
|
+
"X-Instance-ID": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.instanceId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.instanceId,
|
|
401
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
274
402
|
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
275
403
|
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.NaturalEnvironment.Production, `card-sessions/${core.url.encodePathParam(sessionId)}/claim`),
|
|
276
404
|
method: "POST",
|
|
@@ -9,4 +9,6 @@ export interface ClaimCardSessionsRequest {
|
|
|
9
9
|
sessionId: string;
|
|
10
10
|
/** Customer party to act for (pty_*). Omit to act as your own party. To act for another party, pass the ID of a party that has authorized you to act on its behalf. */
|
|
11
11
|
customerPartyId?: string;
|
|
12
|
+
/** Optional. Retrying the claim with the same key before expiresAt returns a new stand-in card and proxy login that expire at the same time as the first. Without a key, the credential can't be fetched again. */
|
|
13
|
+
idempotencyKey?: string;
|
|
12
14
|
}
|
|
@@ -9,10 +9,13 @@ import type * as Natural from "../../../../index.mjs";
|
|
|
9
9
|
* merchantName: "Blue Bottle Coffee",
|
|
10
10
|
* amount: 2450,
|
|
11
11
|
* currency: "USD"
|
|
12
|
-
* }
|
|
12
|
+
* },
|
|
13
|
+
* reference: "checkout_7f3a"
|
|
13
14
|
* }
|
|
14
15
|
*/
|
|
15
16
|
export interface CreateCardSessionsRequest {
|
|
17
|
+
/** Optional. Retrying with the same key and body returns the original session and approvalUrl instead of opening another one. */
|
|
18
|
+
idempotencyKey?: string;
|
|
16
19
|
cardId: string;
|
|
17
20
|
/** Customer party to act for (pty_*). Omit to act as your own party. To act for another party, pass the ID of a party that has authorized you to act on its behalf. */
|
|
18
21
|
customerPartyId?: string;
|
|
@@ -22,4 +25,6 @@ export interface CreateCardSessionsRequest {
|
|
|
22
25
|
ttlSeconds?: number;
|
|
23
26
|
/** What the agent is buying. Required for a card the user added (eac_): the user approves this exact purchase. */
|
|
24
27
|
purchase?: Natural.CreateCardSessionsRequestPurchase;
|
|
28
|
+
/** Your own reference for the session, such as your checkout or task ID. Not unique: filter GET /card-sessions by it to find the session again. */
|
|
29
|
+
reference?: string;
|
|
25
30
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type * as Natural from "../../../../index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {}
|
|
5
|
+
*/
|
|
6
|
+
export interface ListCardSessionsRequest {
|
|
7
|
+
/** Customer party to act for (pty_*). Omit to act as your own party. To act for another party, pass the ID of a party that has authorized you to act on its behalf. */
|
|
8
|
+
customerPartyId?: string;
|
|
9
|
+
/** Only sessions with this status. */
|
|
10
|
+
status?: Natural.ListCardSessionsRequestStatus;
|
|
11
|
+
/** Only sessions created with this reference. */
|
|
12
|
+
reference?: string;
|
|
13
|
+
/** Maximum results per page. */
|
|
14
|
+
limit?: number;
|
|
15
|
+
/** Cursor from the previous page. */
|
|
16
|
+
cursor?: string;
|
|
17
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export type { ClaimCardSessionsRequest } from "./ClaimCardSessionsRequest.mjs";
|
|
2
2
|
export type { CreateCardSessionsRequest } from "./CreateCardSessionsRequest.mjs";
|
|
3
3
|
export type { GetCardSessionsRequest } from "./GetCardSessionsRequest.mjs";
|
|
4
|
+
export type { ListCardSessionsRequest } from "./ListCardSessionsRequest.mjs";
|
|
@@ -7,13 +7,15 @@ export interface CreateCardSessionsResponse {
|
|
|
7
7
|
/** pending_approval: waiting for the user; keep polling. approved: claim it now. declined: the user said no. claimed: already collected. expired: open a new session. */
|
|
8
8
|
status: Natural.CreateCardSessionsResponseStatus;
|
|
9
9
|
allowedHosts: string[];
|
|
10
|
+
/** The reference you created the session with. Null when you didn't set one. */
|
|
11
|
+
reference: string | null;
|
|
10
12
|
/** A pending session must be approved, and an approved one claimed, before this. */
|
|
11
13
|
claimExpiresAt: string;
|
|
12
14
|
claimedAt: string | null;
|
|
13
15
|
/** When the claimed proxy login stops working. */
|
|
14
16
|
credentialExpiresAt: string | null;
|
|
15
17
|
createdAt: string;
|
|
16
|
-
/** Cards the user added only, once the purchase is approved: a suggestion to pass on to the user. Null when there's nothing to suggest. */
|
|
18
|
+
/** Cards the user added only, once the purchase is approved: a suggestion to pass on to the user. Null when there's nothing to suggest, and always null in list results: get the session for it. */
|
|
17
19
|
note: Natural.CreateCardSessionsResponseNote | null;
|
|
18
20
|
/** Cards the user added only: send the user here to approve the purchase. Returned only in this response; it can't be fetched again. */
|
|
19
21
|
approvalUrl: string | null;
|
|
@@ -7,12 +7,14 @@ export interface GetCardSessionsResponse {
|
|
|
7
7
|
/** pending_approval: waiting for the user; keep polling. approved: claim it now. declined: the user said no. claimed: already collected. expired: open a new session. */
|
|
8
8
|
status: Natural.GetCardSessionsResponseStatus;
|
|
9
9
|
allowedHosts: string[];
|
|
10
|
+
/** The reference you created the session with. Null when you didn't set one. */
|
|
11
|
+
reference: string | null;
|
|
10
12
|
/** A pending session must be approved, and an approved one claimed, before this. */
|
|
11
13
|
claimExpiresAt: string;
|
|
12
14
|
claimedAt: string | null;
|
|
13
15
|
/** When the claimed proxy login stops working. */
|
|
14
16
|
credentialExpiresAt: string | null;
|
|
15
17
|
createdAt: string;
|
|
16
|
-
/** Cards the user added only, once the purchase is approved: a suggestion to pass on to the user. Null when there's nothing to suggest. */
|
|
18
|
+
/** Cards the user added only, once the purchase is approved: a suggestion to pass on to the user. Null when there's nothing to suggest, and always null in list results: get the session for it. */
|
|
17
19
|
note: Natural.GetCardSessionsResponseNote | null;
|
|
18
20
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Only sessions with this status. */
|
|
2
|
+
export declare const ListCardSessionsRequestStatus: {
|
|
3
|
+
readonly PendingApproval: "pending_approval";
|
|
4
|
+
readonly Approved: "approved";
|
|
5
|
+
readonly Declined: "declined";
|
|
6
|
+
readonly Claimed: "claimed";
|
|
7
|
+
readonly Expired: "expired";
|
|
8
|
+
};
|
|
9
|
+
export type ListCardSessionsRequestStatus = (typeof ListCardSessionsRequestStatus)[keyof typeof ListCardSessionsRequestStatus];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
/** Only sessions with this status. */
|
|
3
|
+
export const ListCardSessionsRequestStatus = {
|
|
4
|
+
PendingApproval: "pending_approval",
|
|
5
|
+
Approved: "approved",
|
|
6
|
+
Declined: "declined",
|
|
7
|
+
Claimed: "claimed",
|
|
8
|
+
Expired: "expired",
|
|
9
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type * as Natural from "../../../index.mjs";
|
|
2
|
+
export interface ListCardSessionsResponseDataItem {
|
|
3
|
+
sessionId: string;
|
|
4
|
+
cardId: string;
|
|
5
|
+
/** natural_issued: an agent card Natural issued to you. external: a card the user added on the dashboard. */
|
|
6
|
+
cardSource: Natural.ListCardSessionsResponseDataItemCardSource;
|
|
7
|
+
/** pending_approval: waiting for the user; keep polling. approved: claim it now. declined: the user said no. claimed: already collected. expired: open a new session. */
|
|
8
|
+
status: Natural.ListCardSessionsResponseDataItemStatus;
|
|
9
|
+
allowedHosts: string[];
|
|
10
|
+
/** The reference you created the session with. Null when you didn't set one. */
|
|
11
|
+
reference: string | null;
|
|
12
|
+
/** A pending session must be approved, and an approved one claimed, before this. */
|
|
13
|
+
claimExpiresAt: string;
|
|
14
|
+
claimedAt: string | null;
|
|
15
|
+
/** When the claimed proxy login stops working. */
|
|
16
|
+
credentialExpiresAt: string | null;
|
|
17
|
+
createdAt: string;
|
|
18
|
+
/** Cards the user added only, once the purchase is approved: a suggestion to pass on to the user. Null when there's nothing to suggest, and always null in list results: get the session for it. */
|
|
19
|
+
note: Natural.ListCardSessionsResponseDataItemNote | null;
|
|
20
|
+
}
|
package/dist/esm/api/resources/cardSessions/types/ListCardSessionsResponseDataItemCardSource.d.mts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** natural_issued: an agent card Natural issued to you. external: a card the user added on the dashboard. */
|
|
2
|
+
export declare const ListCardSessionsResponseDataItemCardSource: {
|
|
3
|
+
readonly NaturalIssued: "natural_issued";
|
|
4
|
+
readonly External: "external";
|
|
5
|
+
};
|
|
6
|
+
export type ListCardSessionsResponseDataItemCardSource = (typeof ListCardSessionsResponseDataItemCardSource)[keyof typeof ListCardSessionsResponseDataItemCardSource];
|
package/dist/esm/api/resources/cardSessions/types/ListCardSessionsResponseDataItemCardSource.mjs
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
/** natural_issued: an agent card Natural issued to you. external: a card the user added on the dashboard. */
|
|
3
|
+
export const ListCardSessionsResponseDataItemCardSource = {
|
|
4
|
+
NaturalIssued: "natural_issued",
|
|
5
|
+
External: "external",
|
|
6
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface ListCardSessionsResponseDataItemNote {
|
|
2
|
+
/** What to tell the user: what would let them skip the security code next time, such as verifying their identity or adding money to Natural. */
|
|
3
|
+
message: string;
|
|
4
|
+
/** A page to send the user to for that step. Null when there's nothing to do yet. */
|
|
5
|
+
url: string | null;
|
|
6
|
+
}
|
package/dist/esm/api/resources/cardSessions/types/ListCardSessionsResponseDataItemStatus.d.mts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** pending_approval: waiting for the user; keep polling. approved: claim it now. declined: the user said no. claimed: already collected. expired: open a new session. */
|
|
2
|
+
export declare const ListCardSessionsResponseDataItemStatus: {
|
|
3
|
+
readonly PendingApproval: "pending_approval";
|
|
4
|
+
readonly Approved: "approved";
|
|
5
|
+
readonly Declined: "declined";
|
|
6
|
+
readonly Claimed: "claimed";
|
|
7
|
+
readonly Expired: "expired";
|
|
8
|
+
};
|
|
9
|
+
export type ListCardSessionsResponseDataItemStatus = (typeof ListCardSessionsResponseDataItemStatus)[keyof typeof ListCardSessionsResponseDataItemStatus];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
/** pending_approval: waiting for the user; keep polling. approved: claim it now. declined: the user said no. claimed: already collected. expired: open a new session. */
|
|
3
|
+
export const ListCardSessionsResponseDataItemStatus = {
|
|
4
|
+
PendingApproval: "pending_approval",
|
|
5
|
+
Approved: "approved",
|
|
6
|
+
Declined: "declined",
|
|
7
|
+
Claimed: "claimed",
|
|
8
|
+
Expired: "expired",
|
|
9
|
+
};
|
|
@@ -12,3 +12,11 @@ export * from "./GetCardSessionsResponse.mjs";
|
|
|
12
12
|
export * from "./GetCardSessionsResponseCardSource.mjs";
|
|
13
13
|
export * from "./GetCardSessionsResponseNote.mjs";
|
|
14
14
|
export * from "./GetCardSessionsResponseStatus.mjs";
|
|
15
|
+
export * from "./ListCardSessionsRequestStatus.mjs";
|
|
16
|
+
export * from "./ListCardSessionsResponse.mjs";
|
|
17
|
+
export * from "./ListCardSessionsResponseDataItem.mjs";
|
|
18
|
+
export * from "./ListCardSessionsResponseDataItemCardSource.mjs";
|
|
19
|
+
export * from "./ListCardSessionsResponseDataItemNote.mjs";
|
|
20
|
+
export * from "./ListCardSessionsResponseDataItemStatus.mjs";
|
|
21
|
+
export * from "./ListCardSessionsResponseMeta.mjs";
|
|
22
|
+
export * from "./ListCardSessionsResponseMetaPagination.mjs";
|
|
@@ -12,3 +12,11 @@ export * from "./GetCardSessionsResponse.mjs";
|
|
|
12
12
|
export * from "./GetCardSessionsResponseCardSource.mjs";
|
|
13
13
|
export * from "./GetCardSessionsResponseNote.mjs";
|
|
14
14
|
export * from "./GetCardSessionsResponseStatus.mjs";
|
|
15
|
+
export * from "./ListCardSessionsRequestStatus.mjs";
|
|
16
|
+
export * from "./ListCardSessionsResponse.mjs";
|
|
17
|
+
export * from "./ListCardSessionsResponseDataItem.mjs";
|
|
18
|
+
export * from "./ListCardSessionsResponseDataItemCardSource.mjs";
|
|
19
|
+
export * from "./ListCardSessionsResponseDataItemNote.mjs";
|
|
20
|
+
export * from "./ListCardSessionsResponseDataItemStatus.mjs";
|
|
21
|
+
export * from "./ListCardSessionsResponseMeta.mjs";
|
|
22
|
+
export * from "./ListCardSessionsResponseMetaPagination.mjs";
|
|
@@ -2,7 +2,7 @@ import type * as Natural from "../../../../../api/index.mjs";
|
|
|
2
2
|
import * as core from "../../../../../core/index.mjs";
|
|
3
3
|
import type * as serializers from "../../../../index.mjs";
|
|
4
4
|
import { CreateCardSessionsRequestPurchase } from "../../types/CreateCardSessionsRequestPurchase.mjs";
|
|
5
|
-
export declare const CreateCardSessionsRequest: core.serialization.Schema<serializers.CreateCardSessionsRequest.Raw, Natural.CreateCardSessionsRequest
|
|
5
|
+
export declare const CreateCardSessionsRequest: core.serialization.Schema<serializers.CreateCardSessionsRequest.Raw, Omit<Natural.CreateCardSessionsRequest, "idempotencyKey">>;
|
|
6
6
|
export declare namespace CreateCardSessionsRequest {
|
|
7
7
|
interface Raw {
|
|
8
8
|
cardId: string;
|
|
@@ -10,5 +10,6 @@ export declare namespace CreateCardSessionsRequest {
|
|
|
10
10
|
allowedHosts: string[];
|
|
11
11
|
ttlSeconds?: number | null;
|
|
12
12
|
purchase?: CreateCardSessionsRequestPurchase.Raw | null;
|
|
13
|
+
reference?: string | null;
|
|
13
14
|
}
|
|
14
15
|
}
|
package/dist/esm/serialization/resources/cardSessions/client/requests/CreateCardSessionsRequest.mjs
CHANGED
|
@@ -7,4 +7,5 @@ export const CreateCardSessionsRequest = core.serialization.object({
|
|
|
7
7
|
allowedHosts: core.serialization.list(core.serialization.string()),
|
|
8
8
|
ttlSeconds: core.serialization.number().optional(),
|
|
9
9
|
purchase: CreateCardSessionsRequestPurchase.optional(),
|
|
10
|
+
reference: core.serialization.string().optional(),
|
|
10
11
|
});
|
package/dist/esm/serialization/resources/cardSessions/types/CreateCardSessionsResponse.d.mts
CHANGED
|
@@ -12,6 +12,7 @@ export declare namespace CreateCardSessionsResponse {
|
|
|
12
12
|
cardSource: CreateCardSessionsResponseCardSource.Raw;
|
|
13
13
|
status: CreateCardSessionsResponseStatus.Raw;
|
|
14
14
|
allowedHosts: string[];
|
|
15
|
+
reference?: string | null;
|
|
15
16
|
claimExpiresAt: string;
|
|
16
17
|
claimedAt?: string | null;
|
|
17
18
|
credentialExpiresAt?: string | null;
|
|
@@ -9,6 +9,7 @@ export const CreateCardSessionsResponse = core.serialization.object({
|
|
|
9
9
|
cardSource: CreateCardSessionsResponseCardSource,
|
|
10
10
|
status: CreateCardSessionsResponseStatus,
|
|
11
11
|
allowedHosts: core.serialization.list(core.serialization.string()),
|
|
12
|
+
reference: core.serialization.string().nullable(),
|
|
12
13
|
claimExpiresAt: core.serialization.string(),
|
|
13
14
|
claimedAt: core.serialization.string().nullable(),
|
|
14
15
|
credentialExpiresAt: core.serialization.string().nullable(),
|
|
@@ -12,6 +12,7 @@ export declare namespace GetCardSessionsResponse {
|
|
|
12
12
|
cardSource: GetCardSessionsResponseCardSource.Raw;
|
|
13
13
|
status: GetCardSessionsResponseStatus.Raw;
|
|
14
14
|
allowedHosts: string[];
|
|
15
|
+
reference?: string | null;
|
|
15
16
|
claimExpiresAt: string;
|
|
16
17
|
claimedAt?: string | null;
|
|
17
18
|
credentialExpiresAt?: string | null;
|
|
@@ -9,6 +9,7 @@ export const GetCardSessionsResponse = core.serialization.object({
|
|
|
9
9
|
cardSource: GetCardSessionsResponseCardSource,
|
|
10
10
|
status: GetCardSessionsResponseStatus,
|
|
11
11
|
allowedHosts: core.serialization.list(core.serialization.string()),
|
|
12
|
+
reference: core.serialization.string().nullable(),
|
|
12
13
|
claimExpiresAt: core.serialization.string(),
|
|
13
14
|
claimedAt: core.serialization.string().nullable(),
|
|
14
15
|
credentialExpiresAt: core.serialization.string().nullable(),
|
package/dist/esm/serialization/resources/cardSessions/types/ListCardSessionsRequestStatus.d.mts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as Natural from "../../../../api/index.mjs";
|
|
2
|
+
import * as core from "../../../../core/index.mjs";
|
|
3
|
+
import type * as serializers from "../../../index.mjs";
|
|
4
|
+
export declare const ListCardSessionsRequestStatus: core.serialization.Schema<serializers.ListCardSessionsRequestStatus.Raw, Natural.ListCardSessionsRequestStatus>;
|
|
5
|
+
export declare namespace ListCardSessionsRequestStatus {
|
|
6
|
+
type Raw = "pending_approval" | "approved" | "declined" | "claimed" | "expired";
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type * as Natural from "../../../../api/index.mjs";
|
|
2
|
+
import * as core from "../../../../core/index.mjs";
|
|
3
|
+
import type * as serializers from "../../../index.mjs";
|
|
4
|
+
import { ListCardSessionsResponseDataItem } from "./ListCardSessionsResponseDataItem.mjs";
|
|
5
|
+
import { ListCardSessionsResponseMeta } from "./ListCardSessionsResponseMeta.mjs";
|
|
6
|
+
export declare const ListCardSessionsResponse: core.serialization.ObjectSchema<serializers.ListCardSessionsResponse.Raw, Natural.ListCardSessionsResponse>;
|
|
7
|
+
export declare namespace ListCardSessionsResponse {
|
|
8
|
+
interface Raw {
|
|
9
|
+
data: ListCardSessionsResponseDataItem.Raw[];
|
|
10
|
+
meta: ListCardSessionsResponseMeta.Raw;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as core from "../../../../core/index.mjs";
|
|
3
|
+
import { ListCardSessionsResponseDataItem } from "./ListCardSessionsResponseDataItem.mjs";
|
|
4
|
+
import { ListCardSessionsResponseMeta } from "./ListCardSessionsResponseMeta.mjs";
|
|
5
|
+
export const ListCardSessionsResponse = core.serialization.object({
|
|
6
|
+
data: core.serialization.list(ListCardSessionsResponseDataItem),
|
|
7
|
+
meta: ListCardSessionsResponseMeta,
|
|
8
|
+
});
|
package/dist/esm/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItem.d.mts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type * as Natural from "../../../../api/index.mjs";
|
|
2
|
+
import * as core from "../../../../core/index.mjs";
|
|
3
|
+
import type * as serializers from "../../../index.mjs";
|
|
4
|
+
import { ListCardSessionsResponseDataItemCardSource } from "./ListCardSessionsResponseDataItemCardSource.mjs";
|
|
5
|
+
import { ListCardSessionsResponseDataItemNote } from "./ListCardSessionsResponseDataItemNote.mjs";
|
|
6
|
+
import { ListCardSessionsResponseDataItemStatus } from "./ListCardSessionsResponseDataItemStatus.mjs";
|
|
7
|
+
export declare const ListCardSessionsResponseDataItem: core.serialization.ObjectSchema<serializers.ListCardSessionsResponseDataItem.Raw, Natural.ListCardSessionsResponseDataItem>;
|
|
8
|
+
export declare namespace ListCardSessionsResponseDataItem {
|
|
9
|
+
interface Raw {
|
|
10
|
+
sessionId: string;
|
|
11
|
+
cardId: string;
|
|
12
|
+
cardSource: ListCardSessionsResponseDataItemCardSource.Raw;
|
|
13
|
+
status: ListCardSessionsResponseDataItemStatus.Raw;
|
|
14
|
+
allowedHosts: string[];
|
|
15
|
+
reference?: string | null;
|
|
16
|
+
claimExpiresAt: string;
|
|
17
|
+
claimedAt?: string | null;
|
|
18
|
+
credentialExpiresAt?: string | null;
|
|
19
|
+
createdAt: string;
|
|
20
|
+
note?: ListCardSessionsResponseDataItemNote.Raw | null;
|
|
21
|
+
}
|
|
22
|
+
}
|
package/dist/esm/serialization/resources/cardSessions/types/ListCardSessionsResponseDataItem.mjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as core from "../../../../core/index.mjs";
|
|
3
|
+
import { ListCardSessionsResponseDataItemCardSource } from "./ListCardSessionsResponseDataItemCardSource.mjs";
|
|
4
|
+
import { ListCardSessionsResponseDataItemNote } from "./ListCardSessionsResponseDataItemNote.mjs";
|
|
5
|
+
import { ListCardSessionsResponseDataItemStatus } from "./ListCardSessionsResponseDataItemStatus.mjs";
|
|
6
|
+
export const ListCardSessionsResponseDataItem = core.serialization.object({
|
|
7
|
+
sessionId: core.serialization.string(),
|
|
8
|
+
cardId: core.serialization.string(),
|
|
9
|
+
cardSource: ListCardSessionsResponseDataItemCardSource,
|
|
10
|
+
status: ListCardSessionsResponseDataItemStatus,
|
|
11
|
+
allowedHosts: core.serialization.list(core.serialization.string()),
|
|
12
|
+
reference: core.serialization.string().nullable(),
|
|
13
|
+
claimExpiresAt: core.serialization.string(),
|
|
14
|
+
claimedAt: core.serialization.string().nullable(),
|
|
15
|
+
credentialExpiresAt: core.serialization.string().nullable(),
|
|
16
|
+
createdAt: core.serialization.string(),
|
|
17
|
+
note: ListCardSessionsResponseDataItemNote.nullable(),
|
|
18
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as Natural from "../../../../api/index.mjs";
|
|
2
|
+
import * as core from "../../../../core/index.mjs";
|
|
3
|
+
import type * as serializers from "../../../index.mjs";
|
|
4
|
+
export declare const ListCardSessionsResponseDataItemCardSource: core.serialization.Schema<serializers.ListCardSessionsResponseDataItemCardSource.Raw, Natural.ListCardSessionsResponseDataItemCardSource>;
|
|
5
|
+
export declare namespace ListCardSessionsResponseDataItemCardSource {
|
|
6
|
+
type Raw = "natural_issued" | "external";
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as Natural from "../../../../api/index.mjs";
|
|
2
|
+
import * as core from "../../../../core/index.mjs";
|
|
3
|
+
import type * as serializers from "../../../index.mjs";
|
|
4
|
+
export declare const ListCardSessionsResponseDataItemNote: core.serialization.ObjectSchema<serializers.ListCardSessionsResponseDataItemNote.Raw, Natural.ListCardSessionsResponseDataItemNote>;
|
|
5
|
+
export declare namespace ListCardSessionsResponseDataItemNote {
|
|
6
|
+
interface Raw {
|
|
7
|
+
message: string;
|
|
8
|
+
url?: string | null;
|
|
9
|
+
}
|
|
10
|
+
}
|