chore: lint formatting

This commit is contained in:
Ben Allfree 2023-10-02 11:38:15 -07:00
parent 3c2157be6b
commit e97d5f1ca2
60 changed files with 2553 additions and 2179 deletions

View File

@ -1,492 +1,496 @@
migrate((db) => {
migrate(
(db) => {
const snapshot = [
{
"id": "etae8tuiaxl6xfv",
"created": "2022-10-20 08:51:44.195Z",
"updated": "2023-06-07 22:41:11.725Z",
"name": "instances",
"type": "base",
"system": false,
"schema": [
id: 'etae8tuiaxl6xfv',
created: '2022-10-20 08:51:44.195Z',
updated: '2023-06-07 22:41:11.725Z',
name: 'instances',
type: 'base',
system: false,
schema: [
{
"system": false,
"id": "qdtuuld1",
"name": "subdomain",
"type": "text",
"required": true,
"unique": true,
"options": {
"min": null,
"max": 50,
"pattern": "^[a-z][\\-a-z]+$"
}
system: false,
id: 'qdtuuld1',
name: 'subdomain',
type: 'text',
required: true,
unique: true,
options: {
min: null,
max: 50,
pattern: '^[a-z][\\-a-z]+$',
},
},
{
"system": false,
"id": "rbj14krn",
"name": "uid",
"type": "relation",
"required": true,
"unique": false,
"options": {
"collectionId": "systemprofiles0",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
system: false,
id: 'rbj14krn',
name: 'uid',
type: 'relation',
required: true,
unique: false,
options: {
collectionId: 'systemprofiles0',
cascadeDelete: false,
minSelect: null,
maxSelect: 1,
displayFields: null,
},
},
{
"system": false,
"id": "c2y74d7h",
"name": "status",
"type": "text",
"required": true,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
system: false,
id: 'c2y74d7h',
name: 'status',
type: 'text',
required: true,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
"system": false,
"id": "yxby5r6b",
"name": "platform",
"type": "text",
"required": true,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
system: false,
id: 'yxby5r6b',
name: 'platform',
type: 'text',
required: true,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
"system": false,
"id": "4ydffkv3",
"name": "version",
"type": "text",
"required": true,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
system: false,
id: '4ydffkv3',
name: 'version',
type: 'text',
required: true,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
"system": false,
"id": "1arlklqq",
"name": "secondsThisMonth",
"type": "number",
"required": false,
"unique": false,
"options": {
"min": null,
"max": null
}
system: false,
id: '1arlklqq',
name: 'secondsThisMonth',
type: 'number',
required: false,
unique: false,
options: {
min: null,
max: null,
},
},
{
"system": false,
"id": "66vjgzcg",
"name": "isBackupAllowed",
"type": "bool",
"required": false,
"unique": false,
"options": {}
system: false,
id: '66vjgzcg',
name: 'isBackupAllowed',
type: 'bool',
required: false,
unique: false,
options: {},
},
{
"system": false,
"id": "qew2o2d6",
"name": "currentWorkerBundleId",
"type": "text",
"required": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
system: false,
id: 'qew2o2d6',
name: 'currentWorkerBundleId',
type: 'text',
required: false,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
"system": false,
"id": "3yu1db4p",
"name": "secrets",
"type": "json",
"required": false,
"unique": false,
"options": {}
}
system: false,
id: '3yu1db4p',
name: 'secrets',
type: 'json',
required: false,
unique: false,
options: {},
},
],
"indexes": [
"CREATE UNIQUE INDEX \"idx_unique_qdtuuld1\" on \"instances\" (\"subdomain\")"
indexes: [
'CREATE UNIQUE INDEX "idx_unique_qdtuuld1" on "instances" ("subdomain")',
],
"listRule": "uid=@request.auth.id",
"viewRule": "uid = @request.auth.id",
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {}
listRule: 'uid=@request.auth.id',
viewRule: 'uid = @request.auth.id',
createRule: null,
updateRule: null,
deleteRule: null,
options: {},
},
{
"id": "systemprofiles0",
"created": "2022-10-31 21:31:52.175Z",
"updated": "2023-06-07 22:41:11.723Z",
"name": "users",
"type": "auth",
"system": false,
"schema": [
id: 'systemprofiles0',
created: '2022-10-31 21:31:52.175Z',
updated: '2023-06-07 22:41:11.723Z',
name: 'users',
type: 'auth',
system: false,
schema: [
{
"system": false,
"id": "pbfieldname",
"name": "name",
"type": "text",
"required": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
system: false,
id: 'pbfieldname',
name: 'name',
type: 'text',
required: false,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
"system": false,
"id": "pbfieldavatar",
"name": "avatar",
"type": "file",
"required": false,
"unique": false,
"options": {
"maxSelect": 1,
"maxSize": 5242880,
"mimeTypes": [
"image/jpg",
"image/jpeg",
"image/png",
"image/svg+xml",
"image/gif"
system: false,
id: 'pbfieldavatar',
name: 'avatar',
type: 'file',
required: false,
unique: false,
options: {
maxSelect: 1,
maxSize: 5242880,
mimeTypes: [
'image/jpg',
'image/jpeg',
'image/png',
'image/svg+xml',
'image/gif',
],
"thumbs": null,
"protected": false
}
}
thumbs: null,
protected: false,
},
},
],
"indexes": [],
"listRule": "id = @request.auth.id",
"viewRule": "id = @request.auth.id",
"createRule": "",
"updateRule": "id = @request.auth.id",
"deleteRule": null,
"options": {
"allowEmailAuth": true,
"allowOAuth2Auth": true,
"allowUsernameAuth": false,
"exceptEmailDomains": null,
"manageRule": null,
"minPasswordLength": 8,
"onlyEmailDomains": null,
"requireEmail": true
}
indexes: [],
listRule: 'id = @request.auth.id',
viewRule: 'id = @request.auth.id',
createRule: '',
updateRule: 'id = @request.auth.id',
deleteRule: null,
options: {
allowEmailAuth: true,
allowOAuth2Auth: true,
allowUsernameAuth: false,
exceptEmailDomains: null,
manageRule: null,
minPasswordLength: 8,
onlyEmailDomains: null,
requireEmail: true,
},
},
{
"id": "aiw8te7y7atklwn",
"created": "2022-11-04 13:54:23.745Z",
"updated": "2023-06-07 22:41:11.723Z",
"name": "invocations",
"type": "base",
"system": false,
"schema": [
id: 'aiw8te7y7atklwn',
created: '2022-11-04 13:54:23.745Z',
updated: '2023-06-07 22:41:11.723Z',
name: 'invocations',
type: 'base',
system: false,
schema: [
{
"system": false,
"id": "st9ydrbo",
"name": "instanceId",
"type": "relation",
"required": true,
"unique": false,
"options": {
"collectionId": "etae8tuiaxl6xfv",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
system: false,
id: 'st9ydrbo',
name: 'instanceId',
type: 'relation',
required: true,
unique: false,
options: {
collectionId: 'etae8tuiaxl6xfv',
cascadeDelete: false,
minSelect: null,
maxSelect: 1,
displayFields: null,
},
},
{
"system": false,
"id": "av4mpuyh",
"name": "startedAt",
"type": "date",
"required": true,
"unique": false,
"options": {
"min": "",
"max": ""
}
system: false,
id: 'av4mpuyh',
name: 'startedAt',
type: 'date',
required: true,
unique: false,
options: {
min: '',
max: '',
},
},
{
"system": false,
"id": "fnwatixg",
"name": "endedAt",
"type": "date",
"required": false,
"unique": false,
"options": {
"min": "",
"max": ""
}
system: false,
id: 'fnwatixg',
name: 'endedAt',
type: 'date',
required: false,
unique: false,
options: {
min: '',
max: '',
},
},
{
"system": false,
"id": "awjozhbn",
"name": "pid",
"type": "number",
"required": false,
"unique": false,
"options": {
"min": null,
"max": null
}
system: false,
id: 'awjozhbn',
name: 'pid',
type: 'number',
required: false,
unique: false,
options: {
min: null,
max: null,
},
},
{
"system": false,
"id": "vdkfqege",
"name": "totalSeconds",
"type": "number",
"required": false,
"unique": false,
"options": {
"min": null,
"max": null
}
}
system: false,
id: 'vdkfqege',
name: 'totalSeconds',
type: 'number',
required: false,
unique: false,
options: {
min: null,
max: null,
},
},
],
"indexes": [],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {}
indexes: [],
listRule: null,
viewRule: null,
createRule: null,
updateRule: null,
deleteRule: null,
options: {},
},
{
"id": "v7s41iokt1vizxd",
"created": "2022-11-06 17:23:25.947Z",
"updated": "2023-06-07 22:41:11.723Z",
"name": "rpc",
"type": "base",
"system": false,
"schema": [
id: 'v7s41iokt1vizxd',
created: '2022-11-06 17:23:25.947Z',
updated: '2023-06-07 22:41:11.723Z',
name: 'rpc',
type: 'base',
system: false,
schema: [
{
"system": false,
"id": "yv38czcf",
"name": "userId",
"type": "relation",
"required": true,
"unique": false,
"options": {
"collectionId": "systemprofiles0",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
system: false,
id: 'yv38czcf',
name: 'userId',
type: 'relation',
required: true,
unique: false,
options: {
collectionId: 'systemprofiles0',
cascadeDelete: false,
minSelect: null,
maxSelect: 1,
displayFields: null,
},
},
{
"system": false,
"id": "tgvaxwfv",
"name": "payload",
"type": "json",
"required": true,
"unique": false,
"options": {}
system: false,
id: 'tgvaxwfv',
name: 'payload',
type: 'json',
required: true,
unique: false,
options: {},
},
{
"system": false,
"id": "zede8pci",
"name": "status",
"type": "text",
"required": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
system: false,
id: 'zede8pci',
name: 'status',
type: 'text',
required: false,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
"system": false,
"id": "nd7cwqmn",
"name": "result",
"type": "json",
"required": false,
"unique": false,
"options": {}
system: false,
id: 'nd7cwqmn',
name: 'result',
type: 'json',
required: false,
unique: false,
options: {},
},
{
"system": false,
"id": "2hlrcx5j",
"name": "cmd",
"type": "text",
"required": true,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}
system: false,
id: '2hlrcx5j',
name: 'cmd',
type: 'text',
required: true,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
],
"indexes": [],
"listRule": "userId = @request.auth.id",
"viewRule": "userId = @request.auth.id",
"createRule": "userId = @request.auth.id && status='' && result='' && cmd ?= @collection.rpc_cmds.name",
"updateRule": null,
"deleteRule": null,
"options": {}
indexes: [],
listRule: 'userId = @request.auth.id',
viewRule: 'userId = @request.auth.id',
createRule:
"userId = @request.auth.id && status='' && result='' && cmd ?= @collection.rpc_cmds.name",
updateRule: null,
deleteRule: null,
options: {},
},
{
"id": "72clb6v41bzsay9",
"created": "2022-11-09 15:23:20.313Z",
"updated": "2023-06-07 22:41:11.723Z",
"name": "backups",
"type": "base",
"system": false,
"schema": [
id: '72clb6v41bzsay9',
created: '2022-11-09 15:23:20.313Z',
updated: '2023-06-07 22:41:11.723Z',
name: 'backups',
type: 'base',
system: false,
schema: [
{
"system": false,
"id": "someqtjw",
"name": "message",
"type": "text",
"required": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
system: false,
id: 'someqtjw',
name: 'message',
type: 'text',
required: false,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
"system": false,
"id": "jk4zwiaj",
"name": "instanceId",
"type": "relation",
"required": true,
"unique": false,
"options": {
"collectionId": "etae8tuiaxl6xfv",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
system: false,
id: 'jk4zwiaj',
name: 'instanceId',
type: 'relation',
required: true,
unique: false,
options: {
collectionId: 'etae8tuiaxl6xfv',
cascadeDelete: false,
minSelect: null,
maxSelect: 1,
displayFields: null,
},
},
{
"system": false,
"id": "wsy3l5gm",
"name": "status",
"type": "text",
"required": true,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
system: false,
id: 'wsy3l5gm',
name: 'status',
type: 'text',
required: true,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
"system": false,
"id": "gmkrc5d9",
"name": "bytes",
"type": "number",
"required": false,
"unique": false,
"options": {
"min": null,
"max": null
}
system: false,
id: 'gmkrc5d9',
name: 'bytes',
type: 'number',
required: false,
unique: false,
options: {
min: null,
max: null,
},
},
{
"system": false,
"id": "4lmammjz",
"name": "platform",
"type": "text",
"required": true,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
system: false,
id: '4lmammjz',
name: 'platform',
type: 'text',
required: true,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
"system": false,
"id": "fheqxmbj",
"name": "version",
"type": "text",
"required": true,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
system: false,
id: 'fheqxmbj',
name: 'version',
type: 'text',
required: true,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
"system": false,
"id": "cinbmdwe",
"name": "progress",
"type": "json",
"required": false,
"unique": false,
"options": {}
}
system: false,
id: 'cinbmdwe',
name: 'progress',
type: 'json',
required: false,
unique: false,
options: {},
},
],
"indexes": [],
"listRule": "@request.auth.id = instanceId.uid",
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {}
indexes: [],
listRule: '@request.auth.id = instanceId.uid',
viewRule: null,
createRule: null,
updateRule: null,
deleteRule: null,
options: {},
},
{
"id": "enp8mrv5ewtrltj",
"created": "2023-01-06 10:21:51.659Z",
"updated": "2023-06-07 22:41:11.725Z",
"name": "rpc_cmds",
"type": "base",
"system": false,
"schema": [
id: 'enp8mrv5ewtrltj',
created: '2023-01-06 10:21:51.659Z',
updated: '2023-06-07 22:41:11.725Z',
name: 'rpc_cmds',
type: 'base',
system: false,
schema: [
{
"system": false,
"id": "jbostfhp",
"name": "name",
"type": "text",
"required": true,
"unique": true,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}
system: false,
id: 'jbostfhp',
name: 'name',
type: 'text',
required: true,
unique: true,
options: {
min: null,
max: null,
pattern: '',
},
},
],
"indexes": [
"CREATE UNIQUE INDEX \"idx_unique_jbostfhp\" on \"rpc_cmds\" (\"name\")"
indexes: [
'CREATE UNIQUE INDEX "idx_unique_jbostfhp" on "rpc_cmds" ("name")',
],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {}
}
];
listRule: null,
viewRule: null,
createRule: null,
updateRule: null,
deleteRule: null,
options: {},
},
]
const collections = snapshot.map((item) => new Collection(item));
const collections = snapshot.map((item) => new Collection(item))
return Dao(db).importCollections(collections, true, null);
}, (db) => {
return null;
})
return Dao(db).importCollections(collections, true, null)
},
(db) => {
return null
},
)

View File

@ -1,67 +1,76 @@
migrate((db) => {
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv")
const collection = dao.findCollectionByNameOrId('etae8tuiaxl6xfv')
collection.indexes = [
"CREATE UNIQUE INDEX `idx_unique_qdtuuld1` ON `instances` (`subdomain`)"
'CREATE UNIQUE INDEX `idx_unique_qdtuuld1` ON `instances` (`subdomain`)',
]
// remove
collection.schema.removeField("yxby5r6b")
collection.schema.removeField('yxby5r6b')
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "qdtuuld1",
"name": "subdomain",
"type": "text",
"required": true,
"unique": false,
"options": {
"min": null,
"max": 50,
"pattern": "^[a-z][\\-a-z]+$"
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'qdtuuld1',
name: 'subdomain',
type: 'text',
required: true,
unique: false,
options: {
min: null,
max: 50,
pattern: '^[a-z][\\-a-z]+$',
},
}),
)
return dao.saveCollection(collection)
}, (db) => {
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv")
const collection = dao.findCollectionByNameOrId('etae8tuiaxl6xfv')
collection.indexes = [
"CREATE UNIQUE INDEX \"idx_unique_qdtuuld1\" on \"instances\" (\"subdomain\")"
'CREATE UNIQUE INDEX "idx_unique_qdtuuld1" on "instances" ("subdomain")',
]
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "yxby5r6b",
"name": "platform",
"type": "text",
"required": true,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'yxby5r6b',
name: 'platform',
type: 'text',
required: true,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
}),
)
// update
collection.schema.addField(new SchemaField({
"system": false,
"id": "qdtuuld1",
"name": "subdomain",
"type": "text",
"required": true,
"unique": true,
"options": {
"min": null,
"max": 50,
"pattern": "^[a-z][\\-a-z]+$"
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'qdtuuld1',
name: 'subdomain',
type: 'text',
required: true,
unique: true,
options: {
min: null,
max: 50,
pattern: '^[a-z][\\-a-z]+$',
},
}),
)
return dao.saveCollection(collection)
})
},
)

