cogsbox-sync 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cli.d.ts +1 -0
- package/dist/bin/cli.js +61 -0
- package/dist/index.d.ts +903 -0
- package/dist/index.js +2755 -0
- package/package.json +36 -0
- package/templates/worker/.editorconfig +12 -0
- package/templates/worker/.prettierrc +6 -0
- package/templates/worker/bin/init.ts +53 -0
- package/templates/worker/package-lock.json +4087 -0
- package/templates/worker/package.json +30 -0
- package/templates/worker/schema-processor/Dockerfile +16 -0
- package/templates/worker/schema-processor/package.json +10 -0
- package/templates/worker/schema-processor/server.js +483 -0
- package/templates/worker/schema-processor/serverOldExpress.js +488 -0
- package/templates/worker/src/UserObject.ts +40 -0
- package/templates/worker/src/auth.ts +58 -0
- package/templates/worker/src/index.ts +1860 -0
- package/templates/worker/src/utility.ts +101 -0
- package/templates/worker/test/index.spec.ts +25 -0
- package/templates/worker/test/tsconfig.json +8 -0
- package/templates/worker/tsconfig.json +46 -0
- package/templates/worker/vitest.config.mts +11 -0
- package/templates/worker/worker-configuration.d.ts +7954 -0
- package/templates/worker/wrangler.jsonc +90 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* For more details on how to configure Wrangler, refer to:
|
|
3
|
+
* https://developers.cloudflare.com/workers/wrangler/configuration/
|
|
4
|
+
*/
|
|
5
|
+
{
|
|
6
|
+
"$schema": "node_modules/wrangler/config-schema.json",
|
|
7
|
+
"name": "sync-engine-gateway",
|
|
8
|
+
"main": "src/index.ts",
|
|
9
|
+
"compatibility_date": "2025-02-24",
|
|
10
|
+
"observability": {
|
|
11
|
+
"enabled": true
|
|
12
|
+
},
|
|
13
|
+
"containers": [
|
|
14
|
+
{
|
|
15
|
+
"name": "schema-processor",
|
|
16
|
+
"image": "./schema-processor/Dockerfile",
|
|
17
|
+
"class_name": "SchemaProcessorContainer",
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"durable_objects": {
|
|
21
|
+
"bindings": [
|
|
22
|
+
{
|
|
23
|
+
"name": "WEBSOCKET_SYNC_ENGINE",
|
|
24
|
+
"class_name": "WebSocketSyncEngine"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "USER_PRESENCE",
|
|
28
|
+
"class_name": "UserPresenceDO"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "SCHEMA_PROCESSOR",
|
|
32
|
+
"class_name": "SchemaProcessorContainer"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"migrations": [
|
|
37
|
+
{
|
|
38
|
+
"tag": "v1",
|
|
39
|
+
"new_classes": [
|
|
40
|
+
"WebSocketSyncEngine",
|
|
41
|
+
"UserPresenceDO"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"tag": "v2",
|
|
46
|
+
"new_sqlite_classes": [
|
|
47
|
+
"SchemaProcessorContainer"
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"r2_buckets": [
|
|
52
|
+
{
|
|
53
|
+
"binding": "SCHEMA_STORAGE",
|
|
54
|
+
"bucket_name": "sync-engine-bucket"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"dev": {
|
|
58
|
+
"port": 8789
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Smart Placement
|
|
62
|
+
* Docs: https://developers.cloudflare.com/workers/configuration/smart-placement/#smart-placement
|
|
63
|
+
*/
|
|
64
|
+
// "placement": { "mode": "smart" },
|
|
65
|
+
/**
|
|
66
|
+
* Bindings
|
|
67
|
+
* Bindings allow your Worker to interact with resources on the Cloudflare Developer Platform, including
|
|
68
|
+
* databases, object storage, AI inference, real-time communication and more.
|
|
69
|
+
* https://developers.cloudflare.com/workers/runtime-apis/bindings/
|
|
70
|
+
*/
|
|
71
|
+
/**
|
|
72
|
+
* Environment Variables
|
|
73
|
+
* https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
|
|
74
|
+
*/
|
|
75
|
+
// "vars": { "MY_VARIABLE": "production_value" },
|
|
76
|
+
/**
|
|
77
|
+
* Note: Use secrets to store sensitive data.
|
|
78
|
+
* https://developers.cloudflare.com/workers/configuration/secrets/
|
|
79
|
+
*/
|
|
80
|
+
/**
|
|
81
|
+
* Static Assets
|
|
82
|
+
* https://developers.cloudflare.com/workers/static-assets/binding/
|
|
83
|
+
*/
|
|
84
|
+
// "assets": { "directory": "./public/", "binding": "ASSETS" },
|
|
85
|
+
/**
|
|
86
|
+
* Service Bindings (communicate between multiple Workers)
|
|
87
|
+
* https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
|
|
88
|
+
*/
|
|
89
|
+
// "services": [{ "binding": "MY_SERVICE", "service": "my-service" }]
|
|
90
|
+
}
|