Skip to content
Open
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
9 changes: 7 additions & 2 deletions src/Migration/Destinations/Appwrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,8 @@ public function importFileResource(Resource $resource): Resource
$resource->getAllowedFileExtensions(),
$compression,
$resource->getEncryption(),
$resource->getAntiVirus()
$resource->getAntiVirus(),
$resource->getTransformations()
);

$resource->setId($response['$id']);
Expand Down Expand Up @@ -1462,7 +1463,11 @@ public function importFunctionResource(Resource $resource): Resource
$resource->getSchedule(),
$resource->getTimeout(),
$resource->getEnabled(),
entrypoint: $resource->getEntrypoint(),
$resource->getLogging(),
$resource->getEntrypoint(),
$resource->getCommands(),
$resource->getScopes(),
specification: $resource->getSpecification() ?: null,
);
break;
case Resource::TYPE_ENVIRONMENT_VARIABLE:
Expand Down
43 changes: 41 additions & 2 deletions src/Migration/Resources/Functions/Func.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ class Func extends Resource
* @param int $timeout
* @param string $activeDeployment
* @param string $entrypoint
* @param string $commands
* @param bool $logging
* @param array<string> $scopes
* @param string $specification
*/
public function __construct(
string $id,
Expand All @@ -29,7 +33,11 @@ public function __construct(
private readonly string $schedule = '',
private readonly int $timeout = 0,
private readonly string $activeDeployment = '',
private readonly string $entrypoint = ''
private readonly string $entrypoint = '',
private readonly string $commands = '',
private readonly bool $logging = true,
private readonly array $scopes = [],
private readonly string $specification = ''
) {
$this->id = $id;
}
Expand All @@ -50,7 +58,11 @@ public static function fromArray(array $array): self
$array['schedule'] ?? '',
$array['timeout'] ?? 0,
$array['activeDeployment'] ?? '',
$array['entrypoint'] ?? ''
$array['entrypoint'] ?? '',
$array['commands'] ?? '',
$array['logging'] ?? true,
$array['scopes'] ?? [],
$array['specification'] ?? ''
);
}

Expand All @@ -70,6 +82,10 @@ public function jsonSerialize(): array
'timeout' => $this->timeout,
'activeDeployment' => $this->activeDeployment,
'entrypoint' => $this->entrypoint,
'commands' => $this->commands,
'logging' => $this->logging,
'scopes' => $this->scopes,
'specification' => $this->specification,
];
}

Expand Down Expand Up @@ -133,4 +149,27 @@ public function getEntrypoint(): string
{
return $this->entrypoint;
}

public function getCommands(): string
{
return $this->commands;
}

public function getLogging(): bool
{
return $this->logging;
}

/**
* @return array<string>
*/
public function getScopes(): array
{
return $this->scopes;
}

public function getSpecification(): string
{
return $this->specification;
}
}
11 changes: 10 additions & 1 deletion src/Migration/Resources/Storage/Bucket.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Bucket extends Resource
* @param bool $encryption
* @param bool $antiVirus
* @param bool $updateLimits
* @param bool $transformations
*/
public function __construct(
string $id = '',
Expand All @@ -32,6 +33,7 @@ public function __construct(
private readonly bool $encryption = false,
private readonly bool $antiVirus = false,
private readonly bool $updateLimits = false,
private readonly bool $transformations = false,
) {
$this->id = $id;
$this->permissions = $permissions;
Expand All @@ -54,7 +56,8 @@ public static function fromArray(array $array): self
$array['compression'] ?? 'none',
$array['encryption'] ?? false,
$array['antiVirus'] ?? false,
$array['updateLimits'] ?? false
$array['updateLimits'] ?? false,
$array['transformations'] ?? false
);
}

Expand All @@ -74,6 +77,7 @@ public function jsonSerialize(): array
'encryption' => $this->encryption,
'antiVirus' => $this->antiVirus,
'updateLimits' => $this->updateLimits,
'transformations' => $this->transformations,
];
}

Expand Down Expand Up @@ -131,4 +135,9 @@ public function getAntiVirus(): bool
{
return $this->antiVirus;
}

public function getTransformations(): bool
{
return $this->transformations;
}
}
8 changes: 7 additions & 1 deletion src/Migration/Sources/Appwrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,8 @@ private function exportBuckets(int $batchSize): void
$bucket['compression'],
$bucket['encryption'],
$bucket['antivirus'],
false,
$bucket['transformations'] ?? false,
);
$convertedBuckets[] = $bucket;
}
Expand Down Expand Up @@ -1462,7 +1464,11 @@ private function exportFunctions(int $batchSize): void
$function['schedule'],
$function['timeout'],
$function['deploymentId'] ?? '',
$function['entrypoint']
$function['entrypoint'],
$function['commands'] ?? '',
$function['logging'] ?? true,
$function['scopes'] ?? [],
$function['specification'] ?? '',
);
$functions[] = $convertedFunc;

Expand Down
Loading