View File

@ -1,29 +1,34 @@
migrate((db) => {
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("72clb6v41bzsay9")
const collection = dao.findCollectionByNameOrId('72clb6v41bzsay9')
// remove
collection.schema.removeField("4lmammjz")
collection.schema.removeField('4lmammjz')
return dao.saveCollection(collection)
}, (db) => {
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("72clb6v41bzsay9")
const collection = dao.findCollectionByNameOrId('72clb6v41bzsay9')
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "4lmammjz",
"name": "platform",
"type": "text",
"required": true,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: '4lmammjz',
name: 'platform',
type: 'text',
required: true,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
}),
)
return dao.saveCollection(collection)
})
},
)

View File

@ -1,41 +1,44 @@
migrate((db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("enp8mrv5ewtrltj");
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('enp8mrv5ewtrltj')
return dao.deleteCollection(collection);
}, (db) => {
return dao.deleteCollection(collection)
},
(db) => {
const collection = new Collection({
"id": "enp8mrv5ewtrltj",
"created": "2023-01-06 10:21:51.659Z",
"updated": "2023-06-07 22:41:11.725Z",
"name": "rpc_cmds",
"type": "base",
"system": false,
"schema": [
id: 'enp8mrv5ewtrltj',
created: '2023-01-06 10:21:51.659Z',
updated: '2023-06-07 22:41:11.725Z',
name: 'rpc_cmds',
type: 'base',
system: false,
schema: [
{
"system": false,
"id": "jbostfhp",
"name": "name",
"type": "text",
"required": true,
"unique": true,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}
system: false,
id: 'jbostfhp',
name: 'name',
type: 'text',
required: true,
unique: true,
options: {
min: null,
max: null,
pattern: '',
},
},
],
"indexes": [
"CREATE UNIQUE INDEX \"idx_unique_jbostfhp\" on \"rpc_cmds\" (\"name\")"
indexes: [
'CREATE UNIQUE INDEX "idx_unique_jbostfhp" on "rpc_cmds" ("name")',
],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {}
});
listRule: null,
viewRule: null,
createRule: null,
updateRule: null,
deleteRule: null,
options: {},
})
return Dao(db).saveCollection(collection);
})
return Dao(db).saveCollection(collection)
},
)

View File

@ -1,15 +1,19 @@
migrate((db) => {
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("v7s41iokt1vizxd")
const collection = dao.findCollectionByNameOrId('v7s41iokt1vizxd')
collection.createRule = "userId = @request.auth.id && status='' && result=''"
collection.createRule =
"userId = @request.auth.id && status='' && result=''"
return dao.saveCollection(collection)
}, (db) => {
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("v7s41iokt1vizxd")
const collection = dao.findCollectionByNameOrId('v7s41iokt1vizxd')
collection.createRule = null
return dao.saveCollection(collection)
})
},
)

View File

@ -1,101 +1,104 @@
migrate((db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("72clb6v41bzsay9");
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('72clb6v41bzsay9')
return dao.deleteCollection(collection);
}, (db) => {
return dao.deleteCollection(collection)
},
(db) => {
const collection = new Collection({
"id": "72clb6v41bzsay9",
"created": "2022-11-09 15:23:20.313Z",
"updated": "2023-06-10 09:12:01.004Z",
"name": "backups",
"type": "base",
"system": false,
"schema": [
id: '72clb6v41bzsay9',
created: '2022-11-09 15:23:20.313Z',
updated: '2023-06-10 09:12:01.004Z',
name: 'backups',
type: 'base',
system: false,
schema: [
{
"system": false,
"id": "someqtjw",
"name": "message",
"type": "text",
"required": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
system: false,
id: 'someqtjw',
name: 'message',
type: 'text',
required: false,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
"system": false,
"id": "jk4zwiaj",
"name": "instanceId",
"type": "relation",
"required": true,
"unique": false,
"options": {
"collectionId": "etae8tuiaxl6xfv",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
system: false,
id: 'jk4zwiaj',
name: 'instanceId',
type: 'relation',
required: true,
unique: false,
options: {
collectionId: 'etae8tuiaxl6xfv',
cascadeDelete: false,
minSelect: null,
maxSelect: 1,
displayFields: null,
},
},
{
"system": false,
"id": "wsy3l5gm",
"name": "status",
"type": "text",
"required": true,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
system: false,
id: 'wsy3l5gm',
name: 'status',
type: 'text',
required: true,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
"system": false,
"id": "gmkrc5d9",
"name": "bytes",
"type": "number",
"required": false,
"unique": false,
"options": {
"min": null,
"max": null
}
system: false,
id: 'gmkrc5d9',
name: 'bytes',
type: 'number',
required: false,
unique: false,
options: {
min: null,
max: null,
},
},
{
"system": false,
"id": "fheqxmbj",
"name": "version",
"type": "text",
"required": true,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
system: false,
id: 'fheqxmbj',
name: 'version',
type: 'text',
required: true,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
},
{
"system": false,
"id": "cinbmdwe",
"name": "progress",
"type": "json",
"required": false,
"unique": false,
"options": {}
}
system: false,
id: 'cinbmdwe',
name: 'progress',
type: 'json',
required: false,
unique: false,
options: {},
},
],
"indexes": [],
"listRule": "@request.auth.id = instanceId.uid",
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {}
});
indexes: [],
listRule: '@request.auth.id = instanceId.uid',
viewRule: null,
createRule: null,
updateRule: null,
deleteRule: null,
options: {},
})
return Dao(db).saveCollection(collection);
})
return Dao(db).saveCollection(collection)
},
)

View File

@ -1,25 +1,30 @@
migrate((db) => {
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv")
const collection = dao.findCollectionByNameOrId('etae8tuiaxl6xfv')
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "mexrkb5z",
"name": "maintenance",
"type": "bool",
"required": false,
"unique": false,
"options": {}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'mexrkb5z',
name: 'maintenance',
type: 'bool',
required: false,
unique: false,
options: {},
}),
)
return dao.saveCollection(collection)
}, (db) => {
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv")
const collection = dao.findCollectionByNameOrId('etae8tuiaxl6xfv')
// remove
collection.schema.removeField("mexrkb5z")
collection.schema.removeField('mexrkb5z')
return dao.saveCollection(collection)
})
},
)

View File

@ -1,25 +1,30 @@
migrate((db) => {
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv")
const collection = dao.findCollectionByNameOrId('etae8tuiaxl6xfv')
// remove
collection.schema.removeField("66vjgzcg")
collection.schema.removeField('66vjgzcg')
return dao.saveCollection(collection)
}, (db) => {
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv")
const collection = dao.findCollectionByNameOrId('etae8tuiaxl6xfv')
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "66vjgzcg",
"name": "isBackupAllowed",
"type": "bool",
"required": false,
"unique": false,
"options": {}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: '66vjgzcg',
name: 'isBackupAllowed',
type: 'bool',
required: false,
unique: false,
options: {},
}),
)
return dao.saveCollection(collection)
})
},
)

View File

@ -1,29 +1,34 @@
migrate((db) => {
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv")
const collection = dao.findCollectionByNameOrId('etae8tuiaxl6xfv')
// remove
collection.schema.removeField("qew2o2d6")
collection.schema.removeField('qew2o2d6')
return dao.saveCollection(collection)
}, (db) => {
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("etae8tuiaxl6xfv")
const collection = dao.findCollectionByNameOrId('etae8tuiaxl6xfv')
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "qew2o2d6",
"name": "currentWorkerBundleId",
"type": "text",
"required": false,
"unique": false,
"options": {
"min": null,
"max": null,
"pattern": ""
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'qew2o2d6',
name: 'currentWorkerBundleId',
type: 'text',
required: false,
unique: false,
options: {
min: null,
max: null,
pattern: '',
},
}),
)
return dao.saveCollection(collection)
})
},
)

View File

@ -170,5 +170,5 @@ migrate(
const collection = dao.findCollectionByNameOrId('se6fljwhhc03k4q')
return dao.deleteCollection(collection)
}
},
)

View File

@ -22,5 +22,5 @@ migrate(
collection.indexes = []
return dao.saveCollection(collection)
}
},
)

View File

@ -17,5 +17,5 @@ migrate(
collection.indexes = []
return dao.saveCollection(collection)
}
},
)

View File

@ -1,42 +1,46 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
migrate(
(db) => {
const collection = new Collection({
"id": "y7qb3zm8vslkfxj",
"created": "2023-09-15 13:56:42.907Z",
"updated": "2023-09-15 13:56:42.907Z",
"name": "potentialPaidUsersView",
"type": "view",
"system": false,
"schema": [
id: 'y7qb3zm8vslkfxj',
created: '2023-09-15 13:56:42.907Z',
updated: '2023-09-15 13:56:42.907Z',
name: 'potentialPaidUsersView',
type: 'view',
system: false,
schema: [
{
"system": false,
"id": "2gw1y72t",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}
system: false,
id: '2gw1y72t',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
},
],
"indexes": [],
"listRule": null,
"viewRule": null,
"createRule": null,
"updateRule": null,
"deleteRule": null,
"options": {
"query": "select id,email from users where id in (select uid from instances where secondsThisMonth>6000)"
}
});
indexes: [],
listRule: null,
viewRule: null,
createRule: null,
updateRule: null,
deleteRule: null,
options: {
query:
'select id,email from users where id in (select uid from instances where secondsThisMonth>6000)',
},
})
return Dao(db).saveCollection(collection);
}, (db) => {
const dao = new Dao(db);
const collection = dao.findCollectionByNameOrId("y7qb3zm8vslkfxj");
return Dao(db).saveCollection(collection)
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
return dao.deleteCollection(collection);
})
return dao.deleteCollection(collection)
},
)

View File

