evo360-types 1.3.200 → 1.3.204

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.
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zServiceInvoiceSchema = exports.zProviderPayloadSnapshotSchema = exports.zProviderTraceSchema = exports.zProviderInvoiceErrorSchema = exports.zProviderInvoiceIdentifiersSchema = exports.zProviderInvoiceLinksSchema = exports.zServiceTaxInfoSchema = exports.zServiceLineItemSchema = exports.zServiceInvoiceStateSchema = exports.zProviderServiceInvoiceStatusSchema = exports.zInvoiceSourceRefSchema = exports.zInvoiceSourceTypeSchema = exports.zInvoiceTakerRefSchema = exports.zInvoiceTakerSnapshotSchema = exports.zInvoiceTakerSnapshotAddressSchema = exports.zTakerDocumentSchema = exports.zTakerTaxProfileSchema = exports.zTakerProviderRefsSchema = exports.zTakerAddressSchema = exports.zInvoiceTakerTypeSchema = exports.zIssuerTaxProfileSchema = exports.zIssuerNfseConfigSchema = exports.zIssuerMunicipalCredentialsRefSchema = exports.zIssuerTaxRegimeSchema = exports.zIssuerCompanyIdentitySchema = exports.zIssuerCompanyAddressSchema = exports.zTaxProfileSyncStateSchema = exports.zAsaasProviderSchema = exports.zAsaasProviderAsaasBlockSchema = exports.zAsaasProviderCapabilitiesSchema = exports.zAsaasPaymentsCapabilitiesSchema = exports.zAsaasNfseCapabilitiesSchema = exports.zAsaasEnvAuthConfigSchema = exports.zAsaasAccountScopeSchema = exports.zAsaasWebhookConfigSchema = exports.zRetryPolicySchema = exports.zAsaasWebhookEventSchema = exports.zAsaasAccountScopeModeSchema = exports.zProviderRemoteRefsSchema = exports.zProviderFiscalInfoPayloadSchema = exports.zProviderCredentialsSecretRefsSchema = exports.zProviderMunicipalOptionsSnapshotSchema = exports.zProviderOptionItemSchema = exports.zProviderMunicipalAuthTypeSchema = exports.zFinopsProviderBaseSchema = exports.zProviderStatusSchema = exports.zFinopsActionSchema = exports.zFinopsProviderTypeSchema = exports.zProviderEnvSchema = void 0;
3
+ exports.zProviderPayloadSnapshotSchema = exports.zProviderTraceSchema = exports.zProviderInvoiceErrorSchema = exports.zProviderInvoiceIdentifiersSchema = exports.zProviderInvoiceLinksSchema = exports.zServiceTaxInfoSchema = exports.zServiceLineItemSchema = exports.zServiceInvoiceStateSchema = exports.zProviderServiceInvoiceStatusSchema = exports.zInvoiceSourceRefSchema = exports.zInvoiceSourceTypeSchema = exports.zInvoiceTakerRefSchema = exports.zInvoiceTakerSnapshotSchema = exports.zInvoiceTakerSnapshotAddressSchema = exports.zTakerDocumentSchema = exports.zTakerTaxProfileSchema = exports.zTakerProviderRefsSchema = exports.zTakerAddressSchema = exports.zInvoiceTakerTypeSchema = exports.zIssuerTaxProfileSchema = exports.zIssuerNfseConfigSchema = exports.zIssuerMunicipalCredentialsRefSchema = exports.zIssuerTaxRegimeSchema = exports.zIssuerCompanyIdentitySchema = exports.zIssuerCompanyAddressSchema = exports.zTaxProfileSyncStateSchema = exports.zAsaasProviderSchema = exports.zAsaasProviderAsaasBlockSchema = exports.zAsaasProviderCapabilitiesSchema = exports.zAsaasPaymentsCapabilitiesSchema = exports.zAsaasNfseCapabilitiesSchema = exports.zAsaasEnvAuthConfigSchema = exports.zAsaasSubaccountInputSchema = exports.zAsaasAccountScopeSchema = exports.zAsaasWebhookConfigSchema = exports.zRetryPolicySchema = exports.zAsaasWebhookEventSchema = exports.zAsaasAccountScopeModeSchema = exports.zProviderRemoteRefsSchema = exports.zProviderFiscalInfoPayloadSchema = exports.zProviderCredentialsInputSchema = exports.zProviderCredentialsSecretRefsSchema = exports.zProviderMunicipalOptionsSnapshotSchema = exports.zProviderOptionItemSchema = exports.zProviderMunicipalAuthTypeSchema = exports.zFinopsProviderBaseSchema = exports.zProviderStatusSchema = exports.zFinopsActionSchema = exports.zFinopsProviderTypeSchema = exports.zProviderEnvSchema = void 0;
4
+ exports.zServiceInvoiceSchema = void 0;
4
5
  const zod_1 = require("zod");
