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
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 3.0.0-stage.2 (2026-01-09)

* feat: improve cache policy in presets and config (#346) ([79d3541](https://github.com/aziontech/lib/commit/79d3541)), closes [#346](https://github.com/aziontech/lib/issues/346)

## 3.0.0-stage.1 (2026-01-08)

* fix: rename edge_access to workloads_access (#345) ([f9f5bd9](https://github.com/aziontech/lib/commit/f9f5bd9)), closes [#345](https://github.com/aziontech/lib/issues/345)


### BREAKING CHANGE

* rename edge_access to workloads_access in the storage package.

## <small>2.3.3 (2026-01-07)</small>

* Merge pull request #344 from aziontech/stage ([2556f52](https://github.com/aziontech/lib/commit/2556f52)), closes [#344](https://github.com/aziontech/lib/issues/344)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const client: StorageClient = createClient({ token: 'your-api-token', debug: tru

const { data, error }: AzionStorageResponse<AzionBucket> = await client.createBucket({
name: 'my-new-bucket',
edge_access: 'public',
workloads_access: 'read_only',
});

if (data) {
Expand Down Expand Up @@ -120,7 +120,7 @@ import { createClient } from 'azion';
const client = createClient({ token: 'your-api-token', debug: true });

// Storage
const { data: newBucket, error } = await client.storage.createBucket({ name: 'my-new-bucket', edge_access: 'public' });
const { data: newBucket, error } = await client.storage.createBucket({ name: 'my-new-bucket', workloads_access: 'read_only' });
console.log(`Bucket created with name: ${newBucket.name}`);

const { data: allBuckets, error } = await client.storage.getBuckets();
Expand Down Expand Up @@ -152,7 +152,7 @@ const client: AzionClient = createClient({ token: 'your-api-token', debug: true
// Storage
const { data: newBucket, error }: AzionStorageResponse<AzionBucket> = await client.createBucket({
name: 'my-new-bucket',
edge_access: 'public',
workloads_access: 'read_only',
});
console.log(`Bucket created with name: ${newBucket.name}`);

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.3.3",
"version": "3.0.0-stage.2",
"description": "Azion Packages for Edge Computing.",
"scripts": {
"prepare": "husky",
Expand Down
4 changes: 2 additions & 2 deletions packages/client/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ import { createClient } from 'azion';

const client = createClient({ token: 'your-api-token', debug: true });

const { data: newBucket } = await client.storage.createBucket('my-new-bucket', 'public');
const { data: newBucket } = await client.storage.createBucket('my-new-bucket', 'read_only');
if (newBucket) {
console.log(`Bucket created with name: ${newBucket.name}`);
}
Expand Down Expand Up @@ -102,7 +102,7 @@ const client: AzionClient = createClient({ token: 'your-api-token', debug: true

const { data: newBucket }: AzionStorageResponse<AzionBucket> = await client.storage.createBucket(
'my-new-bucket',
'public',
'read_only',
);
if (newBucket) {
console.log(`Bucket created with name: ${newBucket.name}`);
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface AzionClient {
*
* @example
* // Create a new bucket
* const newBucket = await client.storage.createBucket({ name: 'my-new-bucket', edge_access: 'public' });
* const newBucket = await client.storage.createBucket({ name: 'my-new-bucket', workloads_access: 'read_only' });
*
* @example
* // Get all buckets
Expand Down
4 changes: 2 additions & 2 deletions packages/config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ const config = defineConfig({
storage: [
{
name: 'my-storage',
edgeAccess: 'read_write',
workloadsAccess: 'read_write',
dir: './storage',
prefix: '1236677364374',
},
Expand Down Expand Up @@ -699,7 +699,7 @@ Type definition for storage configuration.

- `name: string` - Name of the storage (6-63 characters).
- `dir: string` - Local directory path.
- `edgeAccess?: 'read_only' | 'read_write' | 'restricted'` - access permissions.
- `workloadsAccess?: 'read_only' | 'read_write' | 'restricted'` - access permissions.
- `prefix: string` - Storage prefix.

### `AzionCache`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ describe('convertJsonConfigToObject', () => {
// {
// name: 'my-storage',
// dir: './public',
// edgeAccess: 'read_only',
// workloadsAccess: 'read_only',
// },
// ],
// };
Expand All @@ -301,7 +301,7 @@ describe('convertJsonConfigToObject', () => {
// expect.objectContaining({
// name: 'my-storage',
// dir: './public',
// edgeAccess: 'read_only',
// workloadsAccess: 'read_only',
// }),
// ]),
// );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import type {
AzionConfig,
AzionConnector,
CacheByCookie,
CacheByQueryString,
ConnectorDnsResolution,
ConnectorHttpVersionPolicy,
ConnectorTransportPolicy,
ConnectorType,
CustomPageErrorCode,
CustomPageType,
NetworkListType,
WafSensitivity,
WafThreatType,
WorkloadInfrastructure,
WorkloadMTLSVerification,
WorkloadTLSCipher,
WorkloadTLSVersion,
AzionConfig,
AzionConnector,
CacheByCookie,
CacheByQueryString,
ConnectorDnsResolution,
ConnectorHttpVersionPolicy,
ConnectorTransportPolicy,
ConnectorType,
CustomPageErrorCode,
CustomPageType,
NetworkListType,
WafSensitivity,
WafThreatType,
WorkloadInfrastructure,
WorkloadMTLSVerification,
WorkloadTLSCipher,
WorkloadTLSVersion,
} from 'azion/config';

const config: AzionConfig = {
Expand Down Expand Up @@ -411,7 +411,7 @@ const config: AzionConfig = {
storage: [
{
name: 'my-storage',
edgeAccess: 'read_write', // 'read_only' | 'read_write' | 'restricted'
workloadsAccess: 'read_write', // 'read_only' | 'read_write' | 'restricted'
dir: './storage',
prefix: '1236677364374',
},
Expand Down
17 changes: 8 additions & 9 deletions packages/config/src/configProcessor/helpers/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
COOKIE_BEHAVIORS,
CUSTOM_PAGE_ERROR_CODES,
CUSTOM_PAGE_TYPES,
EDGE_ACCESS_TYPES,
EDGE_CONNECTOR_DNS_RESOLUTION,
EDGE_CONNECTOR_HMAC_TYPE,
EDGE_CONNECTOR_HTTP_VERSION_POLICY,
Expand All @@ -28,6 +27,7 @@ import {
WORKLOAD_HTTP_VERSIONS,
WORKLOAD_MTLS_VERIFICATION,
WORKLOAD_TLS_VERSIONS,
WORKLOADS_ACCESS_TYPES,
} from '../../constants';

const createCriteriaBaseSchema = (isRequestPhase = false) => ({
Expand Down Expand Up @@ -447,10 +447,10 @@ const schemaStorage = {
type: 'string',
errorMessage: "The 'dir' field must be a string.",
},
edgeAccess: {
workloadsAccess: {
type: 'string',
enum: EDGE_ACCESS_TYPES,
errorMessage: "The 'edge_access' field must be one of: read_only, read_write, restricted.",
enum: WORKLOADS_ACCESS_TYPES,
errorMessage: "The 'workloads_access' field must be one of: read_only, read_write, restricted.",
},
prefix: {
type: 'string',
Expand Down Expand Up @@ -609,8 +609,7 @@ const azionConfigSchema = {
type: 'string',
minLength: 1,
maxLength: 250,
pattern: "^[a-zA-Z0-9 \\-.',|]+$",
errorMessage: "The 'name' field must be a string between 1-250 characters with valid pattern.",
errorMessage: "The 'name' field must be a string with 1 to 250 characters",
},
stale: {
type: 'boolean',
Expand Down Expand Up @@ -638,13 +637,13 @@ const azionConfigSchema = {
},
required: ['enabled'],
if: {
properties: { enabled: { const: true } }
properties: { enabled: { const: true } },
},
then: {
required: ['enabled', 'topology'],
errorMessage: {
required: "When 'enabled' is true, 'topology' is required in the 'tiered_cache' object."
}
required: "When 'enabled' is true, 'topology' is required in the 'tiered_cache' object.",
},
},
additionalProperties: false,
errorMessage: {
Expand Down
84 changes: 42 additions & 42 deletions packages/config/src/configProcessor/helpers/schemaManifest.ts
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
import {
APPLICATION_DELIVERY_PROTOCOLS,
APPLICATION_HTTP_PORTS,
APPLICATION_HTTPS_PORTS,
APPLICATION_SUPPORTED_CIPHERS,
APPLICATION_TLS_VERSIONS,
CACHE_ADAPTIVE_DELIVERY,
CACHE_BROWSER_SETTINGS,
CACHE_BY_COOKIE,
CACHE_BY_QUERY_STRING,
CACHE_CDN_SETTINGS,
CACHE_VARY_BY_METHOD,
COOKIE_BEHAVIORS,
CUSTOM_PAGE_ERROR_CODES,
EDGE_CONNECTOR_DNS_RESOLUTION,
EDGE_CONNECTOR_HMAC_TYPE,
EDGE_CONNECTOR_HTTP_VERSION_POLICY,
EDGE_CONNECTOR_LOAD_BALANCE_METHOD,
EDGE_CONNECTOR_TRANSPORT_POLICY,
EDGE_CONNECTOR_TYPES,
FIREWALL_BEHAVIOR_NAMES,
FIREWALL_RATE_LIMIT_BY,
FIREWALL_RATE_LIMIT_TYPES,
FIREWALL_RULE_CONDITIONALS,
FIREWALL_RULE_OPERATORS,
FIREWALL_VARIABLES,
FIREWALL_WAF_MODES,
HEADER_BEHAVIORS,
ID_BEHAVIORS,
NETWORK_LIST_TYPES,
NO_ARGS_BEHAVIORS,
RULE_CONDITIONALS,
RULE_OPERATORS_WITH_VALUE,
RULE_OPERATORS_WITHOUT_VALUE,
RULE_VARIABLES,
STRING_BEHAVIORS,
TIERED_CACHE_TOPOLOGY,
WAF_ENGINE_VERSIONS,
WORKLOAD_HTTP_VERSIONS,
WORKLOAD_MTLS_VERIFICATION,
WORKLOAD_TLS_VERSIONS,
APPLICATION_DELIVERY_PROTOCOLS,
APPLICATION_HTTP_PORTS,
APPLICATION_HTTPS_PORTS,
APPLICATION_SUPPORTED_CIPHERS,
APPLICATION_TLS_VERSIONS,
CACHE_ADAPTIVE_DELIVERY,
CACHE_BROWSER_SETTINGS,
CACHE_BY_COOKIE,
CACHE_BY_QUERY_STRING,
CACHE_CDN_SETTINGS,
CACHE_VARY_BY_METHOD,
COOKIE_BEHAVIORS,
CUSTOM_PAGE_ERROR_CODES,
EDGE_CONNECTOR_DNS_RESOLUTION,
EDGE_CONNECTOR_HMAC_TYPE,
EDGE_CONNECTOR_HTTP_VERSION_POLICY,
EDGE_CONNECTOR_LOAD_BALANCE_METHOD,
EDGE_CONNECTOR_TRANSPORT_POLICY,
EDGE_CONNECTOR_TYPES,
FIREWALL_BEHAVIOR_NAMES,
FIREWALL_RATE_LIMIT_BY,
FIREWALL_RATE_LIMIT_TYPES,
FIREWALL_RULE_CONDITIONALS,
FIREWALL_RULE_OPERATORS,
FIREWALL_VARIABLES,
FIREWALL_WAF_MODES,
HEADER_BEHAVIORS,
ID_BEHAVIORS,
NETWORK_LIST_TYPES,
NO_ARGS_BEHAVIORS,
RULE_CONDITIONALS,
RULE_OPERATORS_WITH_VALUE,
RULE_OPERATORS_WITHOUT_VALUE,
RULE_VARIABLES,
STRING_BEHAVIORS,
TIERED_CACHE_TOPOLOGY,
WAF_ENGINE_VERSIONS,
WORKLOAD_HTTP_VERSIONS,
WORKLOAD_MTLS_VERIFICATION,
WORKLOAD_TLS_VERSIONS,
} from '../../constants';

const schemaNetworkListManifest = {
Expand Down Expand Up @@ -239,10 +239,10 @@ const schemaStorageManifest = {
type: 'string',
errorMessage: "The 'dir' field must be a string.",
},
edge_access: {
workloads_access: {
type: 'string',
enum: ['read_only', 'read_write', 'restricted'],
errorMessage: "The 'edge_access' field must be one of: read_only, read_write, restricted.",
errorMessage: "The 'workloads_access' field must be one of: read_only, read_write, restricted.",
},
prefix: {
type: 'string',
Expand Down
Loading