@ -1,56 +1,65 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y7qb3zm8vslkfxj")
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
"query": "select id,email from users where id in (select uid from instances where secondsThisMonth<=6000)"
query:
'select id,email from users where id in (select uid from instances where secondsThisMonth<=6000)',
}
// remove
collection.schema.removeField("2gw1y72t")
collection.schema.removeField('2gw1y72t')
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "mu8wxouc",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'mu8wxouc',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
return dao.saveCollection(collection)
}, (db) => {
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y7qb3zm8vslkfxj")
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
"query": "select id,email from users where id in (select uid from instances where secondsThisMonth>6000)"
query:
'select id,email from users where id in (select uid from instances where secondsThisMonth>6000)',
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "2gw1y72t",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: '2gw1y72t',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// remove
collection.schema.removeField("mu8wxouc")
collection.schema.removeField('mu8wxouc')
return dao.saveCollection(collection)
})
},
)

View File

@ -1,56 +1,65 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y7qb3zm8vslkfxj")
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
"query": "select id,email from users where id in (select uid from instances where secondsThisMonth>6000)"
query:
'select id,email from users where id in (select uid from instances where secondsThisMonth>6000)',
}
// remove
collection.schema.removeField("mu8wxouc")
collection.schema.removeField('mu8wxouc')
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "4dwqriso",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: '4dwqriso',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
return dao.saveCollection(collection)
}, (db) => {
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y7qb3zm8vslkfxj")
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
"query": "select id,email from users where id in (select uid from instances where secondsThisMonth<=6000)"
query:
'select id,email from users where id in (select uid from instances where secondsThisMonth<=6000)',
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "mu8wxouc",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'mu8wxouc',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// remove
collection.schema.removeField("4dwqriso")
collection.schema.removeField('4dwqriso')
return dao.saveCollection(collection)
})
},
)

View File

@ -1,71 +1,82 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y7qb3zm8vslkfxj")
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
"query": "select u.id,email,secondsThisMonth from users u join instances i where u.id=i.uid and secondsThisMonth>6000"
query:
'select u.id,email,secondsThisMonth from users u join instances i where u.id=i.uid and secondsThisMonth>6000',
}
// remove
collection.schema.removeField("4dwqriso")
collection.schema.removeField('4dwqriso')
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "jeo2co2y",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'jeo2co2y',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "pcl2olai",
"name": "secondsThisMonth",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'pcl2olai',
name: 'secondsThisMonth',
type: 'json',
required: false,
presentable: false,
unique: false,
options: {},
}),
)
return dao.saveCollection(collection)
}, (db) => {
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y7qb3zm8vslkfxj")
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
"query": "select id,email from users where id in (select uid from instances where secondsThisMonth>6000)"
query:
'select id,email from users where id in (select uid from instances where secondsThisMonth>6000)',
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "4dwqriso",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: '4dwqriso',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// remove
collection.schema.removeField("jeo2co2y")
collection.schema.removeField('jeo2co2y')
// remove
collection.schema.removeField("pcl2olai")
collection.schema.removeField('pcl2olai')
return dao.saveCollection(collection)
})
},
)

View File

@ -1,86 +1,99 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y7qb3zm8vslkfxj")
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
"query": "select u.id,email,secondsThisMonth from users u join instances i where u.id=i.uid and secondsThisMonth/60>500"
query:
'select u.id,email,secondsThisMonth from users u join instances i where u.id=i.uid and secondsThisMonth/60>500',
}
// remove
collection.schema.removeField("jeo2co2y")
collection.schema.removeField('jeo2co2y')
// remove
collection.schema.removeField("pcl2olai")
collection.schema.removeField('pcl2olai')
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "4nas99bt",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: '4nas99bt',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "pmfykpks",
"name": "secondsThisMonth",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'pmfykpks',
name: 'secondsThisMonth',
type: 'json',
required: false,
presentable: false,
unique: false,
options: {},
}),
)
return dao.saveCollection(collection)
}, (db) => {
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y7qb3zm8vslkfxj")
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
"query": "select u.id,email,secondsThisMonth from users u join instances i where u.id=i.uid and secondsThisMonth>6000"
query:
'select u.id,email,secondsThisMonth from users u join instances i where u.id=i.uid and secondsThisMonth>6000',
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "jeo2co2y",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'jeo2co2y',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "pcl2olai",
"name": "secondsThisMonth",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'pcl2olai',
name: 'secondsThisMonth',
type: 'json',
required: false,
presentable: false,
unique: false,
options: {},
}),
)
// remove
collection.schema.removeField("4nas99bt")
collection.schema.removeField('4nas99bt')
// remove
collection.schema.removeField("pmfykpks")
collection.schema.removeField('pmfykpks')
return dao.saveCollection(collection)
})
},
)

View File

@ -1,86 +1,99 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y7qb3zm8vslkfxj")
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
"query": "select u.id,email,secondsThisMonth from users u join instances i where u.id=i.uid and secondsThisMonth/60>200"
query:
'select u.id,email,secondsThisMonth from users u join instances i where u.id=i.uid and secondsThisMonth/60>200',
}
// remove
collection.schema.removeField("4nas99bt")
collection.schema.removeField('4nas99bt')
// remove
collection.schema.removeField("pmfykpks")
collection.schema.removeField('pmfykpks')
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "c0fjqkvh",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'c0fjqkvh',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "nrzmfvrb",
"name": "secondsThisMonth",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'nrzmfvrb',
name: 'secondsThisMonth',
type: 'json',
required: false,
presentable: false,
unique: false,
options: {},
}),
)
return dao.saveCollection(collection)
}, (db) => {
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y7qb3zm8vslkfxj")
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
"query": "select u.id,email,secondsThisMonth from users u join instances i where u.id=i.uid and secondsThisMonth/60>500"
query:
'select u.id,email,secondsThisMonth from users u join instances i where u.id=i.uid and secondsThisMonth/60>500',
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "4nas99bt",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: '4nas99bt',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "pmfykpks",
"name": "secondsThisMonth",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'pmfykpks',
name: 'secondsThisMonth',
type: 'json',
required: false,
presentable: false,
unique: false,
options: {},
}),
)
// remove
collection.schema.removeField("c0fjqkvh")
collection.schema.removeField('c0fjqkvh')
// remove
collection.schema.removeField("nrzmfvrb")
collection.schema.removeField('nrzmfvrb')
return dao.saveCollection(collection)
})
},
)

View File

@ -1,54 +1,59 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("aiw8te7y7atklwn")
const collection = dao.findCollectionByNameOrId('aiw8te7y7atklwn')
collection.indexes = [
"CREATE INDEX `idx_CTV52b6` ON `invocations` (`created`)",
"CREATE INDEX `idx_6rNZeTK` ON `invocations` (`instanceId`)",
"CREATE INDEX `idx_LTmqfbC` ON `invocations` (`totalSeconds`)",
"CREATE INDEX `idx_7YR9a3g` ON `invocations` (\n `instanceId`,\n `created`\n)",
"CREATE INDEX `idx_ntC1d1L` ON `invocations` (\n `totalSeconds`,\n `created`\n)",
"CREATE INDEX `idx_vViR75E` ON `invocations` (\n `created`,\n `totalSeconds`\n)",
"CREATE INDEX `idx_q9LanEj` ON `invocations` (\n `created`,\n `instanceId`\n)",
"CREATE INDEX `idx_ueUQe1N` ON `invocations` (`uid`)"
'CREATE INDEX `idx_CTV52b6` ON `invocations` (`created`)',
'CREATE INDEX `idx_6rNZeTK` ON `invocations` (`instanceId`)',
'CREATE INDEX `idx_LTmqfbC` ON `invocations` (`totalSeconds`)',
'CREATE INDEX `idx_7YR9a3g` ON `invocations` (\n `instanceId`,\n `created`\n)',
'CREATE INDEX `idx_ntC1d1L` ON `invocations` (\n `totalSeconds`,\n `created`\n)',
'CREATE INDEX `idx_vViR75E` ON `invocations` (\n `created`,\n `totalSeconds`\n)',
'CREATE INDEX `idx_q9LanEj` ON `invocations` (\n `created`,\n `instanceId`\n)',
'CREATE INDEX `idx_ueUQe1N` ON `invocations` (`uid`)',
]
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "kmyokg1d",
"name": "uid",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "systemprofiles0",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'kmyokg1d',
name: 'uid',
type: 'relation',
required: false,
presentable: false,
unique: false,
options: {
collectionId: 'systemprofiles0',
cascadeDelete: false,
minSelect: null,
maxSelect: 1,
displayFields: null,
},
}),
)
return dao.saveCollection(collection)
}, (db) => {
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("aiw8te7y7atklwn")
const collection = dao.findCollectionByNameOrId('aiw8te7y7atklwn')
collection.indexes = [
"CREATE INDEX `idx_CTV52b6` ON `invocations` (`created`)",
"CREATE INDEX `idx_6rNZeTK` ON `invocations` (`instanceId`)",
"CREATE INDEX `idx_LTmqfbC` ON `invocations` (`totalSeconds`)",
"CREATE INDEX `idx_7YR9a3g` ON `invocations` (\n `instanceId`,\n `created`\n)",
"CREATE INDEX `idx_ntC1d1L` ON `invocations` (\n `totalSeconds`,\n `created`\n)",
"CREATE INDEX `idx_vViR75E` ON `invocations` (\n `created`,\n `totalSeconds`\n)",
"CREATE INDEX `idx_q9LanEj` ON `invocations` (\n `created`,\n `instanceId`\n)"
'CREATE INDEX `idx_CTV52b6` ON `invocations` (`created`)',
'CREATE INDEX `idx_6rNZeTK` ON `invocations` (`instanceId`)',
'CREATE INDEX `idx_LTmqfbC` ON `invocations` (`totalSeconds`)',
'CREATE INDEX `idx_7YR9a3g` ON `invocations` (\n `instanceId`,\n `created`\n)',
'CREATE INDEX `idx_ntC1d1L` ON `invocations` (\n `totalSeconds`,\n `created`\n)',
'CREATE INDEX `idx_vViR75E` ON `invocations` (\n `created`,\n `totalSeconds`\n)',
'CREATE INDEX `idx_q9LanEj` ON `invocations` (\n `created`,\n `instanceId`\n)',
]
// remove
collection.schema.removeField("kmyokg1d")
collection.schema.removeField('kmyokg1d')
return dao.saveCollection(collection)
})
},
)

View File

@ -1,36 +1,39 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("aiw8te7y7atklwn")
const collection = dao.findCollectionByNameOrId('aiw8te7y7atklwn')
collection.indexes = [
"CREATE INDEX `idx_CTV52b6` ON `invocations` (`created`)",
"CREATE INDEX `idx_6rNZeTK` ON `invocations` (`instanceId`)",
"CREATE INDEX `idx_LTmqfbC` ON `invocations` (`totalSeconds`)",
"CREATE INDEX `idx_7YR9a3g` ON `invocations` (\n `instanceId`,\n `created`\n)",
"CREATE INDEX `idx_ntC1d1L` ON `invocations` (\n `totalSeconds`,\n `created`\n)",
"CREATE INDEX `idx_vViR75E` ON `invocations` (\n `created`,\n `totalSeconds`\n)",
"CREATE INDEX `idx_q9LanEj` ON `invocations` (\n `created`,\n `instanceId`\n)",
"CREATE INDEX `idx_ueUQe1N` ON `invocations` (`uid`)",
"CREATE INDEX `idx_gh6iEUG` ON `invocations` (\n `instanceId`,\n `startedAt`\n)",
"CREATE INDEX `idx_CUsNbfu` ON `invocations` (\n `uid`,\n `startedAt`\n)"
'CREATE INDEX `idx_CTV52b6` ON `invocations` (`created`)',
'CREATE INDEX `idx_6rNZeTK` ON `invocations` (`instanceId`)',
'CREATE INDEX `idx_LTmqfbC` ON `invocations` (`totalSeconds`)',
'CREATE INDEX `idx_7YR9a3g` ON `invocations` (\n `instanceId`,\n `created`\n)',
'CREATE INDEX `idx_ntC1d1L` ON `invocations` (\n `totalSeconds`,\n `created`\n)',
'CREATE INDEX `idx_vViR75E` ON `invocations` (\n `created`,\n `totalSeconds`\n)',
'CREATE INDEX `idx_q9LanEj` ON `invocations` (\n `created`,\n `instanceId`\n)',
'CREATE INDEX `idx_ueUQe1N` ON `invocations` (`uid`)',
'CREATE INDEX `idx_gh6iEUG` ON `invocations` (\n `instanceId`,\n `startedAt`\n)',
'CREATE INDEX `idx_CUsNbfu` ON `invocations` (\n `uid`,\n `startedAt`\n)',
]
return dao.saveCollection(collection)
}, (db) => {
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("aiw8te7y7atklwn")
const collection = dao.findCollectionByNameOrId('aiw8te7y7atklwn')
collection.indexes = [
"CREATE INDEX `idx_CTV52b6` ON `invocations` (`created`)",
"CREATE INDEX `idx_6rNZeTK` ON `invocations` (`instanceId`)",
"CREATE INDEX `idx_LTmqfbC` ON `invocations` (`totalSeconds`)",
"CREATE INDEX `idx_7YR9a3g` ON `invocations` (\n `instanceId`,\n `created`\n)",
"CREATE INDEX `idx_ntC1d1L` ON `invocations` (\n `totalSeconds`,\n `created`\n)",
"CREATE INDEX `idx_vViR75E` ON `invocations` (\n `created`,\n `totalSeconds`\n)",
"CREATE INDEX `idx_q9LanEj` ON `invocations` (\n `created`,\n `instanceId`\n)",
"CREATE INDEX `idx_ueUQe1N` ON `invocations` (`uid`)"
'CREATE INDEX `idx_CTV52b6` ON `invocations` (`created`)',
'CREATE INDEX `idx_6rNZeTK` ON `invocations` (`instanceId`)',
'CREATE INDEX `idx_LTmqfbC` ON `invocations` (`totalSeconds`)',
'CREATE INDEX `idx_7YR9a3g` ON `invocations` (\n `instanceId`,\n `created`\n)',
'CREATE INDEX `idx_ntC1d1L` ON `invocations` (\n `totalSeconds`,\n `created`\n)',
'CREATE INDEX `idx_vViR75E` ON `invocations` (\n `created`,\n `totalSeconds`\n)',
'CREATE INDEX `idx_q9LanEj` ON `invocations` (\n `created`,\n `instanceId`\n)',
'CREATE INDEX `idx_ueUQe1N` ON `invocations` (`uid`)',
]
return dao.saveCollection(collection)
})
},
)