5
6
  const zod_schemas_1 = require("../shared/zod-schemas");
6
7
  // ---- Provider enums and base ----
@@ -88,6 +89,16 @@ exports.zProviderCredentialsSecretRefsSchema = zod_1.z
88
89
  certificate_password_secret_ref: zod_1.z.string().optional(),
89
90
  })
90
91
  .passthrough();
92
+ exports.zProviderCredentialsInputSchema = zod_1.z
93
+ .object({
94
+ username: zod_1.z.string().optional(),
95
+ password: zod_1.z.string().optional(),
96
+ access_token: zod_1.z.string().optional(),
97
+ digital_certificate_base64: zod_1.z.string().optional(),
98
+ digital_certificate: zod_1.z.string().optional(),
99
+ certificate_password: zod_1.z.string().optional(),
100
+ })
101
+ .passthrough();
91
102
  exports.zProviderFiscalInfoPayloadSchema = zod_1.z
92
103
  .object({
93
104
  email: zod_1.z.string().optional(),
@@ -101,6 +112,7 @@ exports.zProviderFiscalInfoPayloadSchema = zod_1.z
101
112
  special_tax_regime: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(),
102
113
  service_list_item: zod_1.z.string().optional(),
103
114
  credentials_secret_refs: exports.zProviderCredentialsSecretRefsSchema.optional(),
115
+ credentials_input: exports.zProviderCredentialsInputSchema.optional(),
104
116
  extras: zod_1.z.record(zod_1.z.unknown()).optional(),
105
117
  })
106
118
  .passthrough();
@@ -172,6 +184,23 @@ exports.zAsaasAccountScopeSchema = zod_1.z
172
184
  mode: exports.zAsaasAccountScopeModeSchema,
173
185
  asaas_account_id: zod_1.z.string().optional(),
174
186
  owner_asaas_account_id: zod_1.z.string().optional(),
187
+ wallet_id: zod_1.z.string().optional(),
188
+ })
189
+ .passthrough();
190
+ exports.zAsaasSubaccountInputSchema = zod_1.z
191
+ .object({
192
+ name: zod_1.z.string().optional(),
193
+ email: zod_1.z.string().optional(),
194
+ cpfCnpj: zod_1.z.string().optional(),
195
+ birthDate: zod_1.z.string().optional(),
196
+ companyType: zod_1.z.string().optional(),
197
+ phone: zod_1.z.string().optional(),
198
+ mobilePhone: zod_1.z.string().optional(),
199
+ address: zod_1.z.string().optional(),
200
+ addressNumber: zod_1.z.string().optional(),
201
+ complement: zod_1.z.string().optional(),
202
+ province: zod_1.z.string().optional(),
203
+ postalCode: zod_1.z.string().optional(),
175
204
  })
176
205
  .passthrough();
177
206
  exports.zAsaasEnvAuthConfigSchema = zod_1.z
@@ -183,6 +212,7 @@ exports.zAsaasEnvAuthConfigSchema = zod_1.z
183
212
  retry_policy: exports.zRetryPolicySchema.optional(),
184
213
  webhook: exports.zAsaasWebhookConfigSchema.optional(),
185
214
  account_scope: exports.zAsaasAccountScopeSchema.optional(),
215
+ subaccount_input: exports.zAsaasSubaccountInputSchema.optional(),
186
216
  operational: zod_1.z
