@symbo.ls/sdk 3.1.1 → 3.2.3
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 +174 -13
- package/dist/cjs/config/environment.js +32 -42
- package/dist/cjs/index.js +31 -24
- package/dist/cjs/services/AIService.js +3 -3
- package/dist/cjs/services/AuthService.js +44 -3
- package/dist/cjs/services/BasedService.js +530 -24
- package/dist/cjs/services/CollabService.js +420 -0
- package/dist/cjs/services/CoreService.js +2295 -0
- package/dist/cjs/services/SocketService.js +207 -59
- package/dist/cjs/services/SymstoryService.js +135 -49
- package/dist/cjs/services/index.js +8 -16
- package/dist/cjs/state/RootStateManager.js +86 -0
- package/dist/cjs/state/rootEventBus.js +65 -0
- package/dist/cjs/utils/CollabClient.js +157 -0
- package/dist/cjs/utils/TokenManager.js +409 -0
- package/dist/cjs/utils/basedQuerys.js +120 -0
- package/dist/cjs/utils/jsonDiff.js +103 -0
- package/dist/cjs/utils/permission.js +4 -4
- package/dist/cjs/utils/services.js +133 -69
- package/dist/cjs/utils/symstoryClient.js +33 -2
- package/dist/esm/config/environment.js +32 -42
- package/dist/esm/index.js +20586 -11525
- package/dist/esm/services/AIService.js +3 -3
- package/dist/esm/services/AuthService.js +48 -7
- package/dist/esm/services/BasedService.js +676 -65
- package/dist/esm/services/CollabService.js +18028 -0
- package/dist/esm/services/CoreService.js +2827 -0
- package/dist/esm/services/SocketService.js +323 -58
- package/dist/esm/services/SymstoryService.js +287 -111
- package/dist/esm/services/index.js +20456 -11470
- package/dist/esm/state/RootStateManager.js +102 -0
- package/dist/esm/state/rootEventBus.js +47 -0
- package/dist/esm/utils/CollabClient.js +17483 -0
- package/dist/esm/utils/TokenManager.js +395 -0
- package/dist/esm/utils/basedQuerys.js +120 -0
- package/dist/esm/utils/jsonDiff.js +6096 -0
- package/dist/esm/utils/permission.js +4 -4
- package/dist/esm/utils/services.js +133 -69
- package/dist/esm/utils/symstoryClient.js +63 -43
- package/dist/esm/utils/validation.js +89 -19
- package/dist/node/config/environment.js +32 -42
- package/dist/node/index.js +37 -28
- package/dist/node/services/AIService.js +3 -3
- package/dist/node/services/AuthService.js +44 -3
- package/dist/node/services/BasedService.js +531 -25
- package/dist/node/services/CollabService.js +401 -0
- package/dist/node/services/CoreService.js +2266 -0
- package/dist/node/services/SocketService.js +197 -59
- package/dist/node/services/SymstoryService.js +135 -49
- package/dist/node/services/index.js +8 -16
- package/dist/node/state/RootStateManager.js +57 -0
- package/dist/node/state/rootEventBus.js +46 -0
- package/dist/node/utils/CollabClient.js +128 -0
- package/dist/node/utils/TokenManager.js +390 -0
- package/dist/node/utils/basedQuerys.js +120 -0
- package/dist/node/utils/jsonDiff.js +74 -0
- package/dist/node/utils/permission.js +4 -4
- package/dist/node/utils/services.js +133 -69
- package/dist/node/utils/symstoryClient.js +33 -2
- package/package.json +23 -14
- package/src/config/environment.js +33 -42
- package/src/index.js +45 -28
- package/src/services/AIService.js +3 -3
- package/src/services/AuthService.js +52 -3
- package/src/services/BasedService.js +603 -23
- package/src/services/CollabService.js +491 -0
- package/src/services/CoreService.js +2548 -0
- package/src/services/SocketService.js +227 -59
- package/src/services/SymstoryService.js +150 -64
- package/src/services/index.js +7 -14
- package/src/state/RootStateManager.js +71 -0
- package/src/state/rootEventBus.js +48 -0
- package/src/utils/CollabClient.js +161 -0
- package/src/utils/TokenManager.js +462 -0
- package/src/utils/basedQuerys.js +123 -0
- package/src/utils/jsonDiff.js +109 -0
- package/src/utils/permission.js +4 -4
- package/src/utils/services.js +144 -69
- package/src/utils/symstoryClient.js +36 -2
- package/dist/cjs/services/SocketIOService.js +0 -309
- package/dist/esm/services/SocketIOService.js +0 -467
- package/dist/node/services/SocketIOService.js +0 -280
- package/src/services/SocketIOService.js +0 -356
|
@@ -78,12 +78,11 @@ var PERMISSION_MAP = {
|
|
|
78
78
|
};
|
|
79
79
|
var ROLE_PERMISSIONS = {
|
|
80
80
|
guest: ["viewPublicProjects"],
|
|
81
|
-
user: ["viewPublicProjects"
|
|
82
|
-
admin: ["viewPublicProjects", "
|
|
81
|
+
user: ["viewPublicProjects"],
|
|
82
|
+
admin: ["viewPublicProjects", "governance"],
|
|
83
83
|
superAdmin: [
|
|
84
84
|
"viewPublicProjects",
|
|
85
|
-
"
|
|
86
|
-
"manageUsers",
|
|
85
|
+
"governance",
|
|
87
86
|
"managePlatform"
|
|
88
87
|
]
|
|
89
88
|
};
|
|
@@ -179,6 +178,7 @@ var TIER_FEATURES = {
|
|
|
179
178
|
]
|
|
180
179
|
};
|
|
181
180
|
var PROJECT_ROLE_PERMISSIONS = {
|
|
181
|
+
unauthenticated: ["platformSettings", "showContent"],
|
|
182
182
|
guest: ["platformSettings", "showContent"],
|
|
183
183
|
editor: [
|
|
184
184
|
"platformSettings",
|
|
@@ -1,90 +1,154 @@
|
|
|
1
1
|
// src/utils/services.js
|
|
2
2
|
var SERVICE_METHODS = {
|
|
3
|
-
// Auth service methods
|
|
3
|
+
// Auth service methods (legacy - keeping for backward compatibility)
|
|
4
4
|
auth: "auth",
|
|
5
5
|
login: "auth",
|
|
6
6
|
register: "auth",
|
|
7
7
|
googleAuth: "auth",
|
|
8
|
+
googleAuthCallback: "auth",
|
|
8
9
|
githubAuth: "auth",
|
|
9
10
|
confirmRegistration: "auth",
|
|
10
11
|
logout: "auth",
|
|
11
12
|
updateUserRole: "auth",
|
|
12
13
|
hasPermission: "auth",
|
|
14
|
+
hasGlobalPermission: "auth",
|
|
13
15
|
getProjectMembers: "auth",
|
|
14
16
|
inviteMember: "auth",
|
|
15
17
|
acceptInvite: "auth",
|
|
16
18
|
updateMemberRole: "auth",
|
|
17
19
|
removeMember: "auth",
|
|
18
20
|
updateProjectTier: "auth",
|
|
19
|
-
requestPasswordReset: "auth",
|
|
20
|
-
confirmPasswordReset: "auth",
|
|
21
21
|
subscribeToAuthChanges: "auth",
|
|
22
|
-
getStoredAuthState: "
|
|
23
|
-
//
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
//
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
22
|
+
getStoredAuthState: "core",
|
|
23
|
+
// Collab service methods
|
|
24
|
+
connect: "collab",
|
|
25
|
+
disconnect: "collab",
|
|
26
|
+
isConnected: "collab",
|
|
27
|
+
updateData: "collab",
|
|
28
|
+
addItem: "collab",
|
|
29
|
+
addMultipleItems: "collab",
|
|
30
|
+
updateItem: "collab",
|
|
31
|
+
deleteItem: "collab",
|
|
32
|
+
undo: "collab",
|
|
33
|
+
redo: "collab",
|
|
34
|
+
checkpoint: "collab",
|
|
35
|
+
// Realtime collaboration helper methods
|
|
36
|
+
sendCursor: "collab",
|
|
37
|
+
sendPresence: "collab",
|
|
38
|
+
toggleLive: "collab",
|
|
39
|
+
// Core service methods (new - replaces most based/auth functionality)
|
|
40
|
+
// Auth methods
|
|
41
|
+
register: "core",
|
|
42
|
+
login: "core",
|
|
43
|
+
logout: "core",
|
|
44
|
+
refreshToken: "core",
|
|
45
|
+
googleAuth: "core",
|
|
46
|
+
googleAuthCallback: "core",
|
|
47
|
+
githubAuth: "core",
|
|
48
|
+
requestPasswordReset: "core",
|
|
49
|
+
confirmPasswordReset: "core",
|
|
50
|
+
confirmRegistration: "core",
|
|
51
|
+
requestPasswordChange: "core",
|
|
52
|
+
confirmPasswordChange: "core",
|
|
53
|
+
getMe: "core",
|
|
54
|
+
// User methods
|
|
55
|
+
getUserProfile: "core",
|
|
56
|
+
updateUserProfile: "core",
|
|
57
|
+
getUserProjects: "core",
|
|
58
|
+
getUser: "core",
|
|
59
|
+
getUserByEmail: "core",
|
|
60
|
+
// Project methods
|
|
61
|
+
createProject: "core",
|
|
62
|
+
getProjects: "core",
|
|
63
|
+
getProject: "core",
|
|
64
|
+
getProjectByKey: "core",
|
|
65
|
+
getPublicProject: "core",
|
|
66
|
+
listPublicProjects: "core",
|
|
67
|
+
listProjects: "core",
|
|
68
|
+
updateProject: "core",
|
|
69
|
+
updateProjectComponents: "core",
|
|
70
|
+
updateProjectSettings: "core",
|
|
71
|
+
updateProjectName: "core",
|
|
72
|
+
updateProjectPackage: "core",
|
|
73
|
+
duplicateProject: "core",
|
|
74
|
+
removeProject: "core",
|
|
75
|
+
checkProjectKeyAvailability: "core",
|
|
76
|
+
// Project member methods
|
|
77
|
+
getProjectMembers: "core",
|
|
78
|
+
inviteMember: "core",
|
|
79
|
+
acceptInvite: "core",
|
|
80
|
+
updateMemberRole: "core",
|
|
81
|
+
removeMember: "core",
|
|
82
|
+
// Project library methods
|
|
83
|
+
getAvailableLibraries: "core",
|
|
84
|
+
getProjectLibraries: "core",
|
|
85
|
+
addProjectLibraries: "core",
|
|
86
|
+
removeProjectLibraries: "core",
|
|
87
|
+
// File methods
|
|
88
|
+
uploadFile: "core",
|
|
89
|
+
updateProjectIcon: "core",
|
|
90
|
+
// Payment methods
|
|
91
|
+
checkout: "core",
|
|
92
|
+
getSubscriptionStatus: "core",
|
|
93
|
+
// DNS methods
|
|
94
|
+
createDnsRecord: "core",
|
|
95
|
+
getDnsRecord: "core",
|
|
96
|
+
removeDnsRecord: "core",
|
|
97
|
+
setProjectDomains: "core",
|
|
98
|
+
// Utility methods
|
|
99
|
+
getHealthStatus: "core",
|
|
100
|
+
getTokenDebugInfo: "core",
|
|
101
|
+
// Project Data methods (Symstory replacement)
|
|
102
|
+
applyProjectChanges: "core",
|
|
103
|
+
getProjectData: "core",
|
|
104
|
+
getProjectVersions: "core",
|
|
105
|
+
restoreProjectVersion: "core",
|
|
106
|
+
updateProjectItem: "core",
|
|
107
|
+
deleteProjectItem: "core",
|
|
108
|
+
setProjectValue: "core",
|
|
109
|
+
addProjectItems: "core",
|
|
110
|
+
getProjectItemByPath: "core",
|
|
111
|
+
// Pull Request methods
|
|
112
|
+
createPullRequest: "core",
|
|
113
|
+
listPullRequests: "core",
|
|
114
|
+
getPullRequest: "core",
|
|
115
|
+
reviewPullRequest: "core",
|
|
116
|
+
addPullRequestComment: "core",
|
|
117
|
+
mergePullRequest: "core",
|
|
118
|
+
getPullRequestDiff: "core",
|
|
119
|
+
createPullRequestWithValidation: "core",
|
|
120
|
+
approvePullRequest: "core",
|
|
121
|
+
requestPullRequestChanges: "core",
|
|
122
|
+
getOpenPullRequests: "core",
|
|
123
|
+
getClosedPullRequests: "core",
|
|
124
|
+
getMergedPullRequests: "core",
|
|
125
|
+
isPullRequestMergeable: "core",
|
|
126
|
+
getPullRequestStatusSummary: "core",
|
|
127
|
+
// Branch Management methods
|
|
128
|
+
listBranches: "core",
|
|
129
|
+
createBranch: "core",
|
|
130
|
+
deleteBranch: "core",
|
|
131
|
+
renameBranch: "core",
|
|
132
|
+
getBranchChanges: "core",
|
|
133
|
+
mergeBranch: "core",
|
|
134
|
+
resetBranch: "core",
|
|
135
|
+
publishVersion: "core",
|
|
136
|
+
createBranchWithValidation: "core",
|
|
137
|
+
branchExists: "core",
|
|
138
|
+
previewMerge: "core",
|
|
139
|
+
commitMerge: "core",
|
|
140
|
+
createFeatureBranch: "core",
|
|
141
|
+
createHotfixBranch: "core",
|
|
142
|
+
getBranchStatus: "core",
|
|
143
|
+
deleteBranchSafely: "core",
|
|
144
|
+
// Admin methods
|
|
145
|
+
getAdminUsers: "core",
|
|
146
|
+
assignProjectsToUser: "core",
|
|
147
|
+
searchAdminUsers: "core",
|
|
148
|
+
getAdminUsersByEmails: "core",
|
|
149
|
+
getAdminUsersByIds: "core",
|
|
150
|
+
assignSpecificProjectsToUser: "core",
|
|
151
|
+
assignAllProjectsToUser: "core"
|
|
88
152
|
};
|
|
89
153
|
export {
|
|
90
154
|
SERVICE_METHODS
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// src/config/environment.js
|
|
2
|
+
import { isDevelopment } from "@domql/utils";
|
|
2
3
|
var CONFIG = {
|
|
3
4
|
// Common defaults for all environments
|
|
4
5
|
common: {
|
|
@@ -12,17 +13,14 @@ var CONFIG = {
|
|
|
12
13
|
},
|
|
13
14
|
// Environment-specific configurations
|
|
14
15
|
local: {
|
|
15
|
-
|
|
16
|
-
// For symstory api
|
|
16
|
+
// local
|
|
17
17
|
socketUrl: "http://localhost:8080",
|
|
18
18
|
// For socket api
|
|
19
|
-
|
|
20
|
-
// For router api
|
|
21
|
-
apiUrl: "http://localhost:13335",
|
|
19
|
+
apiUrl: "http://localhost:8080",
|
|
22
20
|
// For server api
|
|
23
21
|
basedEnv: "development",
|
|
24
22
|
// For based api
|
|
25
|
-
basedProject: "platform-v2",
|
|
23
|
+
basedProject: "platform-v2-sm",
|
|
26
24
|
// For based api
|
|
27
25
|
basedOrg: "symbols",
|
|
28
26
|
// For based api
|
|
@@ -35,41 +33,44 @@ var CONFIG = {
|
|
|
35
33
|
}
|
|
36
34
|
},
|
|
37
35
|
development: {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
socketUrl: "https://dev.api.symbols.app",
|
|
37
|
+
apiUrl: "https://dev.api.symbols.app",
|
|
38
|
+
githubClientId: "Ov23liHxyWFBxS8f1gnF"
|
|
39
|
+
},
|
|
40
|
+
testing: {
|
|
41
|
+
socketUrl: "https://test.api.symbols.app",
|
|
42
|
+
apiUrl: "https://test.api.symbols.app",
|
|
43
|
+
basedEnv: "testing",
|
|
44
|
+
basedProject: "platform-v2-sm",
|
|
44
45
|
basedOrg: "symbols",
|
|
45
46
|
githubClientId: "Ov23liHxyWFBxS8f1gnF"
|
|
46
47
|
},
|
|
48
|
+
upcoming: {
|
|
49
|
+
socketUrl: "https://upcoming.api.symbols.app",
|
|
50
|
+
apiUrl: "https://upcoming.api.symbols.app",
|
|
51
|
+
githubClientId: "Ov23liWF7NvdZ056RV5J"
|
|
52
|
+
},
|
|
47
53
|
staging: {
|
|
48
|
-
|
|
49
|
-
socketUrl: "https://staging.socket.symbols.app",
|
|
50
|
-
routerUrl: "https://staging.router.symbols.app",
|
|
54
|
+
socketUrl: "https://staging.api.symbols.app",
|
|
51
55
|
apiUrl: "https://staging.api.symbols.app",
|
|
52
56
|
basedEnv: "staging",
|
|
53
|
-
basedProject: "platform-v2",
|
|
57
|
+
basedProject: "platform-v2-sm",
|
|
54
58
|
basedOrg: "symbols",
|
|
55
59
|
githubClientId: "Ov23ligwZDQVD0VfuWNa"
|
|
56
60
|
},
|
|
57
61
|
production: {
|
|
58
|
-
|
|
59
|
-
socketUrl: "https://socket.symbols.app",
|
|
60
|
-
routerUrl: "https://router.symbols.app",
|
|
62
|
+
socketUrl: "https://api.symbols.app",
|
|
61
63
|
apiUrl: "https://api.symbols.app",
|
|
62
64
|
basedEnv: "production",
|
|
63
|
-
basedProject: "platform-v2",
|
|
65
|
+
basedProject: "platform-v2-sm",
|
|
64
66
|
basedOrg: "symbols",
|
|
65
67
|
githubClientId: "Ov23liFAlOEIXtX3dBtR"
|
|
66
68
|
}
|
|
67
69
|
};
|
|
68
70
|
var getEnvironment = () => {
|
|
69
|
-
const env = process.env.SYMBOLS_APP_ENV ||
|
|
71
|
+
const env = process.env.SYMBOLS_APP_ENV || process.env.NODE_ENV;
|
|
70
72
|
if (!CONFIG[env]) {
|
|
71
|
-
|
|
72
|
-
return "development";
|
|
73
|
+
throw new Error(`Unknown environment "${env}"`);
|
|
73
74
|
}
|
|
74
75
|
return env;
|
|
75
76
|
};
|
|
@@ -79,25 +80,21 @@ var getConfig = () => {
|
|
|
79
80
|
const envConfig = { ...CONFIG.common, ...CONFIG[env] };
|
|
80
81
|
const finalConfig = {
|
|
81
82
|
...envConfig,
|
|
82
|
-
baseUrl: process.env.SYMBOLS_APP_BASE_URL || envConfig.baseUrl,
|
|
83
83
|
socketUrl: process.env.SYMBOLS_APP_SOCKET_URL || envConfig.socketUrl,
|
|
84
|
-
routerUrl: process.env.SYMBOLS_APP_ROUTER_URL || envConfig.routerUrl,
|
|
85
84
|
apiUrl: process.env.SYMBOLS_APP_API_URL || envConfig.apiUrl,
|
|
86
85
|
basedEnv: process.env.SYMBOLS_APP_BASED_ENV || envConfig.basedEnv,
|
|
87
86
|
basedProject: process.env.SYMBOLS_APP_BASED_PROJECT || envConfig.basedProject,
|
|
88
87
|
basedOrg: process.env.SYMBOLS_APP_BASED_ORG || envConfig.basedOrg,
|
|
89
88
|
githubClientId: process.env.SYMBOLS_APP_GITHUB_CLIENT_ID || envConfig.githubClientId,
|
|
90
|
-
isDevelopment: env
|
|
89
|
+
isDevelopment: isDevelopment(env),
|
|
90
|
+
isTesting: env === "testing",
|
|
91
91
|
isStaging: env === "staging",
|
|
92
92
|
isProduction: env === "production"
|
|
93
|
+
// Store all environment variables for potential future use
|
|
93
94
|
};
|
|
94
95
|
const requiredFields = [
|
|
95
|
-
"baseUrl",
|
|
96
96
|
"socketUrl",
|
|
97
97
|
"apiUrl",
|
|
98
|
-
"basedEnv",
|
|
99
|
-
"basedProject",
|
|
100
|
-
"basedOrg",
|
|
101
98
|
"githubClientId",
|
|
102
99
|
"googleClientId"
|
|
103
100
|
];
|
|
@@ -110,9 +107,7 @@ var getConfig = () => {
|
|
|
110
107
|
if (finalConfig.isDevelopment) {
|
|
111
108
|
console.log(
|
|
112
109
|
"environment in SDK:",
|
|
113
|
-
env
|
|
114
|
-
"",
|
|
115
|
-
process.env.SYMBOLS_APP_ENV
|
|
110
|
+
env || process.env.NODE_ENV || process.env.NODE_ENV
|
|
116
111
|
);
|
|
117
112
|
console.log(finalConfig);
|
|
118
113
|
}
|
|
@@ -120,14 +115,7 @@ var getConfig = () => {
|
|
|
120
115
|
} catch (error) {
|
|
121
116
|
console.error("Failed to load environment configuration:", error);
|
|
122
117
|
return {
|
|
123
|
-
|
|
124
|
-
socketUrl: "https://socket.symbols.app",
|
|
125
|
-
routerUrl: "https://router.symbols.app",
|
|
126
|
-
apiUrl: "https://api.symbols.app",
|
|
127
|
-
basedEnv: "development",
|
|
128
|
-
basedProject: "platform-v2",
|
|
129
|
-
basedOrg: "symbols",
|
|
130
|
-
githubClientId: "Ov23liHxyWFBxS8f1gnF"
|
|
118
|
+
...CONFIG.development
|
|
131
119
|
};
|
|
132
120
|
}
|
|
133
121
|
};
|
|
@@ -135,7 +123,7 @@ var environment_default = getConfig();
|
|
|
135
123
|
|
|
136
124
|
// src/utils/symstoryClient.js
|
|
137
125
|
var DEFAULT_OPTIONS = {
|
|
138
|
-
|
|
126
|
+
apiUrl: environment_default.apiUrl
|
|
139
127
|
};
|
|
140
128
|
var SymstoryClient = class {
|
|
141
129
|
/**
|
|
@@ -162,7 +150,7 @@ var SymstoryClient = class {
|
|
|
162
150
|
* @returns {Promise<any>} - The response data.
|
|
163
151
|
*/
|
|
164
152
|
async request(path = "", options = {}) {
|
|
165
|
-
const url = `${this.options.
|
|
153
|
+
const url = `${this.options.apiUrl}/symstory/${this.appKey}${path}`;
|
|
166
154
|
const response = await fetch(url, {
|
|
167
155
|
...options,
|
|
168
156
|
headers: { ...this.headers, ...options.headers }
|
|
@@ -309,6 +297,37 @@ var SymstoryClient = class {
|
|
|
309
297
|
body: JSON.stringify({ branch, version, type, message })
|
|
310
298
|
});
|
|
311
299
|
}
|
|
300
|
+
/**
|
|
301
|
+
* Publishes an existing version of the project.
|
|
302
|
+
* @param {string} version - The version ID/number to publish.
|
|
303
|
+
* @param {object} [options={}] - The publishing options.
|
|
304
|
+
* @param {string} [options.branch='main'] - The branch name. (Only if version number is provided)
|
|
305
|
+
* @returns {Promise<any>} - The response data.
|
|
306
|
+
*/
|
|
307
|
+
publishVersion(version) {
|
|
308
|
+
return this.request("/publish", {
|
|
309
|
+
method: "POST",
|
|
310
|
+
body: JSON.stringify({ version })
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Retrieves all changes after a specific version.
|
|
315
|
+
* @param {object} [options={}] - The changes options.
|
|
316
|
+
* @param {string} [options.versionId] - The version ID to publish.
|
|
317
|
+
* @param {string} [options.versionValue] - The version ID to publish. (alternative to versionId)
|
|
318
|
+
* @param {string} [options.branch] - The branch to publish (Only in combination to versionValue)
|
|
319
|
+
* @returns {Promise<any>} - The changes data.
|
|
320
|
+
*/
|
|
321
|
+
getChanges({ versionId, versionValue, branch } = {}) {
|
|
322
|
+
return this.request(
|
|
323
|
+
`/changes?${new URLSearchParams({
|
|
324
|
+
...versionId ? { versionId } : {},
|
|
325
|
+
...versionValue ? { versionValue } : {},
|
|
326
|
+
...branch ? { branch } : {}
|
|
327
|
+
}).toString()}`,
|
|
328
|
+
{}
|
|
329
|
+
);
|
|
330
|
+
}
|
|
312
331
|
};
|
|
313
332
|
var symstoryClient_default = {
|
|
314
333
|
/**
|
|
@@ -332,3 +351,4 @@ var symstoryClient_default = {
|
|
|
332
351
|
export {
|
|
333
352
|
symstoryClient_default as default
|
|
334
353
|
};
|
|
354
|
+
// @preserve-env
|
|
@@ -741,6 +741,44 @@ pp$8.isAsyncFunction = function() {
|
|
|
741
741
|
var next = this.pos + skip[0].length, after;
|
|
742
742
|
return !lineBreak.test(this.input.slice(this.pos, next)) && this.input.slice(next, next + 8) === "function" && (next + 8 === this.input.length || !(isIdentifierChar(after = this.input.charCodeAt(next + 8)) || after > 55295 && after < 56320));
|
|
743
743
|
};
|
|
744
|
+
pp$8.isUsingKeyword = function(isAwaitUsing, isFor) {
|
|
745
|
+
if (this.options.ecmaVersion < 17 || !this.isContextual(isAwaitUsing ? "await" : "using")) {
|
|
746
|
+
return false;
|
|
747
|
+
}
|
|
748
|
+
skipWhiteSpace.lastIndex = this.pos;
|
|
749
|
+
var skip = skipWhiteSpace.exec(this.input);
|
|
750
|
+
var next = this.pos + skip[0].length;
|
|
751
|
+
if (lineBreak.test(this.input.slice(this.pos, next))) {
|
|
752
|
+
return false;
|
|
753
|
+
}
|
|
754
|
+
if (isAwaitUsing) {
|
|
755
|
+
var awaitEndPos = next + 5, after;
|
|
756
|
+
if (this.input.slice(next, awaitEndPos) !== "using" || awaitEndPos === this.input.length || isIdentifierChar(after = this.input.charCodeAt(awaitEndPos)) || after > 55295 && after < 56320) {
|
|
757
|
+
return false;
|
|
758
|
+
}
|
|
759
|
+
skipWhiteSpace.lastIndex = awaitEndPos;
|
|
760
|
+
var skipAfterUsing = skipWhiteSpace.exec(this.input);
|
|
761
|
+
if (skipAfterUsing && lineBreak.test(this.input.slice(awaitEndPos, awaitEndPos + skipAfterUsing[0].length))) {
|
|
762
|
+
return false;
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
if (isFor) {
|
|
766
|
+
var ofEndPos = next + 2, after$1;
|
|
767
|
+
if (this.input.slice(next, ofEndPos) === "of") {
|
|
768
|
+
if (ofEndPos === this.input.length || !isIdentifierChar(after$1 = this.input.charCodeAt(ofEndPos)) && !(after$1 > 55295 && after$1 < 56320)) {
|
|
769
|
+
return false;
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
var ch = this.input.charCodeAt(next);
|
|
774
|
+
return isIdentifierStart(ch, true) || ch === 92;
|
|
775
|
+
};
|
|
776
|
+
pp$8.isAwaitUsing = function(isFor) {
|
|
777
|
+
return this.isUsingKeyword(true, isFor);
|
|
778
|
+
};
|
|
779
|
+
pp$8.isUsing = function(isFor) {
|
|
780
|
+
return this.isUsingKeyword(false, isFor);
|
|
781
|
+
};
|
|
744
782
|
pp$8.parseStatement = function(context, topLevel, exports) {
|
|
745
783
|
var starttype = this.type, node = this.startNode(), kind;
|
|
746
784
|
if (this.isLet(context)) {
|
|
@@ -824,6 +862,22 @@ pp$8.parseStatement = function(context, topLevel, exports) {
|
|
|
824
862
|
this.next();
|
|
825
863
|
return this.parseFunctionStatement(node, true, !context);
|
|
826
864
|
}
|
|
865
|
+
var usingKind = this.isAwaitUsing(false) ? "await using" : this.isUsing(false) ? "using" : null;
|
|
866
|
+
if (usingKind) {
|
|
867
|
+
if (topLevel && this.options.sourceType === "script") {
|
|
868
|
+
this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script`");
|
|
869
|
+
}
|
|
870
|
+
if (usingKind === "await using") {
|
|
871
|
+
if (!this.canAwait) {
|
|
872
|
+
this.raise(this.start, "Await using cannot appear outside of async function");
|
|
873
|
+
}
|
|
874
|
+
this.next();
|
|
875
|
+
}
|
|
876
|
+
this.next();
|
|
877
|
+
this.parseVar(node, false, usingKind);
|
|
878
|
+
this.semicolon();
|
|
879
|
+
return this.finishNode(node, "VariableDeclaration");
|
|
880
|
+
}
|
|
827
881
|
var maybeName = this.value, expr = this.parseExpression();
|
|
828
882
|
if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon)) {
|
|
829
883
|
return this.parseLabeledStatement(node, maybeName, expr, context);
|
|
@@ -897,24 +951,20 @@ pp$8.parseForStatement = function(node) {
|
|
|
897
951
|
this.next();
|
|
898
952
|
this.parseVar(init$1, true, kind);
|
|
899
953
|
this.finishNode(init$1, "VariableDeclaration");
|
|
900
|
-
|
|
901
|
-
if (this.options.ecmaVersion >= 9) {
|
|
902
|
-
if (this.type === types$1._in) {
|
|
903
|
-
if (awaitAt > -1) {
|
|
904
|
-
this.unexpected(awaitAt);
|
|
905
|
-
}
|
|
906
|
-
} else {
|
|
907
|
-
node.await = awaitAt > -1;
|
|
908
|
-
}
|
|
909
|
-
}
|
|
910
|
-
return this.parseForIn(node, init$1);
|
|
911
|
-
}
|
|
912
|
-
if (awaitAt > -1) {
|
|
913
|
-
this.unexpected(awaitAt);
|
|
914
|
-
}
|
|
915
|
-
return this.parseFor(node, init$1);
|
|
954
|
+
return this.parseForAfterInit(node, init$1, awaitAt);
|
|
916
955
|
}
|
|
917
956
|
var startsWithLet = this.isContextual("let"), isForOf = false;
|
|
957
|
+
var usingKind = this.isUsing(true) ? "using" : this.isAwaitUsing(true) ? "await using" : null;
|
|
958
|
+
if (usingKind) {
|
|
959
|
+
var init$2 = this.startNode();
|
|
960
|
+
this.next();
|
|
961
|
+
if (usingKind === "await using") {
|
|
962
|
+
this.next();
|
|
963
|
+
}
|
|
964
|
+
this.parseVar(init$2, true, usingKind);
|
|
965
|
+
this.finishNode(init$2, "VariableDeclaration");
|
|
966
|
+
return this.parseForAfterInit(node, init$2, awaitAt);
|
|
967
|
+
}
|
|
918
968
|
var containsEsc = this.containsEsc;
|
|
919
969
|
var refDestructuringErrors = new DestructuringErrors();
|
|
920
970
|
var initPos = this.start;
|
|
@@ -946,6 +996,24 @@ pp$8.parseForStatement = function(node) {
|
|
|
946
996
|
}
|
|
947
997
|
return this.parseFor(node, init);
|
|
948
998
|
};
|
|
999
|
+
pp$8.parseForAfterInit = function(node, init, awaitAt) {
|
|
1000
|
+
if ((this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && init.declarations.length === 1) {
|
|
1001
|
+
if (this.options.ecmaVersion >= 9) {
|
|
1002
|
+
if (this.type === types$1._in) {
|
|
1003
|
+
if (awaitAt > -1) {
|
|
1004
|
+
this.unexpected(awaitAt);
|
|
1005
|
+
}
|
|
1006
|
+
} else {
|
|
1007
|
+
node.await = awaitAt > -1;
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
return this.parseForIn(node, init);
|
|
1011
|
+
}
|
|
1012
|
+
if (awaitAt > -1) {
|
|
1013
|
+
this.unexpected(awaitAt);
|
|
1014
|
+
}
|
|
1015
|
+
return this.parseFor(node, init);
|
|
1016
|
+
};
|
|
949
1017
|
pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) {
|
|
950
1018
|
this.next();
|
|
951
1019
|
return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync);
|
|
@@ -1171,6 +1239,8 @@ pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) {
|
|
|
1171
1239
|
decl.init = this.parseMaybeAssign(isFor);
|
|
1172
1240
|
} else if (!allowMissingInitializer && kind === "const" && !(this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
|
|
1173
1241
|
this.unexpected();
|
|
1242
|
+
} else if (!allowMissingInitializer && (kind === "using" || kind === "await using") && this.options.ecmaVersion >= 17 && this.type !== types$1._in && !this.isContextual("of")) {
|
|
1243
|
+
this.raise(this.lastTokEnd, "Missing initializer in " + kind + " declaration");
|
|
1174
1244
|
} else if (!allowMissingInitializer && decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) {
|
|
1175
1245
|
this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value");
|
|
1176
1246
|
} else {
|
|
@@ -1184,7 +1254,7 @@ pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) {
|
|
|
1184
1254
|
return node;
|
|
1185
1255
|
};
|
|
1186
1256
|
pp$8.parseVarId = function(decl, kind) {
|
|
1187
|
-
decl.id = this.parseBindingAtom();
|
|
1257
|
+
decl.id = kind === "using" || kind === "await using" ? this.parseIdent() : this.parseBindingAtom();
|
|
1188
1258
|
this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false);
|
|
1189
1259
|
};
|
|
1190
1260
|
var FUNC_STATEMENT = 1;
|
|
@@ -2654,7 +2724,7 @@ pp$5.parseLiteral = function(value) {
|
|
|
2654
2724
|
node.value = value;
|
|
2655
2725
|
node.raw = this.input.slice(this.start, this.end);
|
|
2656
2726
|
if (node.raw.charCodeAt(node.raw.length - 1) === 110) {
|
|
2657
|
-
node.bigint = node.raw.slice(0, -1).replace(/_/g, "");
|
|
2727
|
+
node.bigint = node.value != null ? node.value.toString() : node.raw.slice(0, -1).replace(/_/g, "");
|
|
2658
2728
|
}
|
|
2659
2729
|
this.next();
|
|
2660
2730
|
return this.finishNode(node, "Literal");
|
|
@@ -5514,7 +5584,7 @@ pp.readWord = function() {
|
|
|
5514
5584
|
}
|
|
5515
5585
|
return this.finishToken(type, word);
|
|
5516
5586
|
};
|
|
5517
|
-
var version = "8.
|
|
5587
|
+
var version = "8.15.0";
|
|
5518
5588
|
Parser.acorn = {
|
|
5519
5589
|
Parser,
|
|
5520
5590
|
version,
|