View File

@ -1,31 +1,36 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("systemprofiles0")
const collection = dao.findCollectionByNameOrId('systemprofiles0')
// remove
collection.schema.removeField("rgwv4xhk")
collection.schema.removeField('rgwv4xhk')
return dao.saveCollection(collection)
}, (db) => {
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("systemprofiles0")
const collection = dao.findCollectionByNameOrId('systemprofiles0')
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "rgwv4xhk",
"name": "totalSecondsThisMonth",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'rgwv4xhk',
name: 'totalSecondsThisMonth',
type: 'number',
required: false,
presentable: false,
unique: false,
options: {
min: null,
max: null,
noDecimal: false,
},
}),
)
return dao.saveCollection(collection)
})
},
)

View File

@ -1,90 +1,103 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y7qb3zm8vslkfxj")
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
"query": "SELECT u.id,\n email,\n i.secondsthismonth\nFROM users u\nJOIN instances i\nwhere u.id=i.uid\nAND secondsthismonth/60>200"
query:
'SELECT u.id,\n email,\n i.secondsthismonth\nFROM users u\nJOIN instances i\nwhere u.id=i.uid\nAND secondsthismonth/60>200',
}
// remove
collection.schema.removeField("c0fjqkvh")
collection.schema.removeField('c0fjqkvh')
// remove
collection.schema.removeField("nrzmfvrb")
collection.schema.removeField('nrzmfvrb')
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "9xsegduz",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: '9xsegduz',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "4dmlmvan",
"name": "secondsthismonth",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: '4dmlmvan',
name: 'secondsthismonth',
type: 'number',
required: false,
presentable: false,
unique: false,
options: {
min: null,
max: null,
noDecimal: false,
},
}),
)
return dao.saveCollection(collection)
}, (db) => {
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y7qb3zm8vslkfxj")
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
"query": "select u.id,email,secondsThisMonth from users u join instances i where u.id=i.uid and secondsThisMonth/60>200"
query:
'select u.id,email,secondsThisMonth from users u join instances i where u.id=i.uid and secondsThisMonth/60>200',
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "c0fjqkvh",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'c0fjqkvh',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "nrzmfvrb",
"name": "secondsThisMonth",
"type": "json",
"required": false,
"presentable": false,
"unique": false,
"options": {}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'nrzmfvrb',
name: 'secondsThisMonth',
type: 'json',
required: false,
presentable: false,
unique: false,
options: {},
}),
)
// remove
collection.schema.removeField("9xsegduz")
collection.schema.removeField('9xsegduz')
// remove
collection.schema.removeField("4dmlmvan")
collection.schema.removeField('4dmlmvan')
return dao.saveCollection(collection)
})
},
)

View File

@ -1,94 +1,107 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y7qb3zm8vslkfxj")
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
"query": "SELECT u.id,\n u.email,\n i.secondsthismonth\nFROM users u\nJOIN instances i\nwhere u.id=i.uid\nAND i.secondsthismonth/60>200"
query:
'SELECT u.id,\n u.email,\n i.secondsthismonth\nFROM users u\nJOIN instances i\nwhere u.id=i.uid\nAND i.secondsthismonth/60>200',
}
// remove
collection.schema.removeField("9xsegduz")
collection.schema.removeField('9xsegduz')
// remove
collection.schema.removeField("4dmlmvan")
collection.schema.removeField('4dmlmvan')
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "omarcdxd",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'omarcdxd',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "c2czszfp",
"name": "secondsthismonth",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'c2czszfp',
name: 'secondsthismonth',
type: 'number',
required: false,
presentable: false,
unique: false,
options: {
min: null,
max: null,
noDecimal: false,
},
}),
)
return dao.saveCollection(collection)
}, (db) => {
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y7qb3zm8vslkfxj")
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
"query": "SELECT u.id,\n email,\n i.secondsthismonth\nFROM users u\nJOIN instances i\nwhere u.id=i.uid\nAND secondsthismonth/60>200"
query:
'SELECT u.id,\n email,\n i.secondsthismonth\nFROM users u\nJOIN instances i\nwhere u.id=i.uid\nAND secondsthismonth/60>200',
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "9xsegduz",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: '9xsegduz',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "4dmlmvan",
"name": "secondsthismonth",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: '4dmlmvan',
name: 'secondsthismonth',
type: 'number',
required: false,
presentable: false,
unique: false,
options: {
min: null,
max: null,
noDecimal: false,
},
}),
)
// remove
collection.schema.removeField("omarcdxd")
collection.schema.removeField('omarcdxd')
// remove
collection.schema.removeField("c2czszfp")
collection.schema.removeField('c2czszfp')
return dao.saveCollection(collection)
})
},
)

View File

@ -1,37 +1,42 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("systemprofiles0")
const collection = dao.findCollectionByNameOrId('systemprofiles0')
collection.indexes = [
"CREATE INDEX `idx_q4Kji47` ON `users` (`secondsThisMonth`)"
'CREATE INDEX `idx_q4Kji47` ON `users` (`secondsThisMonth`)',
]
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "qz4cjamg",
"name": "secondsThisMonth",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'qz4cjamg',
name: 'secondsThisMonth',
type: 'number',
required: false,
presentable: false,
unique: false,
options: {
min: null,
max: null,
noDecimal: false,
},
}),
)
return dao.saveCollection(collection)
}, (db) => {
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("systemprofiles0")
const collection = dao.findCollectionByNameOrId('systemprofiles0')
collection.indexes = []
// remove
collection.schema.removeField("qz4cjamg")
collection.schema.removeField('qz4cjamg')
return dao.saveCollection(collection)
})
},
)

View File

@ -1,94 +1,107 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y7qb3zm8vslkfxj")
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
"query": "SELECT u.id,\n u.email,\n u.secondsthismonth\nFROM users u\nWHERE u.secondsthismonth/60>200"
query:
'SELECT u.id,\n u.email,\n u.secondsthismonth\nFROM users u\nWHERE u.secondsthismonth/60>200',
}
// remove
collection.schema.removeField("omarcdxd")
collection.schema.removeField('omarcdxd')
// remove
collection.schema.removeField("c2czszfp")
collection.schema.removeField('c2czszfp')
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "ld24cbna",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'ld24cbna',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "g3qvj4tl",
"name": "secondsthismonth",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'g3qvj4tl',
name: 'secondsthismonth',
type: 'number',
required: false,
presentable: false,
unique: false,
options: {
min: null,
max: null,
noDecimal: false,
},
}),
)
return dao.saveCollection(collection)
}, (db) => {
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y7qb3zm8vslkfxj")
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
"query": "SELECT u.id,\n u.email,\n i.secondsthismonth\nFROM users u\nJOIN instances i\nwhere u.id=i.uid\nAND i.secondsthismonth/60>200"
query:
'SELECT u.id,\n u.email,\n i.secondsthismonth\nFROM users u\nJOIN instances i\nwhere u.id=i.uid\nAND i.secondsthismonth/60>200',
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "omarcdxd",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'omarcdxd',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "c2czszfp",
"name": "secondsthismonth",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'c2czszfp',
name: 'secondsthismonth',
type: 'number',
required: false,
presentable: false,
unique: false,
options: {
min: null,
max: null,
noDecimal: false,
},
}),
)
// remove
collection.schema.removeField("ld24cbna")
collection.schema.removeField('ld24cbna')
// remove
collection.schema.removeField("g3qvj4tl")
collection.schema.removeField('g3qvj4tl')
return dao.saveCollection(collection)
})
},
)

View File

@ -1,42 +1,45 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("aiw8te7y7atklwn")
const collection = dao.findCollectionByNameOrId('aiw8te7y7atklwn')
collection.indexes = [
"CREATE INDEX `idx_CTV52b6` ON `invocations` (`created`)",
"CREATE INDEX `idx_6rNZeTK` ON `invocations` (`instanceId`)",
"CREATE INDEX `idx_LTmqfbC` ON `invocations` (`totalSeconds`)",
"CREATE INDEX `idx_7YR9a3g` ON `invocations` (\n `instanceId`,\n `created`\n)",
"CREATE INDEX `idx_ntC1d1L` ON `invocations` (\n `totalSeconds`,\n `created`\n)",
"CREATE INDEX `idx_vViR75E` ON `invocations` (\n `created`,\n `totalSeconds`\n)",
"CREATE INDEX `idx_q9LanEj` ON `invocations` (\n `created`,\n `instanceId`\n)",
"CREATE INDEX `idx_ueUQe1N` ON `invocations` (`uid`)",
"CREATE INDEX `idx_gh6iEUG` ON `invocations` (\n `instanceId`,\n `startedAt`\n)",
"CREATE INDEX `idx_CUsNbfu` ON `invocations` (\n `uid`,\n `startedAt`\n)",
"CREATE INDEX `idx_O3bEfl0` ON `invocations` (`updated`)",
"CREATE INDEX `idx_qOyDhVG` ON `invocations` (`created`)",
"CREATE INDEX `idx_UM6cwSA` ON `invocations` (`instanceId`)",
"CREATE INDEX `idx_nMr318s` ON `invocations` (`totalSeconds`)"
'CREATE INDEX `idx_CTV52b6` ON `invocations` (`created`)',
'CREATE INDEX `idx_6rNZeTK` ON `invocations` (`instanceId`)',
'CREATE INDEX `idx_LTmqfbC` ON `invocations` (`totalSeconds`)',
'CREATE INDEX `idx_7YR9a3g` ON `invocations` (\n `instanceId`,\n `created`\n)',
'CREATE INDEX `idx_ntC1d1L` ON `invocations` (\n `totalSeconds`,\n `created`\n)',
'CREATE INDEX `idx_vViR75E` ON `invocations` (\n `created`,\n `totalSeconds`\n)',
'CREATE INDEX `idx_q9LanEj` ON `invocations` (\n `created`,\n `instanceId`\n)',
'CREATE INDEX `idx_ueUQe1N` ON `invocations` (`uid`)',
'CREATE INDEX `idx_gh6iEUG` ON `invocations` (\n `instanceId`,\n `startedAt`\n)',
'CREATE INDEX `idx_CUsNbfu` ON `invocations` (\n `uid`,\n `startedAt`\n)',
'CREATE INDEX `idx_O3bEfl0` ON `invocations` (`updated`)',
'CREATE INDEX `idx_qOyDhVG` ON `invocations` (`created`)',
'CREATE INDEX `idx_UM6cwSA` ON `invocations` (`instanceId`)',
'CREATE INDEX `idx_nMr318s` ON `invocations` (`totalSeconds`)',
]
return dao.saveCollection(collection)
}, (db) => {
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("aiw8te7y7atklwn")
const collection = dao.findCollectionByNameOrId('aiw8te7y7atklwn')
collection.indexes = [
"CREATE INDEX `idx_CTV52b6` ON `invocations` (`created`)",
"CREATE INDEX `idx_6rNZeTK` ON `invocations` (`instanceId`)",
"CREATE INDEX `idx_LTmqfbC` ON `invocations` (`totalSeconds`)",
"CREATE INDEX `idx_7YR9a3g` ON `invocations` (\n `instanceId`,\n `created`\n)",
"CREATE INDEX `idx_ntC1d1L` ON `invocations` (\n `totalSeconds`,\n `created`\n)",
"CREATE INDEX `idx_vViR75E` ON `invocations` (\n `created`,\n `totalSeconds`\n)",
"CREATE INDEX `idx_q9LanEj` ON `invocations` (\n `created`,\n `instanceId`\n)",
"CREATE INDEX `idx_ueUQe1N` ON `invocations` (`uid`)",
"CREATE INDEX `idx_gh6iEUG` ON `invocations` (\n `instanceId`,\n `startedAt`\n)",
"CREATE INDEX `idx_CUsNbfu` ON `invocations` (\n `uid`,\n `startedAt`\n)"
'CREATE INDEX `idx_CTV52b6` ON `invocations` (`created`)',
'CREATE INDEX `idx_6rNZeTK` ON `invocations` (`instanceId`)',
'CREATE INDEX `idx_LTmqfbC` ON `invocations` (`totalSeconds`)',
'CREATE INDEX `idx_7YR9a3g` ON `invocations` (\n `instanceId`,\n `created`\n)',
'CREATE INDEX `idx_ntC1d1L` ON `invocations` (\n `totalSeconds`,\n `created`\n)',
'CREATE INDEX `idx_vViR75E` ON `invocations` (\n `created`,\n `totalSeconds`\n)',
'CREATE INDEX `idx_q9LanEj` ON `invocations` (\n `created`,\n `instanceId`\n)',
'CREATE INDEX `idx_ueUQe1N` ON `invocations` (`uid`)',
'CREATE INDEX `idx_gh6iEUG` ON `invocations` (\n `instanceId`,\n `startedAt`\n)',
'CREATE INDEX `idx_CUsNbfu` ON `invocations` (\n `uid`,\n `startedAt`\n)',
]
return dao.saveCollection(collection)
})
},
)

