@attesso/types 1.0.3 → 1.0.4
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/README.md +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mandate-request.d.ts +96 -0
- package/dist/mandate-request.d.ts.map +1 -0
- package/dist/mandate-request.js +9 -0
- package/dist/mandate-request.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./enclave.js"), exports);
|
|
18
18
|
__exportStar(require("./mandate.js"), exports);
|
|
19
|
+
__exportStar(require("./mandate-request.js"), exports);
|
|
19
20
|
__exportStar(require("./passport.js"), exports);
|
|
20
21
|
__exportStar(require("./payment.js"), exports);
|
|
21
22
|
__exportStar(require("./user.js"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,+CAA6B;AAC7B,gDAA8B;AAC9B,+CAA6B;AAC7B,4CAA0B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,+CAA6B;AAC7B,uDAAqC;AACrC,gDAA8B;AAC9B,+CAA6B;AAC7B,4CAA0B"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mandate Request Types
|
|
3
|
+
*
|
|
4
|
+
* Types for the asynchronous mandate request flow where agents
|
|
5
|
+
* create requests and users approve via link.
|
|
6
|
+
*/
|
|
7
|
+
export type MandateRequestStatus = 'pending' | 'approved' | 'expired' | 'rejected' | 'cancelled';
|
|
8
|
+
/**
|
|
9
|
+
* Request body for creating a mandate request.
|
|
10
|
+
*/
|
|
11
|
+
export interface CreateMandateRequestInput {
|
|
12
|
+
/** Maximum spend in cents */
|
|
13
|
+
maxAmount: number;
|
|
14
|
+
/** ISO 4217 currency code (default: "USD") */
|
|
15
|
+
currency?: string;
|
|
16
|
+
/** Category for the spending (e.g., "travel", "shopping") */
|
|
17
|
+
category?: string;
|
|
18
|
+
/** Restrict to specific merchant */
|
|
19
|
+
merchant?: string;
|
|
20
|
+
/** Duration the mandate is valid after approval (e.g., "24h", "7d") */
|
|
21
|
+
validityWindow: string;
|
|
22
|
+
/** How long before the approval link expires (default: "1h") */
|
|
23
|
+
requestExpiresIn?: string;
|
|
24
|
+
/** Webhook URL to notify when status changes */
|
|
25
|
+
callbackUrl?: string;
|
|
26
|
+
/** Pass-through metadata */
|
|
27
|
+
metadata?: Record<string, unknown>;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Response from creating a mandate request.
|
|
31
|
+
*/
|
|
32
|
+
export interface CreateMandateRequestResponse {
|
|
33
|
+
/** Unique request ID */
|
|
34
|
+
id: string;
|
|
35
|
+
/** URL to send to the user for approval */
|
|
36
|
+
approvalUrl: string;
|
|
37
|
+
/** When the approval link expires */
|
|
38
|
+
expiresAt: string;
|
|
39
|
+
/** Current status */
|
|
40
|
+
status: MandateRequestStatus;
|
|
41
|
+
/** Secret for verifying webhook payloads (only returned on creation) */
|
|
42
|
+
callbackSecret?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Mandate details included when a request is approved.
|
|
46
|
+
*/
|
|
47
|
+
export interface ApprovedMandateDetails {
|
|
48
|
+
id: string;
|
|
49
|
+
maxAmount: number;
|
|
50
|
+
currency: string;
|
|
51
|
+
merchant: string | null;
|
|
52
|
+
expiresAt: string | null;
|
|
53
|
+
status: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Full mandate request details when polling.
|
|
57
|
+
*/
|
|
58
|
+
export interface MandateRequestDetails {
|
|
59
|
+
id: string;
|
|
60
|
+
status: MandateRequestStatus;
|
|
61
|
+
maxAmount: number;
|
|
62
|
+
currency: string;
|
|
63
|
+
category: string | null;
|
|
64
|
+
merchant: string | null;
|
|
65
|
+
validityWindow: string;
|
|
66
|
+
expiresAt: string;
|
|
67
|
+
createdAt: string;
|
|
68
|
+
approvedAt?: string;
|
|
69
|
+
rejectedAt?: string;
|
|
70
|
+
metadata: Record<string, unknown> | null;
|
|
71
|
+
/** Mandate details if approved */
|
|
72
|
+
mandate?: ApprovedMandateDetails;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Webhook event types for mandate requests.
|
|
76
|
+
*/
|
|
77
|
+
export type MandateRequestEventType = 'mandate_request.approved' | 'mandate_request.rejected' | 'mandate_request.expired' | 'mandate_request.cancelled';
|
|
78
|
+
/**
|
|
79
|
+
* Webhook payload for mandate request events.
|
|
80
|
+
*/
|
|
81
|
+
export interface MandateRequestWebhookPayload {
|
|
82
|
+
event: MandateRequestEventType;
|
|
83
|
+
timestamp: string;
|
|
84
|
+
data: {
|
|
85
|
+
requestId: string;
|
|
86
|
+
mandateId?: string;
|
|
87
|
+
status: string;
|
|
88
|
+
maxAmount: number;
|
|
89
|
+
currency: string;
|
|
90
|
+
category?: string;
|
|
91
|
+
merchant?: string;
|
|
92
|
+
expiresAt?: string;
|
|
93
|
+
metadata?: unknown;
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=mandate-request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mandate-request.d.ts","sourceRoot":"","sources":["../src/mandate-request.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,oBAAoB,GAC5B,SAAS,GACT,UAAU,GACV,SAAS,GACT,UAAU,GACV,WAAW,CAAC;AAEhB;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uEAAuE;IACvE,cAAc,EAAE,MAAM,CAAC;IACvB,gEAAgE;IAChE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4BAA4B;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,qCAAqC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,qBAAqB;IACrB,MAAM,EAAE,oBAAoB,CAAC;IAC7B,wEAAwE;IACxE,cAAc,CAAC,EAAE,MAAM,CAAC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,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;CACH"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Mandate Request Types
|
|
4
|
+
*
|
|
5
|
+
* Types for the asynchronous mandate request flow where agents
|
|
6
|
+
* create requests and users approve via link.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
//# sourceMappingURL=mandate-request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mandate-request.js","sourceRoot":"","sources":["../src/mandate-request.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
|