187
217
  .object({
188
218
  rate_limit_max_per_minute: zod_1.z.number().optional(),
@@ -277,15 +307,15 @@ exports.zIssuerNfseConfigSchema = zod_1.z
277
307
  .passthrough();
278
308
  exports.zIssuerTaxProfileSchema = zod_schemas_1.zFireDocSchema
279
309
  .extend({
280
- company: exports.zIssuerCompanyIdentitySchema,
281
- nfse: exports.zIssuerNfseConfigSchema,
310
+ company: exports.zIssuerCompanyIdentitySchema.optional(),
311
+ nfse: exports.zIssuerNfseConfigSchema.optional(),
282
312
  provider_id: zod_1.z.string(),
283
313
  provider_env: exports.zProviderEnvSchema,
284
- provider_municipal_options_snapshot: exports.zProviderMunicipalOptionsSnapshotSchema,
285
- provider_fiscal_info: exports.zProviderFiscalInfoPayloadSchema,
286
- provider_credentials_secret_refs: exports.zProviderCredentialsSecretRefsSchema,
287
- provider_remote_refs: exports.zProviderRemoteRefsSchema,
288
- sync_state: exports.zTaxProfileSyncStateSchema,
314
+ provider_municipal_options_snapshot: exports.zProviderMunicipalOptionsSnapshotSchema.optional(),
315
+ provider_fiscal_info: exports.zProviderFiscalInfoPayloadSchema.optional(),
316
+ provider_credentials_secret_refs: exports.zProviderCredentialsSecretRefsSchema.optional(),
317
+ provider_remote_refs: exports.zProviderRemoteRefsSchema.optional(),
318
+ sync_state: exports.zTaxProfileSyncStateSchema.optional(),
289
319
  last_sync_at: zod_1.z.string().optional(),
290
320
  last_sync_error: zod_1.z
291
321
  .object({
@@ -92,6 +92,17 @@ export const zProviderCredentialsSecretRefsSchema = z
92
92
  })
93
93
  .passthrough();
94
94
 
95
+ export const zProviderCredentialsInputSchema = z
96
+ .object({
97
+ username: z.string().optional(),
98
+ password: z.string().optional(),
99
+ access_token: z.string().optional(),
100
+ digital_certificate_base64: z.string().optional(),
101
+ digital_certificate: z.string().optional(),
102
+ certificate_password: z.string().optional(),
103
+ })
104
+ .passthrough();
105
+
95
106
  export const zProviderFiscalInfoPayloadSchema = z
96
107
  .object({
97
108
  email: z.string().optional(),
@@ -105,6 +116,7 @@ export const zProviderFiscalInfoPayloadSchema = z
105
116
  special_tax_regime: z.union([z.string(), z.number()]).optional(),
106
117
  service_list_item: z.string().optional(),
107
118
  credentials_secret_refs: zProviderCredentialsSecretRefsSchema.optional(),
119
+ credentials_input: zProviderCredentialsInputSchema.optional(),
108
120
  extras: z.record(z.unknown()).optional(),
109
121
  })
110
122
  .passthrough();
@@ -182,6 +194,24 @@ export const zAsaasAccountScopeSchema = z
182
194
  mode: zAsaasAccountScopeModeSchema,
183
195
  asaas_account_id: z.string().optional(),
184
196
  owner_asaas_account_id: z.string().optional(),
197
+ wallet_id: z.string().optional(),
198
+ })
199
+ .passthrough();
200
+
201
+ export const zAsaasSubaccountInputSchema = z
202
+ .object({
203
+ name: z.string().optional(),
204
+ email: z.string().optional(),
205
+ cpfCnpj: z.string().optional(),
206
+ birthDate: z.string().optional(),
207
+ companyType: z.string().optional(),
208
+ phone: z.string().optional(),
209
+ mobilePhone: z.string().optional(),
210
+ address: z.string().optional(),
211
+ addressNumber: z.string().optional(),
212
+ complement: z.string().optional(),
213
+ province: z.string().optional(),
214
+ postalCode: z.string().optional(),
185
215
  })
186
216
  .passthrough();
187
217
 
@@ -194,6 +224,7 @@ export const zAsaasEnvAuthConfigSchema = z
194
224
  retry_policy: zRetryPolicySchema.optional(),
195
225
  webhook: zAsaasWebhookConfigSchema.optional(),
196
226
  account_scope: zAsaasAccountScopeSchema.optional(),
227
+ subaccount_input: zAsaasSubaccountInputSchema.optional(),
197
228
  operational: z
198
229
  .object({
199
230
  rate_limit_max_per_minute: z.number().optional(),
@@ -300,15 +331,15 @@ export const zIssuerNfseConfigSchema = z
300
331
 
301
332
  export const zIssuerTaxProfileSchema = zFireDocSchema
302
333
  .extend({
303
- company: zIssuerCompanyIdentitySchema,
304
- nfse: zIssuerNfseConfigSchema,
334
+ company: zIssuerCompanyIdentitySchema.optional(),
335
+ nfse: zIssuerNfseConfigSchema.optional(),
305
336
  provider_id: z.string(),
306
337
  provider_env: zProviderEnvSchema,
307
- provider_municipal_options_snapshot: zProviderMunicipalOptionsSnapshotSchema,
308
- provider_fiscal_info: zProviderFiscalInfoPayloadSchema,
309
- provider_credentials_secret_refs: zProviderCredentialsSecretRefsSchema,
310
- provider_remote_refs: zProviderRemoteRefsSchema,
311
- sync_state: zTaxProfileSyncStateSchema,
338
+ provider_municipal_options_snapshot: zProviderMunicipalOptionsSnapshotSchema.optional(),
339
+ provider_fiscal_info: zProviderFiscalInfoPayloadSchema.optional(),
340
+ provider_credentials_secret_refs: zProviderCredentialsSecretRefsSchema.optional(),
341
+ provider_remote_refs: zProviderRemoteRefsSchema.optional(),
342
+ sync_state: zTaxProfileSyncStateSchema.optional(),
312
343
  last_sync_at: z.string().optional(),
313
344
  last_sync_error: z
314
345
  .object({
@@ -55,15 +55,15 @@ export interface IIssuerNfseConfig {
55
55
  municipal_extras?: Record<string, unknown>;
56
56
  }
57
57
  export interface IIssuerTaxProfile extends IFireDoc {
58
- company: IIssuerCompanyIdentity;
59
- nfse: IIssuerNfseConfig;
60
58
  provider_id: string;
61
59
  provider_env: ProviderEnv;
62
- provider_municipal_options_snapshot: IProviderMunicipalOptionsSnapshot;
63
- provider_fiscal_info: IProviderFiscalInfoPayload;
64
- provider_credentials_secret_refs: IProviderCredentialsSecretRefs;
65
- provider_remote_refs: IProviderRemoteRefs;
66
- sync_state: TaxProfileSyncState;
60
+ provider_remote_refs?: IProviderRemoteRefs;
61
+ company?: IIssuerCompanyIdentity;
62
+ nfse?: IIssuerNfseConfig;
63
+ provider_municipal_options_snapshot?: IProviderMunicipalOptionsSnapshot;
64
+ provider_fiscal_info?: IProviderFiscalInfoPayload;
65
+ provider_credentials_secret_refs?: IProviderCredentialsSecretRefs;
66
+ sync_state?: TaxProfileSyncState;
67
67
  last_sync_at?: string;
68
68
  last_sync_error?: {
69
69
  message: string;
@@ -81,19 +81,21 @@ export interface IIssuerNfseConfig {
81
81
  }
82
82
 
83
83
  export interface IIssuerTaxProfile extends IFireDoc {
84
- company: IIssuerCompanyIdentity;
85
- nfse: IIssuerNfseConfig;
86
-
87
84
  provider_id: string;
88
85
  provider_env: ProviderEnv; //Sandbox or Production
89
86
 
90
- provider_municipal_options_snapshot: IProviderMunicipalOptionsSnapshot; //resultado do municipalOptions
91
- provider_fiscal_info: IProviderFiscalInfoPayload; //payload que você manda para fiscalInfo
92
- provider_credentials_secret_refs: IProviderCredentialsSecretRefs; //nada em plaintext
93
- provider_remote_refs: IProviderRemoteRefs; //last sync etc
87
+ // Dados mínimos persistidos localmente
88
+ provider_remote_refs?: IProviderRemoteRefs; //last sync etc
89
+
90
+ // Campos abaixo são opcionais e não devem ser espelhados do provider
91
+ company?: IIssuerCompanyIdentity;
92
+ nfse?: IIssuerNfseConfig;
93
+ provider_municipal_options_snapshot?: IProviderMunicipalOptionsSnapshot; //resultado do municipalOptions
94
+ provider_fiscal_info?: IProviderFiscalInfoPayload; //payload que você manda para fiscalInfo
95
+ provider_credentials_secret_refs?: IProviderCredentialsSecretRefs; //nada em plaintext
94
96
 
95
97
  // Sync state with Provider API
96
- sync_state: TaxProfileSyncState;
98
+ sync_state?: TaxProfileSyncState;
97
99
  last_sync_at?: string;
98
100
  last_sync_error?: {
99
101
  message: string;
@@ -42,6 +42,22 @@ export interface IAsaasAccountScope {
42
42
  mode: AsaasAccountScopeMode;
43
43
  asaas_account_id?: string;
44
44
  owner_asaas_account_id?: string;
45
+ wallet_id?: string;
46
+ }
47
+ export interface IAsaasSubaccountInput {
48
+ name?: string;
49
+ email?: string;
50
+ cpfCnpj?: string;
51
+ birthDate?: string;
52
+ companyType?: string;
53
+ phone?: string;
54
+ mobilePhone?: string;
55
+ address?: string;
56
+ addressNumber?: string;
57
+ complement?: string;
58
+ province?: string;
59
+ postalCode?: string;
60
+ [key: string]: unknown;
45
61
  }
46
62
  export interface IAsaasEnvAuthConfig {
47
63
  enabled: boolean;
@@ -51,6 +67,7 @@ export interface IAsaasEnvAuthConfig {
51
67
  retry_policy?: IRetryPolicy;
52
68
  webhook?: IAsaasWebhookConfig;
53
69
  account_scope?: IAsaasAccountScope;
70
+ subaccount_input?: IAsaasSubaccountInput;
54
71
  operational?: {
55
72
  rate_limit_max_per_minute?: number;
56
73
  };
@@ -67,6 +67,25 @@ export interface IAsaasAccountScope {
67
67
 
68
68
  // If you ever need to track which master owns a subaccount.
69
69
  owner_asaas_account_id?: string;
70
+
71
+ // Useful for split operations in the future.
72
+ wallet_id?: string;
73
+ }
74
+
75
+ export interface IAsaasSubaccountInput {
76
+ name?: string;
77
+ email?: string;
78
+ cpfCnpj?: string;
79
+ birthDate?: string;
80
+ companyType?: string;
81
+ phone?: string;
82
+ mobilePhone?: string;
83
+ address?: string;
84
+ addressNumber?: string;
85
+ complement?: string;
86
+ province?: string;
87
+ postalCode?: string;
88
+ [key: string]: unknown;
70
89
  }
71
90
 
72
91
  export interface IAsaasEnvAuthConfig {
@@ -86,6 +105,9 @@ export interface IAsaasEnvAuthConfig {
86
105
  // Account context for this environment (master/subaccount)
87
106
  account_scope?: IAsaasAccountScope;
88
107
 
108
+ // Input data used only when creating subaccounts (not persisted).
109
+ subaccount_input?: IAsaasSubaccountInput;
110
+
89
111
  // Operational knobs
90
112
  operational?: {
91
113
  rate_limit_max_per_minute?: number;
@@ -61,6 +61,19 @@ export interface IProviderCredentialsSecretRefs {
61
61
  certificate_password_secret_ref?: string;
62
62
  [key: string]: unknown;
63
63
  }
64
+ /**
65
+ Plaintext credentials used only for onboarding.
66
+ Backend must convert these to Secret Manager refs before persisting.
67
+ */
68
+ export interface IProviderCredentialsInput {
69
+ username?: string;
70
+ password?: string;
71
+ access_token?: string;
72
+ digital_certificate_base64?: string;
73
+ digital_certificate?: string;
74
+ certificate_password?: string;
75
+ [key: string]: unknown;
76
+ }
64
77
  /**
65
78
  Generic payload your system sends to the provider to configure issuer fiscal info.
66
79
  This intentionally mirrors common NFSe “issuer setup” fields:
@@ -82,6 +95,7 @@ export interface IProviderFiscalInfoPayload {
82
95
  special_tax_regime?: string | number;
83
96
  service_list_item?: string;
84
97
  credentials_secret_refs?: IProviderCredentialsSecretRefs;
98
+ credentials_input?: IProviderCredentialsInput;
85
99
  extras?: Record<string, unknown>;
86
100
  }
87
101
  /**
@@ -87,6 +87,20 @@ export interface IProviderCredentialsSecretRefs {
87
87
  [key: string]: unknown; // index signature
88
88
  }
89
89
 
90
+ /**
91
+ Plaintext credentials used only for onboarding.
92
+ Backend must convert these to Secret Manager refs before persisting.
93
+ */
94
+ export interface IProviderCredentialsInput {
95
+ username?: string;
96
+ password?: string;
97
+ access_token?: string;
98
+ digital_certificate_base64?: string;
99
+ digital_certificate?: string;
100
+ certificate_password?: string;
101
+ [key: string]: unknown; // index signature
102
+ }
103
+
90
104
  /**
91
105
  Generic payload your system sends to the provider to configure issuer fiscal info.
92
106
  This intentionally mirrors common NFSe “issuer setup” fields:
@@ -122,6 +136,9 @@ export interface IProviderFiscalInfoPayload {
122
136
  // Credentials references (never plaintext)
123
137
  credentials_secret_refs?: IProviderCredentialsSecretRefs;
124
138
 
139
+ // Plaintext credentials input (converted to Secret Manager refs in backend)
140
+ credentials_input?: IProviderCredentialsInput;
141
+
125
142
  // Any municipality/provider-specific fields
126
143
  extras?: Record<string, unknown>;
127
144
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evo360-types",
3
- "version": "1.3.200",
3
+ "version": "1.3.204",
4
4
  "description": "HREVO360 Shared Types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",