View File

@ -1,94 +1,107 @@
/// <reference path="../pb_data/types.d.ts" />
migrate((db) => {
migrate(
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y7qb3zm8vslkfxj")
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
"query": "SELECT u.id,\n u.email,\n u.secondsthismonth\nFROM users u\nWHERE u.verified=1 and u.secondsthismonth/60>200"
query:
'SELECT u.id,\n u.email,\n u.secondsthismonth\nFROM users u\nWHERE u.verified=1 and u.secondsthismonth/60>200',
}
// remove
collection.schema.removeField("ld24cbna")
collection.schema.removeField('ld24cbna')
// remove
collection.schema.removeField("g3qvj4tl")
collection.schema.removeField('g3qvj4tl')
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "mkmeisox",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'mkmeisox',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "wqw6fejd",
"name": "secondsthismonth",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'wqw6fejd',
name: 'secondsthismonth',
type: 'number',
required: false,
presentable: false,
unique: false,
options: {
min: null,
max: null,
noDecimal: false,
},
}),
)
return dao.saveCollection(collection)
}, (db) => {
},
(db) => {
const dao = new Dao(db)
const collection = dao.findCollectionByNameOrId("y7qb3zm8vslkfxj")
const collection = dao.findCollectionByNameOrId('y7qb3zm8vslkfxj')
collection.options = {
"query": "SELECT u.id,\n u.email,\n u.secondsthismonth\nFROM users u\nWHERE u.secondsthismonth/60>200"
query:
'SELECT u.id,\n u.email,\n u.secondsthismonth\nFROM users u\nWHERE u.secondsthismonth/60>200',
}
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "ld24cbna",
"name": "email",
"type": "email",
"required": false,
"presentable": false,
"unique": false,
"options": {
"exceptDomains": null,
"onlyDomains": null
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'ld24cbna',
name: 'email',
type: 'email',
required: false,
presentable: false,
unique: false,
options: {
exceptDomains: null,
onlyDomains: null,
},
}),
)
// add
collection.schema.addField(new SchemaField({
"system": false,
"id": "g3qvj4tl",
"name": "secondsthismonth",
"type": "number",
"required": false,
"presentable": false,
"unique": false,
"options": {
"min": null,
"max": null,
"noDecimal": false
}
}))
collection.schema.addField(
new SchemaField({
system: false,
id: 'g3qvj4tl',
name: 'secondsthismonth',
type: 'number',
required: false,
presentable: false,
unique: false,
options: {
min: null,
max: null,
noDecimal: false,
},
}),
)
// remove
collection.schema.removeField("mkmeisox")
collection.schema.removeField('mkmeisox')
// remove
collection.schema.removeField("wqw6fejd")
collection.schema.removeField('wqw6fejd')
return dao.saveCollection(collection)
})
},
)

View File

