wirejs-deploy-amplify-basic 0.1.177 → 0.1.179

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.
@@ -87,9 +87,9 @@ for (const resource of generated) {
87
87
  passwordPolicy: {
88
88
  minLength: 8,
89
89
  requireLowercase: false,
90
- requireNumbers: false,
91
90
  requireSymbols: false,
92
91
  requireUppercase: false,
92
+ requireDigits: false,
93
93
  },
94
94
  selfSignUpEnabled: true,
95
95
  });
@@ -70,6 +70,10 @@ function toJSPath(path) {
70
70
  }
71
71
  }
72
72
 
73
+ function toClientJSPath(pathname) {
74
+ return toJSPath(pathname).replace(/\.js$/, '.client.js');
75
+ }
76
+
73
77
  /**
74
78
  *
75
79
  * @param {http.IncomingMessage} req
@@ -181,7 +185,7 @@ function setResponseDetailsFromContext(context, res) {
181
185
  * @returns
182
186
  */
183
187
  async function trySSRPath(context, res) {
184
- const asJSPath = context.location.pathname.replace(/\.(\w+)$/, '') + '.js';
188
+ const asClientJSPath = toClientJSPath(context.location.pathname);
185
189
  const srcPath = routeSSR(context, 'js');
186
190
  if (!srcPath) return false;
187
191
 
@@ -212,7 +216,7 @@ async function trySSRPath(context, res) {
212
216
 
213
217
  if (hydrationsFound) {
214
218
  const script = doc.parentNode.createElement('script');
215
- script.src = asJSPath;
219
+ script.src = asClientJSPath;
216
220
  doc.parentNode.body.appendChild(script);
217
221
  }
218
222
 
@@ -3,6 +3,6 @@
3
3
  "dependencies": {
4
4
  "jsdom": "^25.0.1",
5
5
  "wirejs-dom": "^1.0.44",
6
- "wirejs-resources": "^0.1.177"
6
+ "wirejs-resources": "^0.1.179"
7
7
  }
8
8
  }
@@ -1 +1 @@
1
- export declare function apiTree(INTERNAL_API_URL: string, path?: string[]): () => void;
1
+ export * from 'wirejs-deploy-aws/client';
@@ -1,79 +1 @@
1
- import * as rt from './realtime.js';
2
- async function callApi(INTERNAL_API_URL, method, ...args) {
3
- function isNode() {
4
- return typeof args[0]?.cookies?.getAll === 'function';
5
- }
6
- function apiUrl() {
7
- if (isNode()) {
8
- return INTERNAL_API_URL + 'api';
9
- }
10
- else {
11
- return "/api";
12
- }
13
- }
14
- let cookieHeader = {};
15
- if (isNode()) {
16
- const context = args[0];
17
- const cookies = context.cookies.getAll();
18
- cookieHeader = typeof cookies === 'object'
19
- ? {
20
- Cookie: Object.entries(cookies).map(kv => kv.join('=')).join('; ')
21
- }
22
- : {};
23
- }
24
- const response = await fetch(apiUrl(), {
25
- method: 'POST',
26
- headers: {
27
- 'Content-Type': 'application/json',
28
- ...cookieHeader
29
- },
30
- body: JSON.stringify([{ method, args: [...args] }]),
31
- });
32
- const body = await response.json();
33
- if (isNode()) {
34
- const context = args[0];
35
- for (const c of response.headers.getSetCookie()) {
36
- const parts = c.split(';').map(p => p.trim());
37
- const flags = parts.slice(1);
38
- const [name, value] = parts[0].split('=').map(decodeURIComponent);
39
- const httpOnly = flags.includes('HttpOnly');
40
- const secure = flags.includes('Secure');
41
- const maxAgePart = flags.find(f => f.startsWith('Max-Age='))?.split('=')[1];
42
- context.cookies.set({
43
- name,
44
- value,
45
- httpOnly,
46
- secure,
47
- maxAge: maxAgePart ? parseInt(maxAgePart) : undefined
48
- });
49
- }
50
- }
51
- const error = body[0].error;
52
- if (error) {
53
- throw new Error(error);
54
- }
55
- const value = body[0].data;
56
- if (typeof value === 'object' && value?.__wjstype === 'realtime') {
57
- return {
58
- subscribe(subscriber) {
59
- rt.subscribe(value.url, value.channel, value.token, value.authHost, subscriber);
60
- return () => {
61
- rt.unsubscribe(value.url, value.channel, subscriber);
62
- };
63
- }
64
- };
65
- }
66
- return value;
67
- }
68
- ;
69
- export function apiTree(INTERNAL_API_URL, path = []) {
70
- return new Proxy(function () { }, {
71
- apply(_target, _thisArg, args) {
72
- return callApi(INTERNAL_API_URL, path, ...args);
73
- },
74
- get(_target, prop) {
75
- return apiTree(INTERNAL_API_URL, [...path, prop]);
76
- }
77
- });
78
- }
79
- ;
1
+ export * from 'wirejs-deploy-aws/client';
package/dist/index.d.ts CHANGED
@@ -1,10 +1 @@
1
- export * from 'wirejs-resources';
2
- export { FileService } from './services/file.js';
3
- export { AuthenticationService } from './services/authentication.js';
4
- export { EmailSender } from './services/email-sender.js';
5
- export { LLM } from './services/llm.js';
6
- export { DistributedTable } from './resources/distributed-table.js';
7
- export { RealtimeService } from './services/realtime.js';
8
- export { BackgroundJob } from './resources/background-job.js';
9
- export { CronJob } from './resources/cron-job.js';
10
- export { Endpoint } from './resources/endpoint.js';
1
+ export * from 'wirejs-deploy-aws';
package/dist/index.js CHANGED
@@ -1,32 +1,2 @@
1
- import { overrides } from 'wirejs-resources';
2
- // let's try exporting all the things and overwriting the specific things we
3
- // want to re-implement.
4
- export * from 'wirejs-resources';
5
- import { FileService } from './services/file.js';
6
- export { FileService } from './services/file.js';
7
- import { AuthenticationService } from './services/authentication.js';
8
- export { AuthenticationService } from './services/authentication.js';
9
- import { EmailSender } from './services/email-sender.js';
10
- export { EmailSender } from './services/email-sender.js';
11
- import { LLM } from './services/llm.js';
12
- export { LLM } from './services/llm.js';
13
- import { DistributedTable } from './resources/distributed-table.js';
14
- export { DistributedTable } from './resources/distributed-table.js';
15
- import { RealtimeService } from './services/realtime.js';
16
- export { RealtimeService } from './services/realtime.js';
17
- import { BackgroundJob } from './resources/background-job.js';
18
- export { BackgroundJob } from './resources/background-job.js';
19
- import { CronJob } from './resources/cron-job.js';
20
- export { CronJob } from './resources/cron-job.js';
21
- import { Endpoint } from './resources/endpoint.js';
22
- export { Endpoint } from './resources/endpoint.js';
23
- // expose resources to other resources that might depend on it.
24
- overrides.AuthenticationService = AuthenticationService;
25
- overrides.BackgroundJob = BackgroundJob;
26
- overrides.CronJob = CronJob;
27
- overrides.DistributedTable = DistributedTable;
28
- overrides.EmailSender = EmailSender;
29
- overrides.Endpoint = Endpoint;
30
- overrides.FileService = FileService;
31
- overrides.LLM = LLM;
32
- overrides.RealtimeService = RealtimeService;
1
+ // Delegate all AWS resource overrides to the shared package.
2
+ export * from 'wirejs-deploy-aws';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wirejs-deploy-amplify-basic",
3
- "version": "0.1.177",
3
+ "version": "0.1.179",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -45,7 +45,8 @@
45
45
  "recursive-copy": "^2.0.14",
46
46
  "rimraf": "^6.0.1",
47
47
  "wirejs-dom": "^1.0.44",
48
- "wirejs-resources": "^0.1.177"
48
+ "wirejs-deploy-aws": "^0.1.179",
49
+ "wirejs-resources": "^0.1.179"
49
50
  },
50
51
  "devDependencies": {
51
52
  "@aws-amplify/backend": "^1.14.0",