evo360-types 1.3.198 → 1.3.202

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,6 @@
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.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.zProviderCredentialsInputSchema = exports.zProviderCredentialsSecretRefsSchema = exports.zProviderMunicipalOptionsSnapshotSchema = exports.zProviderOptionItemSchema = exports.zProviderMunicipalAuthTypeSchema = exports.zFinopsProviderBaseSchema = exports.zProviderStatusSchema = exports.zFinopsActionSchema = exports.zFinopsProviderTypeSchema = exports.zProviderEnvSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const zod_schemas_1 = require("../shared/zod-schemas");
6
6
  // ---- Provider enums and base ----
@@ -88,6 +88,16 @@ exports.zProviderCredentialsSecretRefsSchema = zod_1.z
88
88
  certificate_password_secret_ref: zod_1.z.string().optional(),
89
89
  })
90
90
  .passthrough();
91
+ exports.zProviderCredentialsInputSchema = zod_1.z
92
+ .object({
93
+ username: zod_1.z.string().optional(),
94
+ password: zod_1.z.string().optional(),
95
+ access_token: zod_1.z.string().optional(),
96
+ digital_certificate_base64: zod_1.z.string().optional(),
97
+ digital_certificate: zod_1.z.string().optional(),
98
+ certificate_password: zod_1.z.string().optional(),
99
+ })
100
+ .passthrough();
91
101
  exports.zProviderFiscalInfoPayloadSchema = zod_1.z
92
102
  .object({
93
103
  email: zod_1.z.string().optional(),
@@ -101,6 +111,7 @@ exports.zProviderFiscalInfoPayloadSchema = zod_1.z
101
111
  special_tax_regime: zod_1.z.union([zod_1.z.string(), zod_1.z.number()]).optional(),
102
112
  service_list_item: zod_1.z.string().optional(),
103
113
  credentials_secret_refs: exports.zProviderCredentialsSecretRefsSchema.optional(),
114
+ credentials_input: exports.zProviderCredentialsInputSchema.optional(),
104
115
  extras: zod_1.z.record(zod_1.z.unknown()).optional(),
105
116
  })
106
117
  .passthrough();
@@ -154,6 +165,7 @@ exports.zAsaasWebhookConfigSchema = zod_1.z
154
165
  interrupted: zod_1.z.boolean().optional(),
155
166
  secret_ref: zod_1.z.string().optional(),
156
167
  secret_hash: zod_1.z.string().optional(),
168
+ token: zod_1.z.string().optional(),
157
169
  events: zod_1.z.array(exports.zAsaasWebhookEventSchema),
158
170
  remote_webhook_id: zod_1.z.string().optional(),
159
171
  last_sync_at: zod_1.z.string().optional(),
@@ -276,15 +288,15 @@ exports.zIssuerNfseConfigSchema = zod_1.z
276
288
  .passthrough();
277
289
  exports.zIssuerTaxProfileSchema = zod_schemas_1.zFireDocSchema
278
290
  .extend({
279
- company: exports.zIssuerCompanyIdentitySchema,
280
- nfse: exports.zIssuerNfseConfigSchema,
291
+ company: exports.zIssuerCompanyIdentitySchema.optional(),
292
+ nfse: exports.zIssuerNfseConfigSchema.optional(),
281
293
  provider_id: zod_1.z.string(),
282
294
  provider_env: exports.zProviderEnvSchema,
283
- provider_municipal_options_snapshot: exports.zProviderMunicipalOptionsSnapshotSchema,
284
- provider_fiscal_info: exports.zProviderFiscalInfoPayloadSchema,
285
- provider_credentials_secret_refs: exports.zProviderCredentialsSecretRefsSchema,
286
- provider_remote_refs: exports.zProviderRemoteRefsSchema,
287
- sync_state: exports.zTaxProfileSyncStateSchema,
295
+ provider_municipal_options_snapshot: exports.zProviderMunicipalOptionsSnapshotSchema.optional(),
296
+ provider_fiscal_info: exports.zProviderFiscalInfoPayloadSchema.optional(),
297
+ provider_credentials_secret_refs: exports.zProviderCredentialsSecretRefsSchema.optional(),
298
+ provider_remote_refs: exports.zProviderRemoteRefsSchema.optional(),
299
+ sync_state: exports.zTaxProfileSyncStateSchema.optional(),
288
300
  last_sync_at: zod_1.z.string().optional(),
289
301
  last_sync_error: zod_1.z
290
302
  .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();
@@ -163,6 +175,7 @@ export const zAsaasWebhookConfigSchema = z
163
175
  interrupted: z.boolean().optional(),
164
176
  secret_ref: z.string().optional(),
165
177
  secret_hash: z.string().optional(),
178
+ token: z.string().optional(),
166
179
  events: z.array(zAsaasWebhookEventSchema),
167
180
  remote_webhook_id: z.string().optional(),
168
181
  last_sync_at: z.string().optional(),
@@ -299,15 +312,15 @@ export const zIssuerNfseConfigSchema = z
299
312
 
300
313
  export const zIssuerTaxProfileSchema = zFireDocSchema
301
314
  .extend({
302
- company: zIssuerCompanyIdentitySchema,
303
- nfse: zIssuerNfseConfigSchema,
315
+ company: zIssuerCompanyIdentitySchema.optional(),
316
+ nfse: zIssuerNfseConfigSchema.optional(),
304
317
  provider_id: z.string(),
305
318
  provider_env: zProviderEnvSchema,
306
- provider_municipal_options_snapshot: zProviderMunicipalOptionsSnapshotSchema,
307
- provider_fiscal_info: zProviderFiscalInfoPayloadSchema,
308
- provider_credentials_secret_refs: zProviderCredentialsSecretRefsSchema,
309
- provider_remote_refs: zProviderRemoteRefsSchema,
310
- sync_state: zTaxProfileSyncStateSchema,
319
+ provider_municipal_options_snapshot: zProviderMunicipalOptionsSnapshotSchema.optional(),
320
+ provider_fiscal_info: zProviderFiscalInfoPayloadSchema.optional(),
321
+ provider_credentials_secret_refs: zProviderCredentialsSecretRefsSchema.optional(),
322
+ provider_remote_refs: zProviderRemoteRefsSchema.optional(),
323
+ sync_state: zTaxProfileSyncStateSchema.optional(),
311
324
  last_sync_at: z.string().optional(),
312
325
  last_sync_error: z
313
326
  .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;
@@ -28,6 +28,7 @@ export interface IAsaasWebhookConfig {
28
28
  interrupted?: boolean;
29
29
  secret_ref?: GoogleSecretRef;
30
30
  secret_hash?: string;
31
+ token?: string;
31
32
  events: AsaasWebhookEvent[];
32
33
  remote_webhook_id?: string;
33
34
  last_sync_at?: string;
@@ -41,6 +41,8 @@ export interface IAsaasWebhookConfig {
41
41
  secret_ref?: GoogleSecretRef;
42
42
  // Hash for quick lookup/validation (derived from token). Never plaintext.
43
43
  secret_hash?: string;
44
+ // Plaintext webhook token (used in header `asaas-access-token`).
45
+ token?: string;
44
46
 
45
47
  // Events you intend to subscribe / process.
46
48
  events: AsaasWebhookEvent[];
@@ -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.198",
3
+ "version": "1.3.202",
4
4
  "description": "HREVO360 Shared Types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",