@ -1,174 +1,195 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = function(target, all) {
for(var name in all)__defProp(target, name, {
'use strict'
var __defProp = Object.defineProperty
var __getOwnPropDesc = Object.getOwnPropertyDescriptor
var __getOwnPropNames = Object.getOwnPropertyNames
var __hasOwnProp = Object.prototype.hasOwnProperty
var __export = function (target, all) {
for (var name in all)
__defProp(target, name, {
get: all[name],
enumerable: true
});
};
var __copyProps = function(to, from, except, desc) {
if (from && typeof from === "object" || typeof from === "function") {
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
enumerable: true,
})
}
var __copyProps = function (to, from, except, desc) {
if ((from && typeof from === 'object') || typeof from === 'function') {
var _iteratorNormalCompletion = true,
_didIteratorError = false,
_iteratorError = undefined
try {
var _loop = function() {
var key = _step.value;
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
get: function() {
return from[key];
var _loop = function () {
var key = _step.value
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, {
get: function () {
return from[key]
},
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
};
for(var _iterator = __getOwnPropNames(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
enumerable:
!(desc = __getOwnPropDesc(from, key)) || desc.enumerable,
})
}
for (
var _iterator = __getOwnPropNames(from)[Symbol.iterator](), _step;
!(_iteratorNormalCompletion = (_step = _iterator.next()).done);
_iteratorNormalCompletion = true
)
_loop()
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally{
_didIteratorError = true
_iteratorError = err
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return != null) {
_iterator.return();
_iterator.return()
}
} finally{
} finally {
if (_didIteratorError) {
throw _iteratorError;
throw _iteratorError
}
}
}
}
return to;
};
var __toCommonJS = function(mod) {
return __copyProps(__defProp({}, "__esModule", {
value: true
}), mod);
};
return to
}
var __toCommonJS = function (mod) {
return __copyProps(
__defProp({}, '__esModule', {
value: true,
}),
mod,
)
}
// src/hooks/src/lib.ts
var lib_exports = {};
var lib_exports = {}
__export(lib_exports, {
_getRecord: function() {
return _getRecord;
_getRecord: function () {
return _getRecord
},
_unsafe_assert: function() {
return assert;
_unsafe_assert: function () {
return assert
},
endOfMonth: function() {
return endOfMonth;
endOfMonth: function () {
return endOfMonth
},
forEach: function() {
return forEach;
forEach: function () {
return forEach
},
getInstance: function() {
return getInstance;
getInstance: function () {
return getInstance
},
getUser: function() {
return getUser;
getUser: function () {
return getUser
},
newModel: function() {
return newModel;
newModel: function () {
return newModel
},
queryOne: function() {
return queryOne;
queryOne: function () {
return queryOne
},
startOfMonth: function() {
return startOfMonth;
startOfMonth: function () {
return startOfMonth
},
updateInstance: function() {
return updateInstance;
updateInstance: function () {
return updateInstance
},
updateUser: function() {
return updateUser;
}
});
module.exports = __toCommonJS(lib_exports);
updateUser: function () {
return updateUser
},
})
module.exports = __toCommonJS(lib_exports)
// src/util/assert.ts
function assert(v, msg) {
if (!v) {
throw new Error(msg || "Assertion failure");
throw new Error(msg || 'Assertion failure')
}
}
// ../../node_modules/@s-libs/micro-dash/fesm2015/micro-dash.mjs
function forEach(collection, iteratee) {
if (Array.isArray(collection)) {
forEachOfArray(collection, iteratee);
forEachOfArray(collection, iteratee)
} else {
forOwnOfNonArray(collection, iteratee);
forOwnOfNonArray(collection, iteratee)
}
return collection;
return collection
}
function forEachOfArray(array, iteratee) {
for(var i = 0, len = array.length; i < len; ++i){
for (var i = 0, len = array.length; i < len; ++i) {
if (iteratee(array[i], i) === false) {
break;
break
}
}
}
function keysOfNonArray(object) {
return object ? Object.getOwnPropertyNames(object) : [];
return object ? Object.getOwnPropertyNames(object) : []
}
function forOwnOfNonArray(object, iteratee) {
forEachOfArray(keysOfNonArray(object), function(key) {
return iteratee(object[key], key);
});
return object;
forEachOfArray(keysOfNonArray(object), function (key) {
return iteratee(object[key], key)
})
return object
}
// src/hooks/src/lib.ts
var newModel = function(schema) {
return new DynamicModel(schema);
};
var newModel = function (schema) {
return new DynamicModel(schema)
}
function endOfMonth(now) {
return new Date(now.getFullYear(), now.getMonth() + 1, 0).toISOString();
return new Date(now.getFullYear(), now.getMonth() + 1, 0).toISOString()
}
function startOfMonth(now) {
return new Date(now.getFullYear(), now.getMonth(), 1).toISOString();
return new Date(now.getFullYear(), now.getMonth(), 1).toISOString()
}
var dao = function () {
var _dao = $app.dao()
assert(_dao)
return _dao
}
var queryOne = function (sql, bindings, defaultResult) {
var _dao_db_newQuery_bind, _dao_db_newQuery
var result = newModel(defaultResult)
;(_dao_db_newQuery = dao().db().newQuery(sql)) === null ||
_dao_db_newQuery === void 0
? void 0
: (_dao_db_newQuery_bind = _dao_db_newQuery.bind(bindings)) === null ||
_dao_db_newQuery_bind === void 0
? void 0
: _dao_db_newQuery_bind.one(result)
return result
}
var _getRecord = function (name, id) {
var record = dao().findRecordById(name, id)
return record
}
var getInstance = function (instanceId) {
return _getRecord('instances', instanceId)
}
var getUser = function (userId) {
return _getRecord('users', userId)
}
var dao = function() {
var _dao = $app.dao();
assert(_dao);
return _dao;
};
var queryOne = function(sql, bindings, defaultResult) {
var _dao_db_newQuery_bind, _dao_db_newQuery;
var result = newModel(defaultResult);
(_dao_db_newQuery = dao().db().newQuery(sql)) === null || _dao_db_newQuery === void 0 ? void 0 : (_dao_db_newQuery_bind = _dao_db_newQuery.bind(bindings)) === null || _dao_db_newQuery_bind === void 0 ? void 0 : _dao_db_newQuery_bind.one(result);
return result;
};
var _getRecord = function(name, id) {
var record = dao().findRecordById(name, id);
return record;
};
var getInstance = function(instanceId) {
return _getRecord("instances", instanceId);
};
var getUser = function(userId) {
return _getRecord("users", userId);
};
function _updateRecord(record, fields) {
forEach(fields, function(v, k) {
record.set(k, v);
});
dao().saveRecord(record);
forEach(fields, function (v, k) {
record.set(k, v)
})
dao().saveRecord(record)
}
function _getRecordByIdOrRecord(recordOrInstanceId, name) {
var record = function() {
if (typeof recordOrInstanceId === "string") return _getRecord(name, recordOrInstanceId);
return recordOrInstanceId;
}();
assert(record);
return record;
var record = (function () {
if (typeof recordOrInstanceId === 'string')
return _getRecord(name, recordOrInstanceId)
return recordOrInstanceId
})()
assert(record)
return record
}
function updateInstance(recordOrInstanceId, fields) {
var record = _getRecordByIdOrRecord(recordOrInstanceId, "instances");
_updateRecord(record, fields);
var record = _getRecordByIdOrRecord(recordOrInstanceId, 'instances')
_updateRecord(record, fields)
}
function updateUser(recordOrUserId, fields) {
var record = _getRecordByIdOrRecord(recordOrUserId, "users");
_updateRecord(record, fields);
var record = _getRecordByIdOrRecord(recordOrUserId, 'users')
_updateRecord(record, fields)
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
0 &&
(module.exports = {
_getRecord: _getRecord,
_unsafe_assert: _unsafe_assert,
endOfMonth: endOfMonth,
@ -179,5 +200,5 @@ function updateUser(recordOrUserId, fields) {
queryOne: queryOne,
startOfMonth: startOfMonth,
updateInstance: updateInstance,
updateUser: updateUser
});
updateUser: updateUser,
})

View File

@ -1,45 +1,60 @@
"use strict";
'use strict'
// src/hooks/src/update-usage.pb.ts
console.log("update-usage");
onRecordAfterUpdateRequest(function(e) {
var _require = require("".concat(__hooks, "/lib.js")), _unsafe_assert = _require._unsafe_assert, startOfMonth = _require.startOfMonth, endOfMonth = _require.endOfMonth, queryOne = _require.queryOne, updateInstance = _require.updateInstance, getInstance = _require.getInstance, updateUser = _require.updateUser;
var assert = _unsafe_assert;
var record = e.record;
assert(record, "Expected record here");
var instanceId = record.getString("instanceId");
var instance = getInstance(instanceId);
assert(instance);
var uid = instance.getString("uid");
assert(uid);
var now = /* @__PURE__ */ new Date();
var startIso = startOfMonth(now);
var endIso = endOfMonth(now);
console.log('update-usage')
onRecordAfterUpdateRequest(function (e) {
var _require = require(''.concat(__hooks, '/lib.js')),
_unsafe_assert = _require._unsafe_assert,
startOfMonth = _require.startOfMonth,
endOfMonth = _require.endOfMonth,
queryOne = _require.queryOne,
updateInstance = _require.updateInstance,
getInstance = _require.getInstance,
updateUser = _require.updateUser
var assert = _unsafe_assert
var record = e.record
assert(record, 'Expected record here')
var instanceId = record.getString('instanceId')
var instance = getInstance(instanceId)
assert(instance)
var uid = instance.getString('uid')
assert(uid)
var now = /* @__PURE__ */ new Date()
var startIso = startOfMonth(now)
var endIso = endOfMonth(now)
{
var result = queryOne(
'SELECT cast(sum(totalSeconds) as int) as t FROM invocations WHERE instanceId={:instanceId} and startedAt>={:startIso} and startedAt<={:endIso}',
{
var result = queryOne("SELECT cast(sum(totalSeconds) as int) as t FROM invocations WHERE instanceId={:instanceId} and startedAt>={:startIso} and startedAt<={:endIso}", {
instanceId: instanceId,
startIso: startIso,
endIso: endIso
}, {
t: 0
});
var secondsThisMonth = result.t;
console.log("Instance seconds, ".concat(secondsThisMonth));
endIso: endIso,
},
{
t: 0,
},
)
var secondsThisMonth = result.t
console.log('Instance seconds, '.concat(secondsThisMonth))
updateInstance(instance, {
secondsThisMonth: secondsThisMonth
});
secondsThisMonth: secondsThisMonth,
})
}
{
var result1 = queryOne("SELECT cast(sum(totalSeconds) as int) as t FROM invocations WHERE uid={:uid} and startedAt>={:startIso} and startedAt<={:endIso}", {
var result1 = queryOne(
'SELECT cast(sum(totalSeconds) as int) as t FROM invocations WHERE uid={:uid} and startedAt>={:startIso} and startedAt<={:endIso}',
{
uid: uid,
startIso: startIso,
endIso: endIso
}, {
t: 0
});
var secondsThisMonth1 = result1.t;
console.log("User seconds, ".concat(secondsThisMonth1));
endIso: endIso,
},
{
t: 0,
},
)
var secondsThisMonth1 = result1.t
console.log('User seconds, '.concat(secondsThisMonth1))
updateUser(uid, {
secondsThisMonth: secondsThisMonth1
});
secondsThisMonth: secondsThisMonth1,
})
}
}, "invocations");
}, 'invocations')

View File

@ -7,7 +7,10 @@
export let alertType: AlertTypes = AlertTypes.Warning
</script>
<div class="alert alert-{alertType} d-flex gap-3 align-items-center" role="alert">
<div
class="alert alert-{alertType} d-flex gap-3 align-items-center"
role="alert"
>
{#if icon}
<i class={icon} />
{/if}

View File

@ -14,13 +14,19 @@
</div>
<div>
{#if title}<h5 class="card-title {!subtitle && 'mb-0'}">{title}</h5>{/if}
{#if subtitle}<h6 class="card-subtitle mb-0 text-muted">{subtitle}</h6>{/if}
{#if title}<h5 class="card-title {!subtitle && 'mb-0'}">
{title}
</h5>{/if}
{#if subtitle}<h6 class="card-subtitle mb-0 text-muted">
{subtitle}
</h6>{/if}
</div>
</div>
{:else}
{#if title}<h5 class="card-title">{title}</h5>{/if}
{#if subtitle}<h6 class="card-subtitle mb-2 text-muted">{subtitle}</h6>{/if}
{#if subtitle}<h6 class="card-subtitle mb-2 text-muted">
{subtitle}
</h6>{/if}
{/if}
<slot />

View File

@ -13,7 +13,10 @@
}
// Array of Questions, if the boolean <collapsed> is set to false, the answer is displayed
const questions: Question[] = faq.outline.map((q: rawQ) => ({ ...q, collapsed: true }))
const questions: Question[] = faq.outline.map((q: rawQ) => ({
...q,
collapsed: true,
}))
</script>
<div class="accordion w-100">

View File

@ -6,9 +6,11 @@
// https://getbootstrap.com/docs/5.2/components/tooltips/#enable-tooltips
afterNavigate(() => {
if (browser) {
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
const tooltipTriggerList = document.querySelectorAll(
'[data-bs-toggle="tooltip"]',
)
const tooltipList = [...tooltipTriggerList].map(
(tooltipTriggerEl) => new bootstrap.Tooltip(tooltipTriggerEl)
(tooltipTriggerEl) => new bootstrap.Tooltip(tooltipTriggerEl),
)
}
})

View File

@ -13,13 +13,14 @@
let formError: string = ''
let isFormButtonDisabled: boolean = true
$: isFormButtonDisabled = email.length === 0 || password.length === 0 || instanceName.length === 0
$: isFormButtonDisabled =
email.length === 0 || password.length === 0 || instanceName.length === 0
let isProcessing: boolean = false
// Fun quotes when waiting for the instance to load. This could take up to 10 seconds
let processingQuotesArray = [
'Did you know it takes fourteen sentient robots to create each instance on PocketHost?'
'Did you know it takes fourteen sentient robots to create each instance on PocketHost?',
]
let processingQuote = getRandomElementFromArray(processingQuotesArray)
@ -34,9 +35,14 @@
isFormButtonDisabled = true
isProcessing = true
await handleInstanceGeneratorWidget(email, password, instanceName, (error) => {
await handleInstanceGeneratorWidget(
email,
password,
instanceName,
(error) => {
formError = error
})
},
)
isFormButtonDisabled = false
@ -116,7 +122,11 @@
<div class="col-lg-6 col-12">
<div class="mb-3 mb-lg-3 text-lg-start text-center">
<button type="submit" class="btn btn-primary" disabled={isFormButtonDisabled}>
<button
type="submit"
class="btn btn-primary"
disabled={isFormButtonDisabled}
>
Create <i class="bi bi-arrow-right-short" />
</button>
</div>

View File

@ -10,7 +10,11 @@
<header class="container-fluid">
<nav class="navbar navbar-expand-md">
<a href="/" class="logo text-decoration-none d-flex align-items-center">
<img src="/images/logo-square.png" alt="PocketHost Logo" class="img-fluid" />
<img
src="/images/logo-square.png"
alt="PocketHost Logo"
class="img-fluid"
/>
<h1>Pocket<span>Host</span></h1>
<sup class="">{PUBLIC_POCKETHOST_VERSION}</sup>
</a>
@ -51,8 +55,10 @@
<ul class="dropdown-menu dropdown-menu-end">
<li>
<button class="dropdown-item" type="button" on:click={handleLogoutAndRedirect}
>Logout</button
<button
class="dropdown-item"
type="button"
on:click={handleLogoutAndRedirect}>Logout</button
>
</li>
</ul>
@ -71,11 +77,15 @@
{#if !$isUserLoggedIn}
<li class="nav-item">
<a class="nav-link text-md-start text-center" href="/signup">Sign up</a>
<a class="nav-link text-md-start text-center" href="/signup"
>Sign up</a
>
</li>
<li class="nav-item">
<a class="nav-link text-md-start text-center" href="/login">Log in</a>
<a class="nav-link text-md-start text-center" href="/login"
>Log in</a
>
</li>
{/if}
</AuthStateGuard>
@ -114,7 +124,8 @@
title="Link to our Github Project"
rel="noopener"
>
<i class="bi bi-github" /><span class="nav-github-link">Github</span>
<i class="bi bi-github" /><span class="nav-github-link">Github</span
>
</a>
</li>

View File

@ -41,7 +41,9 @@
$: if (status) handleBadgeColor()
</script>
<div class={`badge ${badgeColor} ${status === 'running' && 'pulse'}`}>{status}</div>
<div class={`badge ${badgeColor} ${status === 'running' && 'pulse'}`}>
{status}
</div>
<style lang="scss">
.pulse {

View File

@ -12,10 +12,15 @@
<style>
.homepage-hero-animation {
box-shadow: var(--bs-primary) 0 0 0 3px inset, var(--bs-body-bg) 10px -10px 0px -3px,
var(--bs-success) 10px -10px, var(--bs-body-bg) 20px -20px 0px -3px,
var(--bs-warning) 20px -20px, var(--bs-body-bg) 30px -30px 0px -3px,
var(--bs-orange) 30px -30px, var(--bs-body-bg) 40px -40px 0px -3px,
box-shadow:
var(--bs-primary) 0 0 0 3px inset,
var(--bs-body-bg) 10px -10px 0px -3px,
var(--bs-success) 10px -10px,
var(--bs-body-bg) 20px -20px 0px -3px,
var(--bs-warning) 20px -20px,
var(--bs-body-bg) 30px -30px 0px -3px,
var(--bs-orange) 30px -30px,
var(--bs-body-bg) 40px -40px 0px -3px,
var(--bs-danger) 40px -40px;
border: 0;
border-radius: 25px;

View File

@ -6,7 +6,7 @@
ThemeNames,
currentIcon,
getCurrentTheme,
setCurrentTheme
setCurrentTheme,
} from './helpers/theme'
// This can change the CSS a bit depending on where the theme toggle is rendered
@ -22,7 +22,10 @@
// Alternate the theme values on toggle click
const handleClick = () => {
const newTheme = getCurrentTheme() === ThemeNames.Light ? ThemeNames.Dark : ThemeNames.Light
const newTheme =
getCurrentTheme() === ThemeNames.Light
? ThemeNames.Dark
: ThemeNames.Light
updateTheme(newTheme)
}

View File

@ -32,7 +32,9 @@
{#if $isUserLoggedIn && !$isUserVerified}
<div class="container py-3">
<AlertBar alertType={defaultAlertBarType}>
<div class="d-flex flex-wrap align-items-center justify-content-center gap-3">
<div
class="d-flex flex-wrap align-items-center justify-content-center gap-3"
>
<i class="bi bi-envelope-exclamation" />
<div>Please verify your account by clicking the link in your email</div>
@ -43,8 +45,10 @@
Sent!
</div>
{:else}
<button type="button" class="btn btn-outline-secondary" on:click={handleClick}
>Resend Email</button
<button
type="button"
class="btn btn-outline-secondary"
on:click={handleClick}>Resend Email</button
>
{/if}
</div>

View File

@ -11,7 +11,9 @@
.find((row) => row.startsWith('theme='))
?.split('=')?.[1] || 'light'
document.querySelector('html')?.setAttribute(THEME_ATTRIBUTE, currentTheme)
document
.querySelector('html')
?.setAttribute(THEME_ATTRIBUTE, currentTheme)
const theme = document.querySelector('#hljs-link')
if (currentTheme === 'light') {
theme.href =

View File

@ -17,7 +17,9 @@
/>
</div>
<a href="/" class="btn btn-light"><i class="bi bi-arrow-left-short" /> Back to Home</a>
<a href="/" class="btn btn-light"
><i class="bi bi-arrow-left-short" /> Back to Home</a
>
</div>
<style>

View File

@ -17,8 +17,8 @@
<h2>Deploy <span>PocketBase</span> in 30 seconds</h2>
<p class="mb-5">
Spend less time on configuring your backend, and more time building new features for your
web app.
Spend less time on configuring your backend, and more time building new
features for your web app.
</p>
<AuthStateGuard>
@ -48,10 +48,15 @@
<div class="row">
<div class="col-12 col-md-6 col-lg-4 mb-4">
<FeatureCard title="Up in 30 seconds" icon="bi bi-stopwatch" fullHeight={true}>
<FeatureCard
title="Up in 30 seconds"
icon="bi bi-stopwatch"
fullHeight={true}
>
<p>
A backend for your next app is as fast as signing up. No provisioning servers, no Docker
fiddling, just B(ad)aaS productivity.
A backend for your next app is as fast as signing up. No
provisioning servers, no Docker fiddling, just B(ad)aaS
productivity.
</p>
<ul>
@ -63,10 +68,15 @@
</div>
<div class="col-12 col-md-6 col-lg-4 mb-4">
<FeatureCard title="Zero Config" icon="bi bi-check-lg" fullHeight={true}>
<FeatureCard
title="Zero Config"
icon="bi bi-check-lg"
fullHeight={true}
>
<p>
With PocketHost, batteries are included. You get a database, outgoing email, SSL,
authentication, cloud functions, and high concurrency all in one stop.
With PocketHost, batteries are included. You get a database,
outgoing email, SSL, authentication, cloud functions, and high
concurrency all in one stop.
</p>
</FeatureCard>
</div>
@ -74,7 +84,8 @@
<div class="col-12 col-md-6 col-lg-4 mb-4">
<FeatureCard title="Database" icon="bi bi-hdd-stack" fullHeight={true}>
<p>
Your PocketHost instance is powered by its own internal SQLite instance. SQLite is <a
Your PocketHost instance is powered by its own internal SQLite
instance. SQLite is <a
href="https://pocketbase.io/faq/"
target="_blank">more performant than mySQL or Postgres</a
>
@ -89,10 +100,9 @@
<div class="col-12 col-md-6 col-lg-3 mb-4">
<FeatureCard title="Auth" icon="bi bi-shield-lock" fullHeight={true}>
<p>
Email and oAuth authentication options work out of the box. Send transactional email to
your users from our verified domain and your custom address <code
>yoursubdomain@{PUBLIC_APP_DOMAIN}</code
>.
Email and oAuth authentication options work out of the box. Send
transactional email to your users from our verified domain and your
custom address <code>yoursubdomain@{PUBLIC_APP_DOMAIN}</code>.
</p>
</FeatureCard>
</div>
@ -100,42 +110,63 @@
<div class="col-12 col-md-6 col-lg-3 mb-4">
<FeatureCard title="Storage" icon="bi bi-archive" fullHeight={true}>
<p>
PocketHost securely stores your files on Amazon S3, or you can use your own key to
manage your own storage.
PocketHost securely stores your files on Amazon S3, or you can use
your own key to manage your own storage.
</p>
</FeatureCard>
</div>
<div class="col-12 col-md-6 col-lg-3 mb-4">
<FeatureCard title="Room to Grow" icon="bi bi-cloud-arrow-up" fullHeight={true}>
<p>PocketHost is perfect for hobbist, low, and medium volume sites and apps.</p>
<FeatureCard
title="Room to Grow"
icon="bi bi-cloud-arrow-up"
fullHeight={true}
>
<p>
PocketHost, and the underlying PocketBase, can scale to well over 10,000 simultaneous
connections.
PocketHost is perfect for hobbist, low, and medium volume sites and
apps.
</p>
<p>
PocketHost, and the underlying PocketBase, can scale to well over
10,000 simultaneous connections.
</p>
</FeatureCard>
</div>
<div class="col-12 col-md-6 col-lg-3 mb-4">
<FeatureCard title="Self-host" icon="bi bi-house-door" fullHeight={true}>
<FeatureCard
title="Self-host"
icon="bi bi-house-door"
fullHeight={true}
>
<p>
When you're ready to take your project in-house, we have you covered. You can export
your entire PocketHost environment along with a Dockerfile to run it.
When you're ready to take your project in-house, we have you
covered. You can export your entire PocketHost environment along
with a Dockerfile to run it.
</p>
</FeatureCard>
</div>
<div class="col-12 col-md-6 col-lg-6 mb-4">
<FeatureCard title="Open Source Stack" icon="bi bi-code-slash" fullHeight={true}>
<FeatureCard
title="Open Source Stack"
icon="bi bi-code-slash"
fullHeight={true}
>
<p>
PocketHost is powered by Svelte, Vite, Typescript, PocketBase, and SQLite. Because the
entire stack is open source, you'll never be locked into the whims of a vendor.
PocketHost is powered by Svelte, Vite, Typescript, PocketBase, and
SQLite. Because the entire stack is open source, you'll never be
locked into the whims of a vendor.
</p>
</FeatureCard>
</div>
<div class="col-12 col-md-6 col-lg-6 mb-4">
<FeatureCard title="Coming Soon" icon="bi bi-card-checklist" fullHeight={true}>
<FeatureCard
title="Coming Soon"
icon="bi bi-card-checklist"
fullHeight={true}
>
<ul>
<li>JS/TS cloud functions</li>
<li>Deploy to Fly.io</li>
@ -170,7 +201,7 @@
background-image: var(--gradient-white-lime);
}
.section{
.section {
padding: 120px 0;
}
.section h2 {

View File

@ -14,10 +14,13 @@
<div>
<h3>Maintenance Mode</h3>
<p class="text-danger">
Your PocketHost instance will not be accessible while in maintenance mode. Use this when you are
upgrading, downgrading, or backing up your data. See <a
href="https://pockethost.gitbook.io/manual/daily-usage/maintenance">Maintenance Mode</a
Your PocketHost instance will not be accessible while in maintenance mode.
Use this when you are upgrading, downgrading, or backing up your data. See <a
href="https://pockethost.gitbook.io/manual/daily-usage/maintenance"
>Maintenance Mode</a
> for more information.
</p>
<MiniToggle value={maintenance} save={onMaintenance}>Maintenance Mode</MiniToggle>
<MiniToggle value={maintenance} save={onMaintenance}
>Maintenance Mode</MiniToggle
>
</div>

View File

@ -14,9 +14,11 @@
<div>
<h3>Rename Instance</h3>
<p class="text-danger">
Warning - renaming your instance will cause it to become inaccessible by the old instance name.
You also may not be able to change it back if someone else choose it. See <a
href="https://pockethost.gitbook.io/manual/daily-usage/rename-instance">renaming</a
Warning - renaming your instance will cause it to become inaccessible by the
old instance name. You also may not be able to change it back if someone
else choose it. See <a
href="https://pockethost.gitbook.io/manual/daily-usage/rename-instance"
>renaming</a
> for more information.
</p>
<MiniEdit value={subdomain} save={onRename} />

View File

@ -1,21 +1,38 @@
<!-- describe the graphics included throughout the project -->
<svg viewBox="0 0 100 100" width="40" height="40" style="display: none;">
<symbol id="add">
<g fill="none" stroke="currentColor" stroke-width="7" stroke-linecap="round">
<g
fill="none"
stroke="currentColor"
stroke-width="7"
stroke-linecap="round"
>
<path d="M 50 35 v 30 m -15 -15 h 30"></path>
</g>
</symbol>
<symbol id="create">
<g fill="none" stroke="currentColor" stroke-width="7" stroke-linecap="round">
<g
fill="none"
stroke="currentColor"
stroke-width="7"
stroke-linecap="round"
>
<g transform="translate(76 24)">
<path d="M -20 0 h -37.5 a 15 15 0 0 0 -15 15 v 42.5 a 15 15 0 0 0 15 15 h 42.5 a 15 15 0 0 0 15 -15 v -37.5"></path>
<path
d="M -20 0 h -37.5 a 15 15 0 0 0 -15 15 v 42.5 a 15 15 0 0 0 15 15 h 42.5 a 15 15 0 0 0 15 -15 v -37.5"
></path>
<circle cx="0" cy="0" r="20"></circle>
<path stroke-width="5" d="M 0 -7 v 14 m -7 -7 h 14"></path>
</g>
</g>
</symbol>
<symbol id="list">
<g fill="none" stroke="currentColor" stroke-width="7" stroke-linecap="round">
<g
fill="none"
stroke="currentColor"
stroke-width="7"
stroke-linecap="round"
>
<path d="M 50 35 h 20"></path>
<path d="M 30 50 h 40"></path>
<path d="M 30 65 h 20"></path>
@ -24,14 +41,24 @@
<symbol id="delete">
<g transform="translate(50 50)">
<g transform="rotate(45)">
<g fill="none" stroke="currentColor" stroke-width="10" stroke-linecap="round">
<g
fill="none"
stroke="currentColor"
stroke-width="10"
stroke-linecap="round"
>
<path d="M 0 -20 v 40 m -20 -20 h 40"></path>
</g>
</g>
</g>
</symbol>
<symbol id="highlight">
<g fill="none" stroke="currentColor" stroke-width="7" stroke-linecap="round">
<g
fill="none"
stroke="currentColor"
stroke-width="7"
stroke-linecap="round"
>
<path d="M 35 65 v -7.5"></path>
<path d="M 50 65 v -15"></path>
<path d="M 65 65 v -30"></path>

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -19,11 +19,13 @@
<div>
<h3>Version Lock</h3>
<p class="text-danger">
Warning - changing your version number should only be done when the instance is in maintenance
mode and you have already done a fresh backup. Depending on the upgrade/downgrade you are
performing, your instance may become inoperable. If that happens, you may need to manually
upgrade your database locally. See <a
href="https://pockethost.gitbook.io/manual/daily-usage/upgrading">upgrading</a
Warning - changing your version number should only be done when the instance
is in maintenance mode and you have already done a fresh backup. Depending
on the upgrade/downgrade you are performing, your instance may become
inoperable. If that happens, you may need to manually upgrade your database
locally. See <a
href="https://pockethost.gitbook.io/manual/daily-usage/upgrading"
>upgrading</a
> for more information. name.
</p>
Version <MiniEdit value={_version} save={saveEdit} disabled={!maintenance} />

View File

@ -47,7 +47,12 @@
</div>
<div class="col-auto pe-1 position-relative">
<input type="text" id="instance-name" class="form-control" bind:value={instanceName} />
<input
type="text"
id="instance-name"
class="form-control"
bind:value={instanceName}
/>
<button
aria-label="Regenerate Instance Name"
@ -70,9 +75,15 @@
{/if}
<div class="text-center">
<a href="/dashboard" class="btn btn-light" disabled={isFormButtonDisabled}>Cancel</a>
<a href="/dashboard" class="btn btn-light" disabled={isFormButtonDisabled}
>Cancel</a
>
<button class="btn btn-primary" disabled={isFormButtonDisabled} on:click={handleSubmit}>
<button
class="btn btn-primary"
disabled={isFormButtonDisabled}
on:click={handleSubmit}
>
Create <i class="bi bi-arrow-right-short" />
</button>
</div>

View File

@ -9,7 +9,7 @@
logger,
type InstanceFields,
type InstanceId,
type InstanceRecordsById
type InstanceRecordsById,
} from '@pockethost/common'
import { values } from '@s-libs/micro-dash'
import { onDestroy, onMount } from 'svelte'
@ -64,7 +64,9 @@
{#each values($instancesStore) as app}
<div class="col-xl-4 col-md-6 col-12 mb-5">
<div class="card">
<div class="server-status d-flex align-items-center justify-content-between">
<div
class="server-status d-flex align-items-center justify-content-between"
>
<div class="server-status-minutes">
Usage: {Math.ceil(app.secondsThisMonth / 60)} mins
{#if app.maintenance}
@ -72,7 +74,9 @@
{/if}
</div>
<div class="d-flex align-items-center gap-3 server-status-minutes">
<div
class="d-flex align-items-center gap-3 server-status-minutes"
>
{app.version}
<ProvisioningStatus status={app.status} />
</div>
@ -91,7 +95,11 @@
href={`https://${app.subdomain}.${PUBLIC_APP_DOMAIN}/_`}
target="_blank"
>
<img src="/images/pocketbase-logo.svg" alt="PocketBase Logo" class="img-fluid" />
<img
src="/images/pocketbase-logo.svg"
alt="PocketBase Logo"
class="img-fluid"
/>
<span>Admin</span>
</a>
</div>
@ -104,8 +112,12 @@
<div class="first-app-screen">
<RetroBoxContainer minHeight={isFirstApplication ? 500 : 0}>
<div class="px-lg-5">
<h2 class="mb-4">Create Your {isFirstApplication ? 'First' : 'Next'} App</h2>
<a href="/app/new" class="btn btn-primary btn-lg"><i class="bi bi-plus" /> New App</a>
<h2 class="mb-4">
Create Your {isFirstApplication ? 'First' : 'Next'} App
</h2>
<a href="/app/new" class="btn btn-primary btn-lg"
><i class="bi bi-plus" /> New App</a
>
</div>
</RetroBoxContainer>
</div>

View File

@ -65,7 +65,11 @@
<AlertBar icon="bi bi-exclamation-triangle-fill" text={formError} />
{/if}
<button type="submit" class="btn btn-primary w-100" disabled={isFormButtonDisabled}>
<button
type="submit"
class="btn btn-primary w-100"
disabled={isFormButtonDisabled}
>
Log In <i class="bi bi-arrow-right-short" />
</button>
</form>

View File

@ -33,7 +33,9 @@
{#if userShouldCheckTheirEmail}
<div class="text-center">
<h2 class="mb-4">Check Your Email</h2>
<p>A verification link has been sent to <br /><strong>{email}</strong></p>
<p>
A verification link has been sent to <br /><strong>{email}</strong>
</p>
<div class="display-1">
<i class="bi bi-envelope-check" />
@ -60,7 +62,11 @@
<AlertBar icon="bi bi-exclamation-triangle-fill" text={formError} />
{/if}
<button type="submit" class="btn btn-primary w-100" disabled={isFormButtonDisabled}>
<button
type="submit"
class="btn btn-primary w-100"
disabled={isFormButtonDisabled}
>
Send Verification Email <i class="bi bi-arrow-right-short" />
</button>
</form>

View File

@ -19,9 +19,13 @@
isFormButtonDisabled = true
if (!token) return
await handleUnauthenticatedPasswordResetConfirm(token, password, (error) => {
await handleUnauthenticatedPasswordResetConfirm(
token,
password,
(error) => {
formError = error
})
},
)
isFormButtonDisabled = false
}
@ -53,7 +57,11 @@
<AlertBar icon="bi bi-exclamation-triangle-fill" text={formError} />
{/if}
<button type="submit" class="btn btn-primary w-100" disabled={isFormButtonDisabled}>
<button
type="submit"
class="btn btn-primary w-100"
disabled={isFormButtonDisabled}
>
Save <i class="bi bi-arrow-right-short" />
</button>
</form>

View File

@ -1,6 +1,10 @@
<script lang="ts">
import AlertBar from '$components/AlertBar.svelte'
import { handleFormError, handleLogin, handleRegistration } from '$util/database'
import {
handleFormError,
handleLogin,
handleRegistration,
} from '$util/database'
let email: string = ''
let password: string = ''
@ -68,7 +72,11 @@
<AlertBar icon="bi bi-exclamation-triangle-fill" text={formError} />
{/if}
<button type="submit" class="btn btn-primary w-100" disabled={isFormButtonDisabled}>
<button
type="submit"
class="btn btn-primary w-100"
disabled={isFormButtonDisabled}
>
Sign Up <i class="bi bi-arrow-right-short" />
</button>
</form>

View File

@ -1,6 +1,7 @@
module.exports = {
title: "PocketHost",
url: "https://pockethost.io/",
language: "en",
description: "Get a PocketBase backend for your next app in under 10 seconds."
title: 'PocketHost',
url: 'https://pockethost.io/',
language: 'en',
description:
'Get a PocketBase backend for your next app in under 10 seconds.',
}

View File

@ -1,6 +1,4 @@
module.exports = {
tags: [
"posts"
],
"layout": "layouts/post.njk",
};
tags: ['posts'],
layout: 'layouts/post.njk',
}

View File

@ -1,6 +1,4 @@
module.exports = {
tags: [
"docs"
],
"layout": "layouts/docs.njk",
};
tags: ['docs'],
layout: 'layouts/docs.njk',
}

View File

@ -1,3 +1,3 @@
module.exports = {
eleventyExcludeFromCollections: true
eleventyExcludeFromCollections: true,
}

View File

@ -3,48 +3,55 @@ function eleventyComputedPermalink() {
// `addGlobalData` acts like a global data file and runs the top level function it receives.
return (data) => {
// Always skip during non-watch/serve builds
if(data.draft && !process.env.BUILD_DRAFTS) {
return false;
if (data.draft && !process.env.BUILD_DRAFTS) {
return false
}
return data.permalink;
return data.permalink
}
};
}
function eleventyComputedExcludeFromCollections() {
// When using `addGlobalData` and you *want* to return a function, you must nest functions like this.
// `addGlobalData` acts like a global data file and runs the top level function it receives.
return (data) => {
// Always exclude from non-watch/serve builds
if(data.draft && !process.env.BUILD_DRAFTS) {
return true;
if (data.draft && !process.env.BUILD_DRAFTS) {
return true
}
return data.eleventyExcludeFromCollections;
return data.eleventyExcludeFromCollections
}
};
}
module.exports.eleventyComputedPermalink = eleventyComputedPermalink;
module.exports.eleventyComputedExcludeFromCollections = eleventyComputedExcludeFromCollections;
module.exports.eleventyComputedPermalink = eleventyComputedPermalink
module.exports.eleventyComputedExcludeFromCollections =
eleventyComputedExcludeFromCollections
module.exports = eleventyConfig => {
eleventyConfig.addGlobalData("eleventyComputed.permalink", eleventyComputedPermalink);
eleventyConfig.addGlobalData("eleventyComputed.eleventyExcludeFromCollections", eleventyComputedExcludeFromCollections);
module.exports = (eleventyConfig) => {
eleventyConfig.addGlobalData(
'eleventyComputed.permalink',
eleventyComputedPermalink,
)
eleventyConfig.addGlobalData(
'eleventyComputed.eleventyExcludeFromCollections',
eleventyComputedExcludeFromCollections,
)
let logged = false;
eleventyConfig.on("eleventy.before", ({runMode}) => {
let text = "Excluding";
let logged = false
eleventyConfig.on('eleventy.before', ({ runMode }) => {
let text = 'Excluding'
// Only show drafts in serve/watch modes
if(runMode === "serve" || runMode === "watch") {
process.env.BUILD_DRAFTS = true;
text = "Including";
if (runMode === 'serve' || runMode === 'watch') {
process.env.BUILD_DRAFTS = true
text = 'Including'
}
// Only log once.
if(!logged) {
console.log( `[11ty/eleventy-base-blog] ${text} drafts.` );
if (!logged) {
console.log(`[11ty/eleventy-base-blog] ${text} drafts.`)
}
logged = true;
});
logged = true
})
}

View File

@ -1,34 +1,37 @@
const path = require("path");
const eleventyImage = require("@11ty/eleventy-img");
const path = require('path')
const eleventyImage = require('@11ty/eleventy-img')
module.exports = eleventyConfig => {
module.exports = (eleventyConfig) => {
function relativeToInputPath(inputPath, relativeFilePath) {
let split = inputPath.split("/");
split.pop();
let split = inputPath.split('/')
split.pop()
return path.resolve(split.join(path.sep), relativeFilePath);
return path.resolve(split.join(path.sep), relativeFilePath)
}
// Eleventy Image shortcode
// https://www.11ty.dev/docs/plugins/image/
eleventyConfig.addAsyncShortcode("image", async function imageShortcode(src, alt, widths, sizes) {
eleventyConfig.addAsyncShortcode(
'image',
async function imageShortcode(src, alt, widths, sizes) {
// Full list of formats here: https://www.11ty.dev/docs/plugins/image/#output-formats
// Warning: Avif can be resource-intensive so take care!
let formats = ["avif", "webp", "auto"];
let file = relativeToInputPath(this.page.inputPath, src);
let formats = ['avif', 'webp', 'auto']
let file = relativeToInputPath(this.page.inputPath, src)
let metadata = await eleventyImage(file, {
widths: widths || ["auto"],
widths: widths || ['auto'],
formats,
outputDir: path.join(eleventyConfig.dir.output, "img"), // Advanced usage note: `eleventyConfig.dir` works here because were using addPlugin.
});
outputDir: path.join(eleventyConfig.dir.output, 'img'), // Advanced usage note: `eleventyConfig.dir` works here because were using addPlugin.
})
// TODO loading=eager and fetchpriority=high
let imageAttributes = {
alt,
sizes,
loading: "lazy",
decoding: "async",
};
return eleventyImage.generateHTML(metadata, imageAttributes);
});
};
loading: 'lazy',
decoding: 'async',
}
return eleventyImage.generateHTML(metadata, imageAttributes)
},
)
}

View File

@ -1,116 +1,119 @@
const { DateTime } = require("luxon");
const markdownItAnchor = require("markdown-it-anchor");
const postcss = require('postcss');
const tailwindcss = require('tailwindcss');
const autoprefixer = require('autoprefixer');
const util = require('util');
const { DateTime } = require('luxon')
const markdownItAnchor = require('markdown-it-anchor')
const postcss = require('postcss')
const tailwindcss = require('tailwindcss')
const autoprefixer = require('autoprefixer')
const util = require('util')
const pluginRss = require('@11ty/eleventy-plugin-rss')
const pluginSyntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight')
const pluginBundle = require('@11ty/eleventy-plugin-bundle')
const pluginNavigation = require('@11ty/eleventy-navigation')
const { EleventyHtmlBasePlugin } = require('@11ty/eleventy')
const pluginRss = require("@11ty/eleventy-plugin-rss");
const pluginSyntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
const pluginBundle = require("@11ty/eleventy-plugin-bundle");
const pluginNavigation = require("@11ty/eleventy-navigation");
const { EleventyHtmlBasePlugin } = require("@11ty/eleventy");
const pluginDrafts = require('./eleventy.config.drafts.js')
const pluginImages = require('./eleventy.config.images.js')
const pluginDrafts = require("./eleventy.config.drafts.js");
const pluginImages = require("./eleventy.config.images.js");
module.exports = function(eleventyConfig) {
module.exports = function (eleventyConfig) {
// Copy the contents of the `public` folder to the output folder
// For example, `./public/css/` ends up in `_site/css/`
eleventyConfig.addPassthroughCopy({
"./public/": "/",
});
'./public/': '/',
})
eleventyConfig.addNunjucksAsyncFilter('postcss', (cssCode, done) => {
postcss([tailwindcss(require('./tailwind.config.js')), autoprefixer()])
.process(cssCode)
.then(
(r) => done(null, r.css),
(e) => done(e, null)
);
});
(e) => done(e, null),
)
})
eleventyConfig.addWatchTarget('styles/**/*.css');
eleventyConfig.addWatchTarget('styles/**/*.css')
// Run Eleventy when these files change:
// https://www.11ty.dev/docs/watch-serve/#add-your-own-watch-targets
// Watch content images for the image pipeline.
eleventyConfig.addWatchTarget("content/**/*.{svg,webp,png,jpeg}");
eleventyConfig.addWatchTarget('content/**/*.{svg,webp,png,jpeg}')
// App plugins
eleventyConfig.addPlugin(pluginDrafts);
eleventyConfig.addPlugin(pluginImages);
eleventyConfig.addPlugin(pluginDrafts)
eleventyConfig.addPlugin(pluginImages)
// Official plugins
eleventyConfig.addPlugin(pluginRss);
eleventyConfig.addPlugin(pluginRss)
eleventyConfig.addPlugin(pluginSyntaxHighlight, {
preAttributes: { tabindex: 0 }
});
eleventyConfig.addPlugin(pluginNavigation);
eleventyConfig.addPlugin(EleventyHtmlBasePlugin);
eleventyConfig.addPlugin(pluginBundle);
preAttributes: { tabindex: 0 },
})
eleventyConfig.addPlugin(pluginNavigation)
eleventyConfig.addPlugin(EleventyHtmlBasePlugin)
eleventyConfig.addPlugin(pluginBundle)
// Filters
eleventyConfig.addFilter("readableDate", (dateObj, format, zone) => {
eleventyConfig.addFilter('readableDate', (dateObj, format, zone) => {
// Formatting tokens for Luxon: https://moment.github.io/luxon/#/formatting?id=table-of-tokens
return DateTime.fromJSDate(dateObj, { zone: zone || "utc" }).toFormat(format || "dd LLLL yyyy");
});
return DateTime.fromJSDate(dateObj, { zone: zone || 'utc' }).toFormat(
format || 'dd LLLL yyyy',
)
})
eleventyConfig.addFilter('htmlDateString', (dateObj) => {
// dateObj input: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-date-string
return DateTime.fromJSDate(dateObj, {zone: 'utc'}).toFormat('yyyy-LL-dd');
});
return DateTime.fromJSDate(dateObj, { zone: 'utc' }).toFormat('yyyy-LL-dd')
})
// Get the first `n` elements of a collection.
eleventyConfig.addFilter("head", (array, n) => {
if(!Array.isArray(array) || array.length === 0) {
return [];
eleventyConfig.addFilter('head', (array, n) => {
if (!Array.isArray(array) || array.length === 0) {
return []
}
if( n < 0 ) {
return array.slice(n);
if (n < 0) {
return array.slice(n)
}
return array.slice(0, n);
});
return array.slice(0, n)
})
// Return the smallest number argument
eleventyConfig.addFilter("min", (...numbers) => {
return Math.min.apply(null, numbers);
});
eleventyConfig.addFilter('min', (...numbers) => {
return Math.min.apply(null, numbers)
})
// Return all the tags used in a collection
eleventyConfig.addFilter("getAllTags", collection => {
let tagSet = new Set();
for(let item of collection) {
(item.data.tags || []).forEach(tag => tagSet.add(tag));
eleventyConfig.addFilter('getAllTags', (collection) => {
let tagSet = new Set()
for (let item of collection) {
;(item.data.tags || []).forEach((tag) => tagSet.add(tag))
}
return Array.from(tagSet);
});
return Array.from(tagSet)
})
eleventyConfig.addFilter("filterTagList", function filterTagList(tags) {
return (tags || []).filter(tag => ["all", "nav", "post", "posts"].indexOf(tag) === -1);
});
eleventyConfig.addFilter('filterTagList', function filterTagList(tags) {
return (tags || []).filter(
(tag) => ['all', 'nav', 'post', 'posts'].indexOf(tag) === -1,
)
})
eleventyConfig.addFilter('console', function(value) {
const str = util.inspect(value);
eleventyConfig.addFilter('console', function (value) {
const str = util.inspect(value)
return `<div style="white-space: pre-wrap;">${unescape(str)}</div>;`
});
})
// Customize Markdown library settings:
eleventyConfig.amendLibrary("md", mdLib => {
eleventyConfig.amendLibrary('md', (mdLib) => {
mdLib.use(markdownItAnchor, {
permalink: markdownItAnchor.permalink.ariaHidden({
placement: "after",
class: "header-anchor",
symbol: "#",
placement: 'after',
class: 'header-anchor',
symbol: '#',
ariaHidden: false,
}),
level: [1,2,3,4],
slugify: eleventyConfig.getFilter("slugify")
});
});
level: [1, 2, 3, 4],
slugify: eleventyConfig.getFilter('slugify'),
})
})
// Features to make your build faster (when you need them)
@ -123,25 +126,20 @@ module.exports = function(eleventyConfig) {
return {
// Control which files Eleventy will process
// e.g.: *.md, *.njk, *.html, *.liquid
templateFormats: [
"md",
"njk",
"html",
"liquid",
],
templateFormats: ['md', 'njk', 'html', 'liquid'],
// Pre-process *.md files with: (default: `liquid`)
markdownTemplateEngine: "njk",
markdownTemplateEngine: 'njk',
// Pre-process *.html files with: (default: `liquid`)
htmlTemplateEngine: "njk",
htmlTemplateEngine: 'njk',
// These are all optional:
dir: {
input: "content", // default: "."
includes: "../_includes", // default: "_includes"
data: "../_data", // default: "_data"
output: "_site"
input: 'content', // default: "."
includes: '../_includes', // default: "_includes"
data: '../_data', // default: "_data"
output: '_site',
},
// -----------------------------------------------------------------
@ -154,6 +152,6 @@ module.exports = function(eleventyConfig) {
// When paired with the HTML <base> plugin https://www.11ty.dev/docs/plugins/html-base/
// it will transform any absolute URLs in your HTML to include this
// folder name and does **not** affect where things go in the output folder.
pathPrefix: "/",
};
};
pathPrefix: '/',
}
}

View File

@ -1,20 +1,11 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./_includes/**/*.{html,njk,md}",
"./content/**/*.{html,njk,md}",
],
content: ['./_includes/**/*.{html,njk,md}', './content/**/*.{html,njk,md}'],
theme: {
extend: {
},
extend: {},
},
daisyui: {
themes: ["light", "dark"],
themes: ['light', 'dark'],
},
plugins: [
require("@tailwindcss/typography"),
require("daisyui"),
],
plugins: [require('@tailwindcss/typography'), require('daisyui')],
}