Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
### [2.2.1-stage.2](https://github.com/aziontech/lib/compare/v2.2.1-stage.1...v2.2.1-stage.2) (2025-10-21)


### Bug Fixes

* update tiered cache topologies (#297) ([b50d71e](https://github.com/aziontech/lib/commit/b50d71e4cc0ea8909c0e7302aca9c11447a4b7c2))

### [2.2.1-stage.1](https://github.com/aziontech/lib/compare/v2.2.0...v2.2.1-stage.1) (2025-10-17)


### Bug Fixes

* update DNS resolution schema with api (#295) ([95f51e4](https://github.com/aziontech/lib/commit/95f51e4924c09730c587b13f6f026c089067a4e3))

## [2.2.0](https://github.com/aziontech/lib/compare/v2.1.4...v2.2.0) (2025-10-15)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "azion",
"version": "2.2.0",
"version": "2.2.1-stage.2",
"description": "Azion Packages for Edge Computing.",
"scripts": {
"prepare": "husky",
Expand Down
2 changes: 1 addition & 1 deletion packages/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ const config = defineConfig({
},
],
connectionOptions: {
dnsResolution: 'preserve',
dnsResolution: 'both',
transportPolicy: 'preserve',
httpVersionPolicy: 'http1_1',
host: '${host}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ describe('convertJsonConfigToObject', () => {
// },
// ],
// connectionOptions: {
// dnsResolution: 'preserve',
// dnsResolution: 'both',
// transportPolicy: 'preserve',
// httpVersionPolicy: 'http1_1',
// host: '${host}',
Expand Down Expand Up @@ -257,7 +257,7 @@ describe('convertJsonConfigToObject', () => {
// }),
// ]),
// connectionOptions: expect.objectContaining({
// dnsResolution: 'preserve',
// dnsResolution: 'both',
// transportPolicy: 'preserve',
// httpVersionPolicy: 'http1_1',
// host: '${host}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const config: AzionConfig = {
},
tieredCache: {
enabled: true,
topology: 'global',
topology: 'nearest-region',
},
cacheByQueryString: {
option: 'denylist' as CacheByQueryString,
Expand Down Expand Up @@ -359,7 +359,7 @@ const config: AzionConfig = {
},
],
connectionOptions: {
dnsResolution: 'preserve' as ConnectorDnsResolution,
dnsResolution: 'both' as ConnectorDnsResolution,
transportPolicy: 'preserve' as ConnectorTransportPolicy,
httpVersionPolicy: 'http1_1' as ConnectorHttpVersionPolicy,
host: '${host}',
Expand Down
10 changes: 5 additions & 5 deletions packages/config/src/configProcessor/helpers/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -630,10 +630,10 @@ const azionConfigSchema = {
},
topology: {
type: 'string',
enum: ['near-edge', 'br-east-1', 'us-east-1', 'global'],
default: 'global',
enum: ['nearest-region', 'us-east-1', 'br-east-1'],
default: 'nearest-region',
errorMessage:
"The 'topology' field must be one of 'near-edge', 'br-east-1', 'us-east-1', or 'global'.",
"The 'topology' field must be one of 'nearest-region', 'br-east-1', 'us-east-1'.",
},
},
additionalProperties: false,
Expand Down Expand Up @@ -1581,8 +1581,8 @@ const azionConfigSchema = {
dnsResolution: {
type: 'string',
enum: EDGE_CONNECTOR_DNS_RESOLUTION,
default: 'preserve',
errorMessage: "The 'dnsResolution' must be one of: preserve, force_ipv4, force_ipv6",
default: 'both',
errorMessage: "The 'dnsResolution' must be one of: both, force_ipv4",
},
transportPolicy: {
type: 'string',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ const schemaApplicationCacheSettings = {
topology: {
type: 'string',
enum: TIERED_CACHE_TOPOLOGY,
errorMessage: "The 'topology' must be one of: near-, br-east-1, us-east-1.",
errorMessage: "The 'topology' must be one of: nearest-region, us-east-1, br-east-1.",
},
},
required: ['topology'],
Expand Down Expand Up @@ -1435,7 +1435,7 @@ const schemaConnectorManifest = {
type: 'string',
enum: EDGE_CONNECTOR_DNS_RESOLUTION,
default: 'preserve',
errorMessage: "The 'dns_resolution' must be one of: preserve, force_ipv4, force_ipv6",
errorMessage: "The 'dns_resolution' must be one of: both, force_ipv4",
},
transport_policy: {
type: 'string',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class CacheProcessConfigStrategy extends ProcessConfigStrategy {
},
tiered_cache: {
enabled: cache?.tieredCache?.enabled || false,
topology: cache?.tieredCache?.topology || 'global',
topology: cache?.tieredCache?.topology || 'nearest-region',
},
},
application_accelerator: {
Expand Down Expand Up @@ -121,7 +121,7 @@ class CacheProcessConfigStrategy extends ProcessConfigStrategy {
queryStringSort: cache.modules?.application_accelerator?.cache_vary_by_querystring?.sort_enabled || false,
tieredCache: {
enabled: cache.modules?.cache?.tiered_cache?.enabled || false,
topology: cache.modules?.cache?.tiered_cache?.topology || 'global',
topology: cache.modules?.cache?.tiered_cache?.topology || 'nearest-region',
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ describe('ConnectorProcessConfigStrategy', () => {
},
],
connection_options: {
dns_resolution: 'preserve',
dns_resolution: 'both',
transport_policy: 'preserve',
http_version_policy: 'http1_1',
host: '${host}',
Expand Down Expand Up @@ -256,7 +256,7 @@ describe('ConnectorProcessConfigStrategy', () => {
},
],
connectionOptions: {
dnsResolution: 'preserve',
dnsResolution: 'both',
transportPolicy: 'preserve',
},
},
Expand All @@ -282,7 +282,7 @@ describe('ConnectorProcessConfigStrategy', () => {
},
],
connection_options: {
dns_resolution: 'preserve',
dns_resolution: 'both',
transport_policy: 'preserve',
http_version_policy: 'http1_1',
host: '${host}',
Expand Down Expand Up @@ -417,7 +417,7 @@ describe('ConnectorProcessConfigStrategy', () => {
},
],
connection_options: {
dns_resolution: 'preserve',
dns_resolution: 'both',
transport_policy: 'preserve',
http_version_policy: 'http1_1',
host: '${host}',
Expand Down Expand Up @@ -453,7 +453,7 @@ describe('ConnectorProcessConfigStrategy', () => {
expect(httpAttributes.addresses[0].address).toBe('example.com');
expect(httpAttributes.addresses[0].httpPort).toBe(80);
expect(httpAttributes.addresses[0].httpsPort).toBe(443);
expect(httpAttributes.connectionOptions.dnsResolution).toBe('preserve');
expect(httpAttributes.connectionOptions.dnsResolution).toBe('both');
expect(transformedPayload.connectors).toEqual(result);
});

Expand Down Expand Up @@ -563,7 +563,7 @@ describe('ConnectorProcessConfigStrategy', () => {
},
],
connection_options: {
dns_resolution: 'preserve',
dns_resolution: 'both',
transport_policy: 'preserve',
http_version_policy: 'http1_1',
host: '${host}',
Expand Down Expand Up @@ -626,7 +626,7 @@ describe('ConnectorProcessConfigStrategy', () => {
},
],
connection_options: {
dns_resolution: 'preserve',
dns_resolution: 'both',
transport_policy: 'preserve',
http_version_policy: 'http1_1',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ConnectorProcessConfigStrategy extends ProcessConfigStrategy {
modules: addr.modules || null,
})),
connection_options: {
dns_resolution: connector.attributes.connectionOptions.dnsResolution ?? 'preserve',
dns_resolution: connector.attributes.connectionOptions.dnsResolution ?? 'both',
transport_policy: connector.attributes.connectionOptions.transportPolicy ?? 'preserve',
http_version_policy: connector.attributes.connectionOptions.httpVersionPolicy ?? 'http1_1',
host: connector.attributes.connectionOptions.host ?? '${host}',
Expand Down
4 changes: 2 additions & 2 deletions packages/config/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export const CACHE_BY_QUERY_STRING = ['ignore', 'all', 'allowlist', 'denylist']
export const CACHE_BY_COOKIE = ['ignore', 'all', 'allowlist', 'denylist'] as const;
export const CACHE_ADAPTIVE_DELIVERY = ['ignore', 'allowlist'] as const;
export const CACHE_VARY_BY_METHOD = ['options', 'post'] as const;
export const TIERED_CACHE_TOPOLOGY = ['near-edge', 'br-east-1', 'us-east-1'] as const;
export const TIERED_CACHE_TOPOLOGY = ['nearest-region', 'us-east-1', 'br-east-1'] as const;
export const CACHE_L2_REGION = [null, 'sa-brazil', 'na-united-states'] as const;

// Constantes para Build
Expand Down Expand Up @@ -297,7 +297,7 @@ export const WORKLOAD_HTTP_VERSIONS = ['http1', 'http2'] as const;

// Constantes para Connector V4
export const EDGE_CONNECTOR_TYPES = ['http', 'storage', 'live_ingest'] as const;
export const EDGE_CONNECTOR_DNS_RESOLUTION = ['preserve', 'force_ipv4', 'force_ipv6'] as const;
export const EDGE_CONNECTOR_DNS_RESOLUTION = ['both', 'force_ipv4'] as const;
export const EDGE_CONNECTOR_TRANSPORT_POLICY = ['preserve', 'force_https', 'force_http'] as const;
export const EDGE_CONNECTOR_HTTP_VERSION_POLICY = ['http1_1'] as const;
export const EDGE_CONNECTOR_LOAD_BALANCE_METHOD = ['round_robin', 'least_conn', 'ip_hash'] as const;
Expand Down
4 changes: 2 additions & 2 deletions packages/config/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export type CacheByQueryString = 'ignore' | 'all' | 'allowlist' | 'denylist';
export type CacheByCookie = 'ignore' | 'all' | 'allowlist' | 'denylist';
export type CacheAdaptiveDelivery = 'ignore' | 'allowlist';
export type CacheVaryByMethod = 'options' | 'post';
export type TieredCacheTopology = 'global';
export type TieredCacheTopology = 'nearest-region' | 'br-east-1' | 'us-east-1';

// Build types
export type BuildBundler = 'webpack' | 'esbuild';
Expand All @@ -178,7 +178,7 @@ export type WorkloadHTTPVersion = 'http1' | 'http2';

// Connector types
export type ConnectorType = 'http' | 'storage' | 'live_ingest';
export type ConnectorDnsResolution = 'preserve' | 'force_ipv4' | 'force_ipv6';
export type ConnectorDnsResolution = 'both' | 'force_ipv4';
export type ConnectorTransportPolicy = 'preserve' | 'force_https' | 'force_http';
export type ConnectorHttpVersionPolicy = 'http1_1';
export type ConnectorLoadBalanceMethod = 'round_robin' | 'least_conn' | 'ip_hash';
Expand Down