Browse code

added appinfo/info.xml appinfo/signature.json appinfo/routes.php CHANGELOG.txt templates/navigation/index.php templates/settings.php css/style.css js/settings.js js/sendfax.js lib/Controller/AuthorApiController.php lib/Controller/PaxfaxController.php lib/Service/PaxfaxService.php img/pax_fax_received_fax.png img/pax_fax_send_uploaded_file_as_fax.png l10n/en_GB.js l10n/en_US.js l10n/en_GB.json l10n/en_US.json lib/Migration/Version119Date20250425082914.php

DoubleBastionAdmin authored on 25/04/2025 06:06:16
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,140 @@
1
+<?php
2
+/**
3
+ * @copyright 2021 Double Bastion LLC <www.doublebastion.com>
4
+ *
5
+ * @author Double Bastion LLC
6
+ *
7
+ * @license GNU AGPL version 3 or any later version
8
+ *
9
+ * This program is free software; you can redistribute it and/or
10
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
11
+ * License as published by the Free Software Foundation; either
12
+ * version 3 of the License, or any later version.
13
+ *
14
+ * This program is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
18
+ *
19
+ * You should have received a copy of the GNU Affero General Public
20
+ * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
+ *
22
+ */
23
+
24
+declare(strict_types=1);
25
+
26
+namespace OCA\PaxFax\Migration;
27
+
28
+use Closure;
29
+use OCP\DB\Types;
30
+use OCP\DB\ISchemaWrapper;
31
+use OCP\Migration\IOutput;
32
+use OCP\Migration\SimpleMigrationStep;
33
+
34
+
35
+class Version119Date20250425082914 extends SimpleMigrationStep {
36
+	/**
37
+	 * @param IOutput $output
38
+	 * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
39
+	 * @param array $options
40
+	 * @return null|ISchemaWrapper
41
+	 */
42
+	public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
43
+		/** @var ISchemaWrapper $schema */
44
+		$schema = $schemaClosure();
45
+
46
+		if (!$schema->hasTable('pax_fax')) {
47
+			$table = $schema->createTable('pax_fax');
48
+			$table->addColumn('id', Types::BIGINT, [
49
+				'autoincrement' => true,
50
+				'notnull' => true,
51
+                                'length' => 11,
52
+                                'unsigned' => true,
53
+			]);
54
+			$table->addColumn('user_id', Types::STRING, [
55
+				'notnull' => true,
56
+				'length' => 64,
57
+				'default' => '',
58
+			]);
59
+			$table->addColumn('api_key', Types::STRING, [
60
+				'notnull' => false,
61
+				'length' => 1024,
62
+				'default' => '',
63
+			]);
64
+			$table->addColumn('api_secret', Types::STRING, [
65
+				'notnull' => false,
66
+				'length' => 1024,
67
+				'default' => '',
68
+			]);
69
+			$table->addColumn('webhook_token', Types::STRING, [
70
+				'notnull' => false,
71
+				'length' => 1024,
72
+				'default' => '',
73
+			]);
74
+			$table->addColumn('sinch_project_id', Types::STRING, [
75
+				'notnull' => false,
76
+				'length' => 512,
77
+			]);
78
+			$table->addColumn('sinch_key_id', Types::STRING, [
79
+				'notnull' => false,
80
+				'length' => 512,
81
+			]);
82
+			$table->addColumn('sinch_key_secret', Types::STRING, [
83
+				'notnull' => false,
84
+				'length' => 512,
85
+			]);
86
+			$table->addColumn('sinch_service_id', Types::STRING, [
87
+				'notnull' => false,
88
+				'length' => 512,
89
+			]);
90
+			$table->addColumn('sinch_callback_url', Types::STRING, [
91
+				'notnull' => false,
92
+				'length' => 512,
93
+			]);
94
+			$table->addColumn('receive_url', Types::STRING, [
95
+				'notnull' => false,
96
+				'length' => 1024,
97
+				'default' => '',
98
+			]);
99
+			$table->addColumn('get_notification', Types::SMALLINT, [
100
+				'notnull' => false,
101
+				'length' => 1,
102
+			]);
103
+			$table->addColumn('notification_email', Types::STRING, [
104
+				'notnull' => false,
105
+				'length' => 1024,
106
+				'default' => '',
107
+			]);
108
+                        $table->setPrimaryKey(['id']);
109
+                        $table->addUniqueIndex(['id']);
110
+
111
+		} else {
112
+
113
+                        $table = $schema->getTable('pax_fax');
114
+
115
+			$table->addColumn('sinch_project_id', Types::STRING, [
116
+				'notnull' => false,
117
+				'length' => 512,
118
+			]);
119
+			$table->addColumn('sinch_key_id', Types::STRING, [
120
+				'notnull' => false,
121
+				'length' => 512,
122
+			]);
123
+			$table->addColumn('sinch_key_secret', Types::STRING, [
124
+				'notnull' => false,
125
+				'length' => 512,
126
+			]);
127
+			$table->addColumn('sinch_service_id', Types::STRING, [
128
+				'notnull' => false,
129
+				'length' => 512,
130
+			]);
131
+			$table->addColumn('sinch_callback_url', Types::STRING, [
132
+				'notnull' => false,
133
+				'length' => 512,
134
+			]);
135
+
136
+                }
137
+
138
+		return $schema;
139
+	}
140
+}