@phpsandbox/sdk 0.3.2 → 0.3.4
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/README.md +38 -0
- package/dist/beacon/index.js +4 -2
- package/dist/beacon/navigator.js +0 -1
- package/dist/beacon/types.d.ts +1 -1
- package/dist/browser/phpsandbox-sdk.esm.js +405 -308
- package/dist/browser/phpsandbox-sdk.esm.min.js +23 -25
- package/dist/browser/phpsandbox-sdk.iife.js +405 -308
- package/dist/browser/phpsandbox-sdk.iife.min.js +8 -10
- package/dist/composer.js +8 -4
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +1 -3
- package/dist/feedback.js +2 -1
- package/dist/filesystem.js +32 -15
- package/dist/identity.d.ts +13 -0
- package/dist/identity.js +6 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +14 -5
- package/dist/integrations/sandbox.js +1 -1
- package/dist/lsp.d.ts +2 -2
- package/dist/lsp.js +2 -2
- package/dist/publication/index.d.ts +1 -0
- package/dist/publication/index.js +1 -0
- package/dist/publication/instance.d.ts +2 -0
- package/dist/publication/instance.js +8 -0
- package/dist/publication/notebook.js +7 -5
- package/dist/publication/resources.js +2 -1
- package/dist/publication/run.js +2 -76
- package/dist/publication/stream.d.ts +18 -0
- package/dist/publication/stream.js +185 -0
- package/dist/runtime/rest.js +2 -1
- package/dist/runtime.js +1 -1
- package/dist/schemas/publications.js +53 -59
- package/dist/servers.d.ts +2 -0
- package/dist/servers.js +5 -1
- package/dist/shell.js +5 -2
- package/dist/socket/index.js +25 -13
- package/dist/telemetry.js +8 -3
- package/dist/terminal.js +3 -4
- package/dist/utils/promise.js +1 -1
- package/dist/utils/websocket.js +2 -2
- package/package.json +49 -33
- package/dist/auth.d.ts +0 -11
- package/dist/auth.js +0 -12
package/package.json
CHANGED
|
@@ -1,30 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phpsandbox/sdk",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"description": "The TypeScript SDK for PHPSandbox cloud development environments",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"cloud",
|
|
7
|
+
"composer",
|
|
8
|
+
"development",
|
|
9
|
+
"laravel",
|
|
10
|
+
"php",
|
|
11
|
+
"sandbox",
|
|
12
|
+
"sdk",
|
|
13
|
+
"typescript"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://github.com/phpsandbox/sdk#readme",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/phpsandbox/sdk/issues"
|
|
18
|
+
},
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"author": "PHPSandbox",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/phpsandbox/sdk.git"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"README.md",
|
|
28
|
+
"LICENSE"
|
|
29
|
+
],
|
|
30
|
+
"type": "module",
|
|
5
31
|
"main": "./dist/index.js",
|
|
6
32
|
"module": "./dist/index.js",
|
|
7
33
|
"types": "./dist/index.d.ts",
|
|
8
|
-
"
|
|
34
|
+
"unpkg": "./dist/browser/phpsandbox-sdk.iife.min.js",
|
|
35
|
+
"jsdelivr": "./dist/browser/phpsandbox-sdk.esm.min.js",
|
|
9
36
|
"exports": {
|
|
10
37
|
".": {
|
|
11
38
|
"types": "./dist/index.d.ts",
|
|
12
39
|
"import": "./dist/index.js",
|
|
13
40
|
"default": "./dist/index.js"
|
|
14
41
|
},
|
|
42
|
+
"./stream": {
|
|
43
|
+
"types": "./dist/publication/stream.d.ts",
|
|
44
|
+
"import": "./dist/publication/stream.js",
|
|
45
|
+
"default": "./dist/publication/stream.js"
|
|
46
|
+
},
|
|
15
47
|
"./beacon": {
|
|
16
48
|
"types": "./dist/beacon/index.d.ts",
|
|
17
49
|
"import": "./dist/beacon/index.js",
|
|
18
50
|
"default": "./dist/beacon/index.js"
|
|
19
51
|
}
|
|
20
52
|
},
|
|
21
|
-
"files": [
|
|
22
|
-
"dist",
|
|
23
|
-
"README.md",
|
|
24
|
-
"LICENSE"
|
|
25
|
-
],
|
|
26
|
-
"unpkg": "./dist/browser/phpsandbox-sdk.iife.min.js",
|
|
27
|
-
"jsdelivr": "./dist/browser/phpsandbox-sdk.esm.min.js",
|
|
28
53
|
"scripts": {
|
|
29
54
|
"build": "npm run build:tsc && npm run build:browser",
|
|
30
55
|
"build:tsc": "tsc",
|
|
@@ -41,30 +66,15 @@
|
|
|
41
66
|
"smoke:reaper": "npm run build:tsc && vitest run --reporter=verbose --config tests/smoke/vitest.config.ts tests/smoke/maintenance/resources.reaper.smoke.ts",
|
|
42
67
|
"smoke:typecheck": "npm run build:tsc && tsc --project tests/smoke/tsconfig.json --noEmit",
|
|
43
68
|
"prepublishOnly": "npm test && npm run clean && npm run build",
|
|
44
|
-
"bumpAndPublish": "npm version patch && npm publish --access public"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"laravel",
|
|
54
|
-
"composer"
|
|
55
|
-
],
|
|
56
|
-
"author": "PHPSandbox",
|
|
57
|
-
"license": "MIT",
|
|
58
|
-
"repository": {
|
|
59
|
-
"type": "git",
|
|
60
|
-
"url": "git+https://github.com/phpsandbox/sdk.git"
|
|
61
|
-
},
|
|
62
|
-
"bugs": {
|
|
63
|
-
"url": "https://github.com/phpsandbox/sdk/issues"
|
|
64
|
-
},
|
|
65
|
-
"homepage": "https://github.com/phpsandbox/sdk#readme",
|
|
66
|
-
"engines": {
|
|
67
|
-
"node": ">=18.0.0"
|
|
69
|
+
"bumpAndPublish": "npm version patch && npm publish --access public",
|
|
70
|
+
"lint": "oxlint --type-aware .",
|
|
71
|
+
"lint:fix": "oxlint --type-aware --fix .",
|
|
72
|
+
"format": "oxfmt --write src tests package.json tsconfig.json vitest.config.ts build.mjs .oxfmtrc.json .oxlintrc.json",
|
|
73
|
+
"format:check": "oxfmt --check src tests package.json tsconfig.json vitest.config.ts build.mjs .oxfmtrc.json .oxlintrc.json",
|
|
74
|
+
"typecheck": "tsc --noEmit",
|
|
75
|
+
"check": "npm run lint && npm run format:check && npm run typecheck && npm run smoke:typecheck && npm test && npm run build && npm pack --dry-run",
|
|
76
|
+
"prelint": "npm run build:tsc",
|
|
77
|
+
"prelint:fix": "npm run build:tsc"
|
|
68
78
|
},
|
|
69
79
|
"dependencies": {
|
|
70
80
|
"@msgpack/msgpack": "^3.1.1",
|
|
@@ -80,8 +90,14 @@
|
|
|
80
90
|
"@types/ws": "^8.18.1",
|
|
81
91
|
"axios": "^1.17.0",
|
|
82
92
|
"esbuild": "^0.27.1",
|
|
93
|
+
"oxfmt": "0.71.0",
|
|
94
|
+
"oxlint": "1.86.0",
|
|
95
|
+
"oxlint-tsgolint": "7.0.2003",
|
|
83
96
|
"playwright": "^1.62.1",
|
|
84
97
|
"typescript": "^5.7.2",
|
|
85
98
|
"vitest": "^4.1.11"
|
|
99
|
+
},
|
|
100
|
+
"engines": {
|
|
101
|
+
"node": ">=18.0.0"
|
|
86
102
|
}
|
|
87
103
|
}
|
package/dist/auth.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Action, NotebookInstance } from './index.js';
|
|
2
|
-
export interface AuthActions {
|
|
3
|
-
'auth.login': Action<{
|
|
4
|
-
runtimeTicket: string;
|
|
5
|
-
}, boolean>;
|
|
6
|
-
}
|
|
7
|
-
export default class Auth {
|
|
8
|
-
protected okra: NotebookInstance;
|
|
9
|
-
constructor(okra: NotebookInstance);
|
|
10
|
-
login(runtimeUrl: string): Promise<boolean>;
|
|
11
|
-
}
|
package/dist/auth.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export default class Auth {
|
|
2
|
-
constructor(okra) {
|
|
3
|
-
this.okra = okra;
|
|
4
|
-
}
|
|
5
|
-
login(runtimeUrl) {
|
|
6
|
-
const runtimeTicket = new URL(runtimeUrl).searchParams.get('ticket');
|
|
7
|
-
if (runtimeTicket === null || runtimeTicket === '') {
|
|
8
|
-
throw new TypeError('The notebook connection does not contain a runtime ticket.');
|
|
9
|
-
}
|
|
10
|
-
return this.okra.invoke('auth.login', { runtimeTicket });
|
|
11
|
-
}
|
|
12
|
-
}
|