@fonderie/client 0.10.0 → 0.11.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/brain/signatures.md +38 -25
- package/dist/index.cjs +25 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +44 -24
- package/dist/index.d.ts +44 -24
- package/dist/index.js +25 -10
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -26,6 +26,7 @@ interface IRequestOptions {
|
|
|
26
26
|
token?: string | undefined;
|
|
27
27
|
cookie?: string | undefined;
|
|
28
28
|
workspaceId?: string | undefined;
|
|
29
|
+
headers?: Record<string, string> | undefined;
|
|
29
30
|
cache?: number | false | undefined;
|
|
30
31
|
bust?: boolean | undefined;
|
|
31
32
|
invalidate?: string[] | undefined;
|
|
@@ -79,10 +80,6 @@ interface IUserPreferences {
|
|
|
79
80
|
dateFormat: string;
|
|
80
81
|
timeFormat: string;
|
|
81
82
|
}
|
|
82
|
-
interface IUserSkill {
|
|
83
|
-
name: string;
|
|
84
|
-
level: string;
|
|
85
|
-
}
|
|
86
83
|
interface IUserDTO {
|
|
87
84
|
id: string;
|
|
88
85
|
email: string;
|
|
@@ -92,9 +89,9 @@ interface IUserDTO {
|
|
|
92
89
|
profileImageUrl: string;
|
|
93
90
|
isActive: boolean;
|
|
94
91
|
lastLogin: string;
|
|
95
|
-
skills: IUserSkill[];
|
|
96
92
|
preferences: IUserPreferences;
|
|
97
93
|
isEmailVerified: boolean;
|
|
94
|
+
isPhoneVerified: boolean;
|
|
98
95
|
mfaEnabled: boolean;
|
|
99
96
|
suspended: boolean;
|
|
100
97
|
whitelist: boolean;
|
|
@@ -109,10 +106,12 @@ interface ITokens {
|
|
|
109
106
|
interface IRegisterResult {
|
|
110
107
|
tokens: ITokens;
|
|
111
108
|
user: IUserDTO;
|
|
109
|
+
requiresVerification?: boolean;
|
|
112
110
|
}
|
|
113
111
|
interface ILoginResult {
|
|
114
112
|
tokens: ITokens;
|
|
115
113
|
user: IUserDTO;
|
|
114
|
+
requiresVerification?: boolean;
|
|
116
115
|
}
|
|
117
116
|
interface IMfaRequiredResult {
|
|
118
117
|
mfaToken: string;
|
|
@@ -126,13 +125,8 @@ interface IVerifyEmailResult {
|
|
|
126
125
|
email: string;
|
|
127
126
|
}
|
|
128
127
|
interface IResendVerificationResult {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
data: {
|
|
132
|
-
token: string;
|
|
133
|
-
expiresAt: string;
|
|
134
|
-
email: string;
|
|
135
|
-
};
|
|
128
|
+
email?: string;
|
|
129
|
+
verified?: boolean;
|
|
136
130
|
}
|
|
137
131
|
interface IMeResult {
|
|
138
132
|
user: IUserDTO;
|
|
@@ -142,8 +136,7 @@ interface IMfaSetupResult {
|
|
|
142
136
|
backupCodes: string[];
|
|
143
137
|
}
|
|
144
138
|
interface IMfaEnabledResult {
|
|
145
|
-
|
|
146
|
-
user: IUserDTO;
|
|
139
|
+
mfaEnabled: boolean;
|
|
147
140
|
}
|
|
148
141
|
interface IPlanFeature {
|
|
149
142
|
name: string;
|
|
@@ -164,6 +157,9 @@ interface IPlanDTO {
|
|
|
164
157
|
yearly: number;
|
|
165
158
|
currency: string;
|
|
166
159
|
};
|
|
160
|
+
/** True when pricing came from a stale cache — a provider outage or a
|
|
161
|
+
* transfer window. Show prices as indicative when set. */
|
|
162
|
+
pricingStale?: boolean;
|
|
167
163
|
features: IPlanFeature[];
|
|
168
164
|
metadata: Record<string, unknown>;
|
|
169
165
|
}
|
|
@@ -224,6 +220,7 @@ interface IWorkspaceDTO {
|
|
|
224
220
|
isPersonal: boolean;
|
|
225
221
|
isArchived: boolean;
|
|
226
222
|
archivedAt: string;
|
|
223
|
+
archivedBy: string;
|
|
227
224
|
createdAt: string;
|
|
228
225
|
updatedAt: string;
|
|
229
226
|
}
|
|
@@ -242,6 +239,11 @@ interface IMemberDTO {
|
|
|
242
239
|
roleName: string;
|
|
243
240
|
confirmed: boolean;
|
|
244
241
|
createdAt: string;
|
|
242
|
+
/** Identity, so a member list can be rendered without a second request. */
|
|
243
|
+
email: string;
|
|
244
|
+
firstName: string;
|
|
245
|
+
lastName: string;
|
|
246
|
+
profileImageUrl: string;
|
|
245
247
|
}
|
|
246
248
|
interface IInvitationDTO {
|
|
247
249
|
id: string;
|
|
@@ -376,7 +378,10 @@ interface IWebhookDeliveryDTO {
|
|
|
376
378
|
eventType: string;
|
|
377
379
|
status: string;
|
|
378
380
|
attempts: number;
|
|
381
|
+
payload: Record<string, unknown>;
|
|
379
382
|
responseStatus: number | null;
|
|
383
|
+
responseBody: string | null;
|
|
384
|
+
nextAttemptAt: string | null;
|
|
380
385
|
deliveredAt: string | null;
|
|
381
386
|
createdAt: string;
|
|
382
387
|
}
|
|
@@ -418,6 +423,7 @@ interface ICustomerEmailDTO {
|
|
|
418
423
|
id: string;
|
|
419
424
|
email: string;
|
|
420
425
|
label: string;
|
|
426
|
+
labelId: string | null;
|
|
421
427
|
isPrimary: boolean;
|
|
422
428
|
createdAt: string;
|
|
423
429
|
}
|
|
@@ -425,6 +431,7 @@ interface ICustomerPhoneDTO {
|
|
|
425
431
|
id: string;
|
|
426
432
|
phone: string;
|
|
427
433
|
label: string;
|
|
434
|
+
labelId: string | null;
|
|
428
435
|
isPrimary: boolean;
|
|
429
436
|
createdAt: string;
|
|
430
437
|
}
|
|
@@ -440,6 +447,7 @@ interface IAddressDTO {
|
|
|
440
447
|
interface ICustomerAddressDTO {
|
|
441
448
|
id: string;
|
|
442
449
|
label: string;
|
|
450
|
+
labelId: string | null;
|
|
443
451
|
isPrimary: boolean;
|
|
444
452
|
address: IAddressDTO;
|
|
445
453
|
}
|
|
@@ -462,6 +470,7 @@ type ICustomerRelationshipExpandedDTO = Omit<ICustomerShallowDTO, 'id'> & {
|
|
|
462
470
|
customerId: string;
|
|
463
471
|
relationship: string;
|
|
464
472
|
isPrimary: boolean;
|
|
473
|
+
relationshipCreatedAt: string;
|
|
465
474
|
};
|
|
466
475
|
type ICustomerRelationshipExpandedD2DTO = ICustomerRelationshipExpandedDTO & {
|
|
467
476
|
relationships: ICustomerRelationshipExpandedDTO[];
|
|
@@ -567,17 +576,22 @@ interface IResetPasswordInput {
|
|
|
567
576
|
password: string;
|
|
568
577
|
}
|
|
569
578
|
interface IUpdateProfileInput {
|
|
570
|
-
firstName?: string;
|
|
571
|
-
lastName?: string;
|
|
572
|
-
avatarUrl?: string;
|
|
579
|
+
firstName?: string | null;
|
|
580
|
+
lastName?: string | null;
|
|
581
|
+
avatarUrl?: string | null;
|
|
573
582
|
}
|
|
574
583
|
interface IUpdatePreferencesInput {
|
|
575
584
|
locale?: string;
|
|
576
585
|
timezone?: string;
|
|
577
|
-
notifications?:
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
586
|
+
notifications?: {
|
|
587
|
+
email?: boolean;
|
|
588
|
+
inApp?: boolean;
|
|
589
|
+
sms?: boolean;
|
|
590
|
+
push?: boolean;
|
|
591
|
+
};
|
|
592
|
+
emailDigest?: string;
|
|
593
|
+
dateFormat?: string;
|
|
594
|
+
timeFormat?: string;
|
|
581
595
|
}
|
|
582
596
|
interface IChangePasswordInput {
|
|
583
597
|
currentPassword: string;
|
|
@@ -681,7 +695,7 @@ interface ICreateCustomerInput {
|
|
|
681
695
|
referralCode?: string | null;
|
|
682
696
|
referredByCode?: string | null;
|
|
683
697
|
}
|
|
684
|
-
type IUpdateCustomerInput = ICreateCustomerInput
|
|
698
|
+
type IUpdateCustomerInput = Omit<ICreateCustomerInput, 'referralCode' | 'referredByCode'>;
|
|
685
699
|
interface IBlacklistCustomerInput {
|
|
686
700
|
reason?: string;
|
|
687
701
|
}
|
|
@@ -708,7 +722,7 @@ interface IAddAddressInput {
|
|
|
708
722
|
}
|
|
709
723
|
interface IAddRelationshipInput {
|
|
710
724
|
relatedId: string;
|
|
711
|
-
relationship
|
|
725
|
+
relationship: string;
|
|
712
726
|
isPrimary?: boolean;
|
|
713
727
|
}
|
|
714
728
|
declare class CustomersClient {
|
|
@@ -927,11 +941,13 @@ declare class FonderieClient {
|
|
|
927
941
|
interface ISetConfigInput {
|
|
928
942
|
value: unknown;
|
|
929
943
|
description?: string;
|
|
944
|
+
active?: boolean;
|
|
930
945
|
ifVersion?: number;
|
|
931
946
|
}
|
|
932
947
|
interface ISetSecretInput {
|
|
933
948
|
value: string;
|
|
934
949
|
description?: string;
|
|
950
|
+
active?: boolean;
|
|
935
951
|
ifVersion?: number;
|
|
936
952
|
}
|
|
937
953
|
interface IRollbackInput {
|
|
@@ -940,10 +956,12 @@ interface IRollbackInput {
|
|
|
940
956
|
interface IConfigAdminClientOptions {
|
|
941
957
|
baseUrl: string;
|
|
942
958
|
adminToken: string;
|
|
959
|
+
actor?: string;
|
|
943
960
|
}
|
|
944
961
|
declare class ConfigAdminClient {
|
|
945
962
|
private http;
|
|
946
963
|
private adminToken;
|
|
964
|
+
private actorHeaders;
|
|
947
965
|
constructor(opts: IConfigAdminClientOptions);
|
|
948
966
|
listConfig(environment?: string): Promise<IApiResponse<IConfigEntry[]>>;
|
|
949
967
|
getConfig(key: string, environment?: string): Promise<IApiResponse<IConfigEntry>>;
|
|
@@ -973,10 +991,12 @@ interface IRollbackTemplateInput {
|
|
|
973
991
|
interface ICourierAdminClientOptions {
|
|
974
992
|
baseUrl: string;
|
|
975
993
|
adminToken: string;
|
|
994
|
+
actor?: string;
|
|
976
995
|
}
|
|
977
996
|
declare class CourierAdminClient {
|
|
978
997
|
private http;
|
|
979
998
|
private adminToken;
|
|
999
|
+
private actorHeaders;
|
|
980
1000
|
constructor(opts: ICourierAdminClientOptions);
|
|
981
1001
|
listTemplates(): Promise<IApiResponse<ITemplateEntry[]>>;
|
|
982
1002
|
getTemplate(type: string, locale?: string | null): Promise<IApiResponse<ITemplateEntry>>;
|
|
@@ -986,4 +1006,4 @@ declare class CourierAdminClient {
|
|
|
986
1006
|
rollback(type: string, input: IRollbackTemplateInput, locale?: string | null): Promise<IApiResponse<ITemplateEntry>>;
|
|
987
1007
|
}
|
|
988
1008
|
|
|
989
|
-
export { AuditClient, AuthClient, BillingClient, ConfigAdminClient, CourierAdminClient, type CustomerLabelType, type CustomerSex, type CustomerType, CustomersClient, FonderieApiError, FonderieClient, type IAcceptInvitationResult, type IAddAddressInput, type IAddEmailInput, type IAddPhoneInput, type IAddRelationshipInput, type IAddressDTO, type IApiError, type IApiResponse, type IAuditEventDTO, type IAuditPageResult, type IBlacklistCustomerInput, type ICache, type IChangePasswordInput, type ICheckoutInput, type ICheckoutUrlResult, type IClientAuthConfig, type IConfigAdminClientOptions, type IConfigEntry, type IConfigRevision, type ICourierAdminClientOptions, type ICreateCustomerInput, type ICreatePlanInput, type ICreateRoleInput, type ICreateWebhookEndpointInput, type ICreateWorkspaceInput, type ICustomerAddressDTO, type ICustomerAddressListResult, type ICustomerAddressResult, type ICustomerDTO, type ICustomerDetailD2DTO, type ICustomerDetailDTO, type ICustomerEmailDTO, type ICustomerEmailListResult, type ICustomerEmailResult, type ICustomerLabelDTO, type ICustomerLabelListResult, type ICustomerListResult, type ICustomerNoteDTO, type ICustomerNoteListResult, type ICustomerNoteResult, type ICustomerPhoneDTO, type ICustomerPhoneListResult, type ICustomerPhoneResult, type ICustomerRelationshipDTO, type ICustomerRelationshipExpandedD2DTO, type ICustomerRelationshipExpandedDTO, type ICustomerRelationshipListResult, type ICustomerRelationshipResult, type ICustomerResult, type ICustomerShallowDTO, type ICustomerTagListResult, type IFonderieClientOptions, type IGetCustomerInput, type IInvitationDTO, type IInvitationListResult, type IInviteEntry, type IInviteResult, type IListAuditEventsInput, type IListCustomersInput, type ILoginInput, type ILoginResult, type IMeResult, type IMemberDTO, type IMemberListResult, type IMemoryCacheOptions, type IMfaEnabledResult, type IMfaRequiredResult, type IMfaSetupResult, type IPlanDTO, type IPlanFeature, type IPlanListResult, type IPlanResult, type IPortalUrlResult, type IReadOptions, type IRecordUsageInput, type IRefreshResult, type IRegisterInput, type IRegisterResult, type IRequestConfig, type IResendVerificationResult, type IResetPasswordInput, type IRevealSecretResult, type IRoleDTO, type IRoleListResult, type IRolePermission, type IRolePermissionInput, type IRolePermissionsResult, type IRoleResult, type IRollbackInput, type IRollbackTemplateInput, type ISecretEntry, type ISecretRevision, type ISetConfigInput, type ISetSecretInput, type ISetTemplateInput, type ISubscriptionDTO, type ISubscriptionResult, type ITemplateEntry, type ITemplateRevision, type ITestWebhookResult, type ITokens, type IUpdateCustomerInput, type IUpdatePlanInput, type IUpdatePreferencesInput, type IUpdateProfileInput, type IUpdateRoleInput, type IUpdateSettingsInput, type IUpdateWebhookEndpointInput, type IUpdateWorkspaceInput, type IUsageResult, type IUserDTO, type IUserPreferences, type
|
|
1009
|
+
export { AuditClient, AuthClient, BillingClient, ConfigAdminClient, CourierAdminClient, type CustomerLabelType, type CustomerSex, type CustomerType, CustomersClient, FonderieApiError, FonderieClient, type IAcceptInvitationResult, type IAddAddressInput, type IAddEmailInput, type IAddPhoneInput, type IAddRelationshipInput, type IAddressDTO, type IApiError, type IApiResponse, type IAuditEventDTO, type IAuditPageResult, type IBlacklistCustomerInput, type ICache, type IChangePasswordInput, type ICheckoutInput, type ICheckoutUrlResult, type IClientAuthConfig, type IConfigAdminClientOptions, type IConfigEntry, type IConfigRevision, type ICourierAdminClientOptions, type ICreateCustomerInput, type ICreatePlanInput, type ICreateRoleInput, type ICreateWebhookEndpointInput, type ICreateWorkspaceInput, type ICustomerAddressDTO, type ICustomerAddressListResult, type ICustomerAddressResult, type ICustomerDTO, type ICustomerDetailD2DTO, type ICustomerDetailDTO, type ICustomerEmailDTO, type ICustomerEmailListResult, type ICustomerEmailResult, type ICustomerLabelDTO, type ICustomerLabelListResult, type ICustomerListResult, type ICustomerNoteDTO, type ICustomerNoteListResult, type ICustomerNoteResult, type ICustomerPhoneDTO, type ICustomerPhoneListResult, type ICustomerPhoneResult, type ICustomerRelationshipDTO, type ICustomerRelationshipExpandedD2DTO, type ICustomerRelationshipExpandedDTO, type ICustomerRelationshipListResult, type ICustomerRelationshipResult, type ICustomerResult, type ICustomerShallowDTO, type ICustomerTagListResult, type IFonderieClientOptions, type IGetCustomerInput, type IInvitationDTO, type IInvitationListResult, type IInviteEntry, type IInviteResult, type IListAuditEventsInput, type IListCustomersInput, type ILoginInput, type ILoginResult, type IMeResult, type IMemberDTO, type IMemberListResult, type IMemoryCacheOptions, type IMfaEnabledResult, type IMfaRequiredResult, type IMfaSetupResult, type IPlanDTO, type IPlanFeature, type IPlanListResult, type IPlanResult, type IPortalUrlResult, type IReadOptions, type IRecordUsageInput, type IRefreshResult, type IRegisterInput, type IRegisterResult, type IRequestConfig, type IResendVerificationResult, type IResetPasswordInput, type IRevealSecretResult, type IRoleDTO, type IRoleListResult, type IRolePermission, type IRolePermissionInput, type IRolePermissionsResult, type IRoleResult, type IRollbackInput, type IRollbackTemplateInput, type ISecretEntry, type ISecretRevision, type ISetConfigInput, type ISetSecretInput, type ISetTemplateInput, type ISubscriptionDTO, type ISubscriptionResult, type ITemplateEntry, type ITemplateRevision, type ITestWebhookResult, type ITokens, type IUpdateCustomerInput, type IUpdatePlanInput, type IUpdatePreferencesInput, type IUpdateProfileInput, type IUpdateRoleInput, type IUpdateSettingsInput, type IUpdateWebhookEndpointInput, type IUpdateWorkspaceInput, type IUsageResult, type IUserDTO, type IUserPreferences, type IVerifyEmailResult, type IWebhookDeliveryDTO, type IWebhookDeliveryListResult, type IWebhookEndpointCreatedDTO, type IWebhookEndpointDTO, type IWebhookEndpointListResult, type IWorkspaceAddressDTO, type IWorkspaceDTO, type IWorkspaceListResult, type IWorkspaceResult, type IWorkspaceSettingsDTO, type IWorkspaceSettingsResult, type SubscriberType, WebhooksClient, WorkspacesClient, createMemoryCache, isMfaRequired };
|
package/dist/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ interface IRequestOptions {
|
|
|
26
26
|
token?: string | undefined;
|
|
27
27
|
cookie?: string | undefined;
|
|
28
28
|
workspaceId?: string | undefined;
|
|
29
|
+
headers?: Record<string, string> | undefined;
|
|
29
30
|
cache?: number | false | undefined;
|
|
30
31
|
bust?: boolean | undefined;
|
|
31
32
|
invalidate?: string[] | undefined;
|
|
@@ -79,10 +80,6 @@ interface IUserPreferences {
|
|
|
79
80
|
dateFormat: string;
|
|
80
81
|
timeFormat: string;
|
|
81
82
|
}
|
|
82
|
-
interface IUserSkill {
|
|
83
|
-
name: string;
|
|
84
|
-
level: string;
|
|
85
|
-
}
|
|
86
83
|
interface IUserDTO {
|
|
87
84
|
id: string;
|
|
88
85
|
email: string;
|
|
@@ -92,9 +89,9 @@ interface IUserDTO {
|
|
|
92
89
|
profileImageUrl: string;
|
|
93
90
|
isActive: boolean;
|
|
94
91
|
lastLogin: string;
|
|
95
|
-
skills: IUserSkill[];
|
|
96
92
|
preferences: IUserPreferences;
|
|
97
93
|
isEmailVerified: boolean;
|
|
94
|
+
isPhoneVerified: boolean;
|
|
98
95
|
mfaEnabled: boolean;
|
|
99
96
|
suspended: boolean;
|
|
100
97
|
whitelist: boolean;
|
|
@@ -109,10 +106,12 @@ interface ITokens {
|
|
|
109
106
|
interface IRegisterResult {
|
|
110
107
|
tokens: ITokens;
|
|
111
108
|
user: IUserDTO;
|
|
109
|
+
requiresVerification?: boolean;
|
|
112
110
|
}
|
|
113
111
|
interface ILoginResult {
|
|
114
112
|
tokens: ITokens;
|
|
115
113
|
user: IUserDTO;
|
|
114
|
+
requiresVerification?: boolean;
|
|
116
115
|
}
|
|
117
116
|
interface IMfaRequiredResult {
|
|
118
117
|
mfaToken: string;
|
|
@@ -126,13 +125,8 @@ interface IVerifyEmailResult {
|
|
|
126
125
|
email: string;
|
|
127
126
|
}
|
|
128
127
|
interface IResendVerificationResult {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
data: {
|
|
132
|
-
token: string;
|
|
133
|
-
expiresAt: string;
|
|
134
|
-
email: string;
|
|
135
|
-
};
|
|
128
|
+
email?: string;
|
|
129
|
+
verified?: boolean;
|
|
136
130
|
}
|
|
137
131
|
interface IMeResult {
|
|
138
132
|
user: IUserDTO;
|
|
@@ -142,8 +136,7 @@ interface IMfaSetupResult {
|
|
|
142
136
|
backupCodes: string[];
|
|
143
137
|
}
|
|
144
138
|
interface IMfaEnabledResult {
|
|
145
|
-
|
|
146
|
-
user: IUserDTO;
|
|
139
|
+
mfaEnabled: boolean;
|
|
147
140
|
}
|
|
148
141
|
interface IPlanFeature {
|
|
149
142
|
name: string;
|
|
@@ -164,6 +157,9 @@ interface IPlanDTO {
|
|
|
164
157
|
yearly: number;
|
|
165
158
|
currency: string;
|
|
166
159
|
};
|
|
160
|
+
/** True when pricing came from a stale cache — a provider outage or a
|
|
161
|
+
* transfer window. Show prices as indicative when set. */
|
|
162
|
+
pricingStale?: boolean;
|
|
167
163
|
features: IPlanFeature[];
|
|
168
164
|
metadata: Record<string, unknown>;
|
|
169
165
|
}
|
|
@@ -224,6 +220,7 @@ interface IWorkspaceDTO {
|
|
|
224
220
|
isPersonal: boolean;
|
|
225
221
|
isArchived: boolean;
|
|
226
222
|
archivedAt: string;
|
|
223
|
+
archivedBy: string;
|
|
227
224
|
createdAt: string;
|
|
228
225
|
updatedAt: string;
|
|
229
226
|
}
|
|
@@ -242,6 +239,11 @@ interface IMemberDTO {
|
|
|
242
239
|
roleName: string;
|
|
243
240
|
confirmed: boolean;
|
|
244
241
|
createdAt: string;
|
|
242
|
+
/** Identity, so a member list can be rendered without a second request. */
|
|
243
|
+
email: string;
|
|
244
|
+
firstName: string;
|
|
245
|
+
lastName: string;
|
|
246
|
+
profileImageUrl: string;
|
|
245
247
|
}
|
|
246
248
|
interface IInvitationDTO {
|
|
247
249
|
id: string;
|
|
@@ -376,7 +378,10 @@ interface IWebhookDeliveryDTO {
|
|
|
376
378
|
eventType: string;
|
|
377
379
|
status: string;
|
|
378
380
|
attempts: number;
|
|
381
|
+
payload: Record<string, unknown>;
|
|
379
382
|
responseStatus: number | null;
|
|
383
|
+
responseBody: string | null;
|
|
384
|
+
nextAttemptAt: string | null;
|
|
380
385
|
deliveredAt: string | null;
|
|
381
386
|
createdAt: string;
|
|
382
387
|
}
|
|
@@ -418,6 +423,7 @@ interface ICustomerEmailDTO {
|
|
|
418
423
|
id: string;
|
|
419
424
|
email: string;
|
|
420
425
|
label: string;
|
|
426
|
+
labelId: string | null;
|
|
421
427
|
isPrimary: boolean;
|
|
422
428
|
createdAt: string;
|
|
423
429
|
}
|
|
@@ -425,6 +431,7 @@ interface ICustomerPhoneDTO {
|
|
|
425
431
|
id: string;
|
|
426
432
|
phone: string;
|
|
427
433
|
label: string;
|
|
434
|
+
labelId: string | null;
|
|
428
435
|
isPrimary: boolean;
|
|
429
436
|
createdAt: string;
|
|
430
437
|
}
|
|
@@ -440,6 +447,7 @@ interface IAddressDTO {
|
|
|
440
447
|
interface ICustomerAddressDTO {
|
|
441
448
|
id: string;
|
|
442
449
|
label: string;
|
|
450
|
+
labelId: string | null;
|
|
443
451
|
isPrimary: boolean;
|
|
444
452
|
address: IAddressDTO;
|
|
445
453
|
}
|
|
@@ -462,6 +470,7 @@ type ICustomerRelationshipExpandedDTO = Omit<ICustomerShallowDTO, 'id'> & {
|
|
|
462
470
|
customerId: string;
|
|
463
471
|
relationship: string;
|
|
464
472
|
isPrimary: boolean;
|
|
473
|
+
relationshipCreatedAt: string;
|
|
465
474
|
};
|
|
466
475
|
type ICustomerRelationshipExpandedD2DTO = ICustomerRelationshipExpandedDTO & {
|
|
467
476
|
relationships: ICustomerRelationshipExpandedDTO[];
|
|
@@ -567,17 +576,22 @@ interface IResetPasswordInput {
|
|
|
567
576
|
password: string;
|
|
568
577
|
}
|
|
569
578
|
interface IUpdateProfileInput {
|
|
570
|
-
firstName?: string;
|
|
571
|
-
lastName?: string;
|
|
572
|
-
avatarUrl?: string;
|
|
579
|
+
firstName?: string | null;
|
|
580
|
+
lastName?: string | null;
|
|
581
|
+
avatarUrl?: string | null;
|
|
573
582
|
}
|
|
574
583
|
interface IUpdatePreferencesInput {
|
|
575
584
|
locale?: string;
|
|
576
585
|
timezone?: string;
|
|
577
|
-
notifications?:
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
586
|
+
notifications?: {
|
|
587
|
+
email?: boolean;
|
|
588
|
+
inApp?: boolean;
|
|
589
|
+
sms?: boolean;
|
|
590
|
+
push?: boolean;
|
|
591
|
+
};
|
|
592
|
+
emailDigest?: string;
|
|
593
|
+
dateFormat?: string;
|
|
594
|
+
timeFormat?: string;
|
|
581
595
|
}
|
|
582
596
|
interface IChangePasswordInput {
|
|
583
597
|
currentPassword: string;
|
|
@@ -681,7 +695,7 @@ interface ICreateCustomerInput {
|
|
|
681
695
|
referralCode?: string | null;
|
|
682
696
|
referredByCode?: string | null;
|
|
683
697
|
}
|
|
684
|
-
type IUpdateCustomerInput = ICreateCustomerInput
|
|
698
|
+
type IUpdateCustomerInput = Omit<ICreateCustomerInput, 'referralCode' | 'referredByCode'>;
|
|
685
699
|
interface IBlacklistCustomerInput {
|
|
686
700
|
reason?: string;
|
|
687
701
|
}
|
|
@@ -708,7 +722,7 @@ interface IAddAddressInput {
|
|
|
708
722
|
}
|
|
709
723
|
interface IAddRelationshipInput {
|
|
710
724
|
relatedId: string;
|
|
711
|
-
relationship
|
|
725
|
+
relationship: string;
|
|
712
726
|
isPrimary?: boolean;
|
|
713
727
|
}
|
|
714
728
|
declare class CustomersClient {
|
|
@@ -927,11 +941,13 @@ declare class FonderieClient {
|
|
|
927
941
|
interface ISetConfigInput {
|
|
928
942
|
value: unknown;
|
|
929
943
|
description?: string;
|
|
944
|
+
active?: boolean;
|
|
930
945
|
ifVersion?: number;
|
|
931
946
|
}
|
|
932
947
|
interface ISetSecretInput {
|
|
933
948
|
value: string;
|
|
934
949
|
description?: string;
|
|
950
|
+
active?: boolean;
|
|
935
951
|
ifVersion?: number;
|
|
936
952
|
}
|
|
937
953
|
interface IRollbackInput {
|
|
@@ -940,10 +956,12 @@ interface IRollbackInput {
|
|
|
940
956
|
interface IConfigAdminClientOptions {
|
|
941
957
|
baseUrl: string;
|
|
942
958
|
adminToken: string;
|
|
959
|
+
actor?: string;
|
|
943
960
|
}
|
|
944
961
|
declare class ConfigAdminClient {
|
|
945
962
|
private http;
|
|
946
963
|
private adminToken;
|
|
964
|
+
private actorHeaders;
|
|
947
965
|
constructor(opts: IConfigAdminClientOptions);
|
|
948
966
|
listConfig(environment?: string): Promise<IApiResponse<IConfigEntry[]>>;
|
|
949
967
|
getConfig(key: string, environment?: string): Promise<IApiResponse<IConfigEntry>>;
|
|
@@ -973,10 +991,12 @@ interface IRollbackTemplateInput {
|
|
|
973
991
|
interface ICourierAdminClientOptions {
|
|
974
992
|
baseUrl: string;
|
|
975
993
|
adminToken: string;
|
|
994
|
+
actor?: string;
|
|
976
995
|
}
|
|
977
996
|
declare class CourierAdminClient {
|
|
978
997
|
private http;
|
|
979
998
|
private adminToken;
|
|
999
|
+
private actorHeaders;
|
|
980
1000
|
constructor(opts: ICourierAdminClientOptions);
|
|
981
1001
|
listTemplates(): Promise<IApiResponse<ITemplateEntry[]>>;
|
|
982
1002
|
getTemplate(type: string, locale?: string | null): Promise<IApiResponse<ITemplateEntry>>;
|
|
@@ -986,4 +1006,4 @@ declare class CourierAdminClient {
|
|
|
986
1006
|
rollback(type: string, input: IRollbackTemplateInput, locale?: string | null): Promise<IApiResponse<ITemplateEntry>>;
|
|
987
1007
|
}
|
|
988
1008
|
|
|
989
|
-
export { AuditClient, AuthClient, BillingClient, ConfigAdminClient, CourierAdminClient, type CustomerLabelType, type CustomerSex, type CustomerType, CustomersClient, FonderieApiError, FonderieClient, type IAcceptInvitationResult, type IAddAddressInput, type IAddEmailInput, type IAddPhoneInput, type IAddRelationshipInput, type IAddressDTO, type IApiError, type IApiResponse, type IAuditEventDTO, type IAuditPageResult, type IBlacklistCustomerInput, type ICache, type IChangePasswordInput, type ICheckoutInput, type ICheckoutUrlResult, type IClientAuthConfig, type IConfigAdminClientOptions, type IConfigEntry, type IConfigRevision, type ICourierAdminClientOptions, type ICreateCustomerInput, type ICreatePlanInput, type ICreateRoleInput, type ICreateWebhookEndpointInput, type ICreateWorkspaceInput, type ICustomerAddressDTO, type ICustomerAddressListResult, type ICustomerAddressResult, type ICustomerDTO, type ICustomerDetailD2DTO, type ICustomerDetailDTO, type ICustomerEmailDTO, type ICustomerEmailListResult, type ICustomerEmailResult, type ICustomerLabelDTO, type ICustomerLabelListResult, type ICustomerListResult, type ICustomerNoteDTO, type ICustomerNoteListResult, type ICustomerNoteResult, type ICustomerPhoneDTO, type ICustomerPhoneListResult, type ICustomerPhoneResult, type ICustomerRelationshipDTO, type ICustomerRelationshipExpandedD2DTO, type ICustomerRelationshipExpandedDTO, type ICustomerRelationshipListResult, type ICustomerRelationshipResult, type ICustomerResult, type ICustomerShallowDTO, type ICustomerTagListResult, type IFonderieClientOptions, type IGetCustomerInput, type IInvitationDTO, type IInvitationListResult, type IInviteEntry, type IInviteResult, type IListAuditEventsInput, type IListCustomersInput, type ILoginInput, type ILoginResult, type IMeResult, type IMemberDTO, type IMemberListResult, type IMemoryCacheOptions, type IMfaEnabledResult, type IMfaRequiredResult, type IMfaSetupResult, type IPlanDTO, type IPlanFeature, type IPlanListResult, type IPlanResult, type IPortalUrlResult, type IReadOptions, type IRecordUsageInput, type IRefreshResult, type IRegisterInput, type IRegisterResult, type IRequestConfig, type IResendVerificationResult, type IResetPasswordInput, type IRevealSecretResult, type IRoleDTO, type IRoleListResult, type IRolePermission, type IRolePermissionInput, type IRolePermissionsResult, type IRoleResult, type IRollbackInput, type IRollbackTemplateInput, type ISecretEntry, type ISecretRevision, type ISetConfigInput, type ISetSecretInput, type ISetTemplateInput, type ISubscriptionDTO, type ISubscriptionResult, type ITemplateEntry, type ITemplateRevision, type ITestWebhookResult, type ITokens, type IUpdateCustomerInput, type IUpdatePlanInput, type IUpdatePreferencesInput, type IUpdateProfileInput, type IUpdateRoleInput, type IUpdateSettingsInput, type IUpdateWebhookEndpointInput, type IUpdateWorkspaceInput, type IUsageResult, type IUserDTO, type IUserPreferences, type
|
|
1009
|
+
export { AuditClient, AuthClient, BillingClient, ConfigAdminClient, CourierAdminClient, type CustomerLabelType, type CustomerSex, type CustomerType, CustomersClient, FonderieApiError, FonderieClient, type IAcceptInvitationResult, type IAddAddressInput, type IAddEmailInput, type IAddPhoneInput, type IAddRelationshipInput, type IAddressDTO, type IApiError, type IApiResponse, type IAuditEventDTO, type IAuditPageResult, type IBlacklistCustomerInput, type ICache, type IChangePasswordInput, type ICheckoutInput, type ICheckoutUrlResult, type IClientAuthConfig, type IConfigAdminClientOptions, type IConfigEntry, type IConfigRevision, type ICourierAdminClientOptions, type ICreateCustomerInput, type ICreatePlanInput, type ICreateRoleInput, type ICreateWebhookEndpointInput, type ICreateWorkspaceInput, type ICustomerAddressDTO, type ICustomerAddressListResult, type ICustomerAddressResult, type ICustomerDTO, type ICustomerDetailD2DTO, type ICustomerDetailDTO, type ICustomerEmailDTO, type ICustomerEmailListResult, type ICustomerEmailResult, type ICustomerLabelDTO, type ICustomerLabelListResult, type ICustomerListResult, type ICustomerNoteDTO, type ICustomerNoteListResult, type ICustomerNoteResult, type ICustomerPhoneDTO, type ICustomerPhoneListResult, type ICustomerPhoneResult, type ICustomerRelationshipDTO, type ICustomerRelationshipExpandedD2DTO, type ICustomerRelationshipExpandedDTO, type ICustomerRelationshipListResult, type ICustomerRelationshipResult, type ICustomerResult, type ICustomerShallowDTO, type ICustomerTagListResult, type IFonderieClientOptions, type IGetCustomerInput, type IInvitationDTO, type IInvitationListResult, type IInviteEntry, type IInviteResult, type IListAuditEventsInput, type IListCustomersInput, type ILoginInput, type ILoginResult, type IMeResult, type IMemberDTO, type IMemberListResult, type IMemoryCacheOptions, type IMfaEnabledResult, type IMfaRequiredResult, type IMfaSetupResult, type IPlanDTO, type IPlanFeature, type IPlanListResult, type IPlanResult, type IPortalUrlResult, type IReadOptions, type IRecordUsageInput, type IRefreshResult, type IRegisterInput, type IRegisterResult, type IRequestConfig, type IResendVerificationResult, type IResetPasswordInput, type IRevealSecretResult, type IRoleDTO, type IRoleListResult, type IRolePermission, type IRolePermissionInput, type IRolePermissionsResult, type IRoleResult, type IRollbackInput, type IRollbackTemplateInput, type ISecretEntry, type ISecretRevision, type ISetConfigInput, type ISetSecretInput, type ISetTemplateInput, type ISubscriptionDTO, type ISubscriptionResult, type ITemplateEntry, type ITemplateRevision, type ITestWebhookResult, type ITokens, type IUpdateCustomerInput, type IUpdatePlanInput, type IUpdatePreferencesInput, type IUpdateProfileInput, type IUpdateRoleInput, type IUpdateSettingsInput, type IUpdateWebhookEndpointInput, type IUpdateWorkspaceInput, type IUsageResult, type IUserDTO, type IUserPreferences, type IVerifyEmailResult, type IWebhookDeliveryDTO, type IWebhookDeliveryListResult, type IWebhookEndpointCreatedDTO, type IWebhookEndpointDTO, type IWebhookEndpointListResult, type IWorkspaceAddressDTO, type IWorkspaceDTO, type IWorkspaceListResult, type IWorkspaceResult, type IWorkspaceSettingsDTO, type IWorkspaceSettingsResult, type SubscriberType, WebhooksClient, WorkspacesClient, createMemoryCache, isMfaRequired };
|
package/dist/index.js
CHANGED
|
@@ -95,6 +95,7 @@ var HttpClient = class {
|
|
|
95
95
|
if (opts.token) headers["Authorization"] = `Bearer ${opts.token}`;
|
|
96
96
|
if (opts.cookie) headers["Cookie"] = opts.cookie;
|
|
97
97
|
if (opts.workspaceId) headers["X-Workspace-ID"] = opts.workspaceId;
|
|
98
|
+
Object.assign(headers, opts.headers ?? {});
|
|
98
99
|
const fetchInit = { method: opts.method, headers, credentials: "include" };
|
|
99
100
|
if (opts.body !== void 0) fetchInit.body = JSON.stringify(opts.body);
|
|
100
101
|
const res = await fetch(`${this.baseUrl}${opts.path}`, fetchInit);
|
|
@@ -1257,9 +1258,11 @@ function envQuery(environment) {
|
|
|
1257
1258
|
var ConfigAdminClient = class {
|
|
1258
1259
|
http;
|
|
1259
1260
|
adminToken;
|
|
1261
|
+
actorHeaders;
|
|
1260
1262
|
constructor(opts) {
|
|
1261
1263
|
this.http = new HttpClient(opts.baseUrl);
|
|
1262
1264
|
this.adminToken = opts.adminToken;
|
|
1265
|
+
this.actorHeaders = opts.actor ? { "X-Actor": opts.actor } : void 0;
|
|
1263
1266
|
}
|
|
1264
1267
|
// ── Config ───────────────────────────────────────────────────────────────
|
|
1265
1268
|
listConfig(environment) {
|
|
@@ -1281,14 +1284,16 @@ var ConfigAdminClient = class {
|
|
|
1281
1284
|
method: "PUT",
|
|
1282
1285
|
path: `/admin/config/${key}${envQuery(environment)}`,
|
|
1283
1286
|
body: input,
|
|
1284
|
-
token: this.adminToken
|
|
1287
|
+
token: this.adminToken,
|
|
1288
|
+
headers: this.actorHeaders
|
|
1285
1289
|
});
|
|
1286
1290
|
}
|
|
1287
1291
|
deleteConfig(key, environment) {
|
|
1288
1292
|
return this.http.request({
|
|
1289
1293
|
method: "DELETE",
|
|
1290
1294
|
path: `/admin/config/${key}${envQuery(environment)}`,
|
|
1291
|
-
token: this.adminToken
|
|
1295
|
+
token: this.adminToken,
|
|
1296
|
+
headers: this.actorHeaders
|
|
1292
1297
|
});
|
|
1293
1298
|
}
|
|
1294
1299
|
listConfigRevisions(key, environment) {
|
|
@@ -1303,7 +1308,8 @@ var ConfigAdminClient = class {
|
|
|
1303
1308
|
method: "POST",
|
|
1304
1309
|
path: `/admin/config/${key}/rollback${envQuery(environment)}`,
|
|
1305
1310
|
body: input,
|
|
1306
|
-
token: this.adminToken
|
|
1311
|
+
token: this.adminToken,
|
|
1312
|
+
headers: this.actorHeaders
|
|
1307
1313
|
});
|
|
1308
1314
|
}
|
|
1309
1315
|
// ── Secrets (masked) ─────────────────────────────────────────────────────
|
|
@@ -1326,14 +1332,16 @@ var ConfigAdminClient = class {
|
|
|
1326
1332
|
method: "PUT",
|
|
1327
1333
|
path: `/admin/secrets/${key}${envQuery(environment)}`,
|
|
1328
1334
|
body: input,
|
|
1329
|
-
token: this.adminToken
|
|
1335
|
+
token: this.adminToken,
|
|
1336
|
+
headers: this.actorHeaders
|
|
1330
1337
|
});
|
|
1331
1338
|
}
|
|
1332
1339
|
deleteSecret(key, environment) {
|
|
1333
1340
|
return this.http.request({
|
|
1334
1341
|
method: "DELETE",
|
|
1335
1342
|
path: `/admin/secrets/${key}${envQuery(environment)}`,
|
|
1336
|
-
token: this.adminToken
|
|
1343
|
+
token: this.adminToken,
|
|
1344
|
+
headers: this.actorHeaders
|
|
1337
1345
|
});
|
|
1338
1346
|
}
|
|
1339
1347
|
listSecretRevisions(key, environment) {
|
|
@@ -1348,7 +1356,8 @@ var ConfigAdminClient = class {
|
|
|
1348
1356
|
method: "POST",
|
|
1349
1357
|
path: `/admin/secrets/${key}/rollback${envQuery(environment)}`,
|
|
1350
1358
|
body: input,
|
|
1351
|
-
token: this.adminToken
|
|
1359
|
+
token: this.adminToken,
|
|
1360
|
+
headers: this.actorHeaders
|
|
1352
1361
|
});
|
|
1353
1362
|
}
|
|
1354
1363
|
// POST (not GET) so the decrypted value never lands in a URL or access log.
|
|
@@ -1356,7 +1365,8 @@ var ConfigAdminClient = class {
|
|
|
1356
1365
|
return this.http.request({
|
|
1357
1366
|
method: "POST",
|
|
1358
1367
|
path: `/admin/secrets/${key}/reveal${envQuery(environment)}`,
|
|
1359
|
-
token: this.adminToken
|
|
1368
|
+
token: this.adminToken,
|
|
1369
|
+
headers: this.actorHeaders
|
|
1360
1370
|
});
|
|
1361
1371
|
}
|
|
1362
1372
|
};
|
|
@@ -1365,9 +1375,11 @@ var ConfigAdminClient = class {
|
|
|
1365
1375
|
var CourierAdminClient = class {
|
|
1366
1376
|
http;
|
|
1367
1377
|
adminToken;
|
|
1378
|
+
actorHeaders;
|
|
1368
1379
|
constructor(opts) {
|
|
1369
1380
|
this.http = new HttpClient(opts.baseUrl);
|
|
1370
1381
|
this.adminToken = opts.adminToken;
|
|
1382
|
+
this.actorHeaders = opts.actor ? { "X-Actor": opts.actor } : void 0;
|
|
1371
1383
|
}
|
|
1372
1384
|
listTemplates() {
|
|
1373
1385
|
return this.http.request({
|
|
@@ -1390,7 +1402,8 @@ var CourierAdminClient = class {
|
|
|
1390
1402
|
method: "PUT",
|
|
1391
1403
|
path: `/admin/templates/${type}${q}`,
|
|
1392
1404
|
body: input,
|
|
1393
|
-
token: this.adminToken
|
|
1405
|
+
token: this.adminToken,
|
|
1406
|
+
headers: this.actorHeaders
|
|
1394
1407
|
});
|
|
1395
1408
|
}
|
|
1396
1409
|
deleteTemplate(type, locale) {
|
|
@@ -1398,7 +1411,8 @@ var CourierAdminClient = class {
|
|
|
1398
1411
|
return this.http.request({
|
|
1399
1412
|
method: "DELETE",
|
|
1400
1413
|
path: `/admin/templates/${type}${q}`,
|
|
1401
|
-
token: this.adminToken
|
|
1414
|
+
token: this.adminToken,
|
|
1415
|
+
headers: this.actorHeaders
|
|
1402
1416
|
});
|
|
1403
1417
|
}
|
|
1404
1418
|
listRevisions(type, locale) {
|
|
@@ -1415,7 +1429,8 @@ var CourierAdminClient = class {
|
|
|
1415
1429
|
method: "POST",
|
|
1416
1430
|
path: `/admin/templates/${type}/rollback${q}`,
|
|
1417
1431
|
body: input,
|
|
1418
|
-
token: this.adminToken
|
|
1432
|
+
token: this.adminToken,
|
|
1433
|
+
headers: this.actorHeaders
|
|
1419
1434
|
});
|
|
1420
1435
|
}
|
|
1421
1436
|
};
|