@symbo.ls/sdk 2.34.35 → 3.1.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.
Files changed (187) hide show
  1. package/README.md +13 -315
  2. package/dist/cjs/config/environment.js +50 -124
  3. package/dist/cjs/index.js +22 -169
  4. package/dist/cjs/services/AIService.js +155 -0
  5. package/dist/cjs/services/AuthService.js +277 -751
  6. package/dist/cjs/services/BaseService.js +6 -158
  7. package/dist/cjs/services/BasedService.js +679 -0
  8. package/dist/cjs/services/SocketIOService.js +309 -0
  9. package/dist/cjs/services/SocketService.js +161 -0
  10. package/dist/cjs/services/SymstoryService.js +485 -0
  11. package/dist/cjs/services/index.js +16 -64
  12. package/dist/cjs/utils/basedQuerys.js +61 -0
  13. package/dist/cjs/utils/permission.js +4 -4
  14. package/dist/cjs/utils/services.js +80 -301
  15. package/dist/cjs/utils/symstoryClient.js +228 -0
  16. package/dist/cjs/utils/validation.js +3 -0
  17. package/dist/esm/config/environment.js +50 -124
  18. package/dist/esm/index.js +11282 -49789
  19. package/dist/esm/services/AIService.js +185 -0
  20. package/dist/esm/services/AuthService.js +358 -1506
  21. package/dist/esm/services/BaseService.js +6 -757
  22. package/dist/esm/services/BasedService.js +4651 -0
  23. package/dist/esm/services/SocketIOService.js +467 -0
  24. package/dist/esm/services/SocketService.js +191 -0
  25. package/dist/esm/services/SymstoryService.js +6849 -0
  26. package/dist/esm/services/index.js +11188 -49352
  27. package/dist/esm/utils/basedQuerys.js +43 -0
  28. package/dist/esm/utils/permission.js +4 -4
  29. package/dist/esm/utils/services.js +80 -301
  30. package/dist/esm/utils/symstoryClient.js +334 -0
  31. package/dist/esm/utils/validation.js +26 -93
  32. package/dist/node/config/environment.js +50 -124
  33. package/dist/node/index.js +26 -202
  34. package/dist/node/services/AIService.js +136 -0
  35. package/dist/node/services/AuthService.js +278 -751
  36. package/dist/node/services/BaseService.js +6 -148
  37. package/dist/node/services/BasedService.js +650 -0
  38. package/dist/node/services/SocketIOService.js +280 -0
  39. package/dist/node/services/SocketService.js +142 -0
  40. package/dist/node/services/SymstoryService.js +456 -0
  41. package/dist/node/services/index.js +16 -64
  42. package/dist/node/utils/basedQuerys.js +42 -0
  43. package/dist/node/utils/permission.js +4 -4
  44. package/dist/node/utils/services.js +80 -301
  45. package/dist/node/utils/symstoryClient.js +199 -0
  46. package/dist/node/utils/validation.js +3 -0
  47. package/package.json +21 -43
  48. package/src/config/environment.js +50 -126
  49. package/src/index.js +24 -208
  50. package/src/services/AIService.js +150 -0
  51. package/src/services/AuthService.js +298 -893
  52. package/src/services/BaseService.js +6 -166
  53. package/src/services/BasedService.js +722 -0
  54. package/src/services/SocketIOService.js +356 -0
  55. package/src/services/SocketService.js +168 -0
  56. package/src/services/SymstoryService.js +563 -0
  57. package/src/services/index.js +13 -80
  58. package/src/utils/basedQuerys.js +41 -0
  59. package/src/utils/permission.js +4 -4
  60. package/src/utils/services.js +83 -325
  61. package/src/utils/symstoryClient.js +218 -0
  62. package/src/utils/validation.js +3 -0
  63. package/dist/cjs/services/AdminService.js +0 -351
  64. package/dist/cjs/services/BranchService.js +0 -484
  65. package/dist/cjs/services/CollabService.js +0 -743
  66. package/dist/cjs/services/DnsService.js +0 -340
  67. package/dist/cjs/services/FeatureFlagService.js +0 -175
  68. package/dist/cjs/services/FileService.js +0 -201
  69. package/dist/cjs/services/IntegrationService.js +0 -538
  70. package/dist/cjs/services/MetricsService.js +0 -62
  71. package/dist/cjs/services/PaymentService.js +0 -271
  72. package/dist/cjs/services/PlanService.js +0 -426
  73. package/dist/cjs/services/ProjectService.js +0 -1207
  74. package/dist/cjs/services/PullRequestService.js +0 -503
  75. package/dist/cjs/services/ScreenshotService.js +0 -304
  76. package/dist/cjs/services/SubscriptionService.js +0 -396
  77. package/dist/cjs/services/TrackingService.js +0 -661
  78. package/dist/cjs/services/WaitlistService.js +0 -148
  79. package/dist/cjs/state/RootStateManager.js +0 -65
  80. package/dist/cjs/state/rootEventBus.js +0 -74
  81. package/dist/cjs/utils/CollabClient.js +0 -223
  82. package/dist/cjs/utils/TokenManager.js +0 -422
  83. package/dist/cjs/utils/changePreprocessor.js +0 -199
  84. package/dist/cjs/utils/jsonDiff.js +0 -145
  85. package/dist/cjs/utils/ordering.js +0 -309
  86. package/dist/esm/services/AdminService.js +0 -1132
  87. package/dist/esm/services/BranchService.js +0 -1265
  88. package/dist/esm/services/CollabService.js +0 -26838
  89. package/dist/esm/services/DnsService.js +0 -1121
  90. package/dist/esm/services/FeatureFlagService.js +0 -956
  91. package/dist/esm/services/FileService.js +0 -982
  92. package/dist/esm/services/IntegrationService.js +0 -1319
  93. package/dist/esm/services/MetricsService.js +0 -843
  94. package/dist/esm/services/PaymentService.js +0 -1052
  95. package/dist/esm/services/PlanService.js +0 -1207
  96. package/dist/esm/services/ProjectService.js +0 -2526
  97. package/dist/esm/services/PullRequestService.js +0 -1284
  98. package/dist/esm/services/ScreenshotService.js +0 -1085
  99. package/dist/esm/services/SubscriptionService.js +0 -1177
  100. package/dist/esm/services/TrackingService.js +0 -18343
  101. package/dist/esm/services/WaitlistService.js +0 -929
  102. package/dist/esm/state/RootStateManager.js +0 -90
  103. package/dist/esm/state/rootEventBus.js +0 -56
  104. package/dist/esm/utils/CollabClient.js +0 -18901
  105. package/dist/esm/utils/TokenManager.js +0 -408
  106. package/dist/esm/utils/changePreprocessor.js +0 -542
  107. package/dist/esm/utils/jsonDiff.js +0 -7011
  108. package/dist/esm/utils/ordering.js +0 -291
  109. package/dist/node/services/AdminService.js +0 -332
  110. package/dist/node/services/BranchService.js +0 -465
  111. package/dist/node/services/CollabService.js +0 -724
  112. package/dist/node/services/DnsService.js +0 -321
  113. package/dist/node/services/FeatureFlagService.js +0 -156
  114. package/dist/node/services/FileService.js +0 -182
  115. package/dist/node/services/IntegrationService.js +0 -519
  116. package/dist/node/services/MetricsService.js +0 -43
  117. package/dist/node/services/PaymentService.js +0 -252
  118. package/dist/node/services/PlanService.js +0 -407
  119. package/dist/node/services/ProjectService.js +0 -1188
  120. package/dist/node/services/PullRequestService.js +0 -484
  121. package/dist/node/services/ScreenshotService.js +0 -285
  122. package/dist/node/services/SubscriptionService.js +0 -377
  123. package/dist/node/services/TrackingService.js +0 -632
  124. package/dist/node/services/WaitlistService.js +0 -129
  125. package/dist/node/state/RootStateManager.js +0 -36
  126. package/dist/node/state/rootEventBus.js +0 -55
  127. package/dist/node/utils/CollabClient.js +0 -194
  128. package/dist/node/utils/TokenManager.js +0 -403
  129. package/dist/node/utils/changePreprocessor.js +0 -180
  130. package/dist/node/utils/jsonDiff.js +0 -116
  131. package/dist/node/utils/ordering.js +0 -290
  132. package/src/services/AdminService.js +0 -374
  133. package/src/services/BranchService.js +0 -536
  134. package/src/services/CollabService.js +0 -900
  135. package/src/services/DnsService.js +0 -366
  136. package/src/services/FeatureFlagService.js +0 -174
  137. package/src/services/FileService.js +0 -213
  138. package/src/services/IntegrationService.js +0 -548
  139. package/src/services/MetricsService.js +0 -40
  140. package/src/services/PaymentService.js +0 -287
  141. package/src/services/PlanService.js +0 -468
  142. package/src/services/ProjectService.js +0 -1366
  143. package/src/services/PullRequestService.js +0 -537
  144. package/src/services/ScreenshotService.js +0 -258
  145. package/src/services/SubscriptionService.js +0 -425
  146. package/src/services/TrackingService.js +0 -853
  147. package/src/services/WaitlistService.js +0 -130
  148. package/src/services/tests/BranchService/createBranch.test.js +0 -153
  149. package/src/services/tests/BranchService/deleteBranch.test.js +0 -173
  150. package/src/services/tests/BranchService/getBranchChanges.test.js +0 -146
  151. package/src/services/tests/BranchService/listBranches.test.js +0 -87
  152. package/src/services/tests/BranchService/mergeBranch.test.js +0 -210
  153. package/src/services/tests/BranchService/publishVersion.test.js +0 -183
  154. package/src/services/tests/BranchService/renameBranch.test.js +0 -240
  155. package/src/services/tests/BranchService/resetBranch.test.js +0 -152
  156. package/src/services/tests/FeatureFlagService/adminFeatureFlags.test.js +0 -67
  157. package/src/services/tests/FeatureFlagService/getFeatureFlags.test.js +0 -75
  158. package/src/services/tests/FileService/createFileFormData.test.js +0 -74
  159. package/src/services/tests/FileService/getFileUrl.test.js +0 -69
  160. package/src/services/tests/FileService/updateProjectIcon.test.js +0 -109
  161. package/src/services/tests/FileService/uploadDocument.test.js +0 -36
  162. package/src/services/tests/FileService/uploadFile.test.js +0 -78
  163. package/src/services/tests/FileService/uploadFileWithValidation.test.js +0 -114
  164. package/src/services/tests/FileService/uploadImage.test.js +0 -36
  165. package/src/services/tests/FileService/uploadMultipleFiles.test.js +0 -111
  166. package/src/services/tests/FileService/validateFile.test.js +0 -63
  167. package/src/services/tests/PlanService/createPlan.test.js +0 -104
  168. package/src/services/tests/PlanService/createPlanWithValidation.test.js +0 -523
  169. package/src/services/tests/PlanService/deletePlan.test.js +0 -92
  170. package/src/services/tests/PlanService/getActivePlans.test.js +0 -123
  171. package/src/services/tests/PlanService/getAdminPlans.test.js +0 -84
  172. package/src/services/tests/PlanService/getPlan.test.js +0 -50
  173. package/src/services/tests/PlanService/getPlanByKey.test.js +0 -109
  174. package/src/services/tests/PlanService/getPlanWithValidation.test.js +0 -85
  175. package/src/services/tests/PlanService/getPlans.test.js +0 -53
  176. package/src/services/tests/PlanService/getPlansByPriceRange.test.js +0 -109
  177. package/src/services/tests/PlanService/getPlansWithValidation.test.js +0 -48
  178. package/src/services/tests/PlanService/initializePlans.test.js +0 -75
  179. package/src/services/tests/PlanService/updatePlan.test.js +0 -111
  180. package/src/services/tests/PlanService/updatePlanWithValidation.test.js +0 -556
  181. package/src/state/RootStateManager.js +0 -76
  182. package/src/state/rootEventBus.js +0 -67
  183. package/src/utils/CollabClient.js +0 -248
  184. package/src/utils/TokenManager.js +0 -479
  185. package/src/utils/changePreprocessor.js +0 -239
  186. package/src/utils/jsonDiff.js +0 -144
  187. package/src/utils/ordering.js +0 -271
@@ -0,0 +1,334 @@
1
+ // src/config/environment.js
2
+ var CONFIG = {
3
+ // Common defaults for all environments
4
+ common: {
5
+ // NOTE: Google client id for google auth, need to configure URLs for each environment in Google console
6
+ googleClientId: "686286207466-bvd2fqs31rlm64fgich7rtpnc8ns2tqg.apps.googleusercontent.com",
7
+ // Feature toggles that apply across all environments by default
8
+ features: {
9
+ newUserOnboarding: true,
10
+ betaFeatures: false
11
+ }
12
+ },
13
+ // Environment-specific configurations
14
+ local: {
15
+ baseUrl: "http://localhost:3000",
16
+ // For symstory api
17
+ socketUrl: "http://localhost:8080",
18
+ // For socket api
19
+ routerUrl: "http://localhost:3090",
20
+ // For router api
21
+ apiUrl: "http://localhost:13335",
22
+ // For server api
23
+ basedEnv: "development",
24
+ // For based api
25
+ basedProject: "platform-v2",
26
+ // For based api
27
+ basedOrg: "symbols",
28
+ // For based api
29
+ githubClientId: "Ov23liHxyWFBxS8f1gnF",
30
+ // For github api
31
+ // Environment-specific feature toggles (override common)
32
+ features: {
33
+ betaFeatures: true
34
+ // Enable beta features in local dev
35
+ }
36
+ },
37
+ development: {
38
+ baseUrl: "https://story.symbo.ls",
39
+ socketUrl: "https://socket.symbols.app",
40
+ routerUrl: "https://router.symbols.app",
41
+ apiUrl: "https://api.symbols.app",
42
+ basedEnv: "development",
43
+ basedProject: "platform-v2",
44
+ basedOrg: "symbols",
45
+ githubClientId: "Ov23liHxyWFBxS8f1gnF"
46
+ },
47
+ staging: {
48
+ baseUrl: "https://staging.story.symbo.ls",
49
+ socketUrl: "https://staging.socket.symbols.app",
50
+ routerUrl: "https://staging.router.symbols.app",
51
+ apiUrl: "https://staging.api.symbols.app",
52
+ basedEnv: "staging",
53
+ basedProject: "platform-v2",
54
+ basedOrg: "symbols",
55
+ githubClientId: "Ov23ligwZDQVD0VfuWNa"
56
+ },
57
+ production: {
58
+ baseUrl: "https://story.symbo.ls",
59
+ socketUrl: "https://socket.symbols.app",
60
+ routerUrl: "https://router.symbols.app",
61
+ apiUrl: "https://api.symbols.app",
62
+ basedEnv: "production",
63
+ basedProject: "platform-v2",
64
+ basedOrg: "symbols",
65
+ githubClientId: "Ov23liFAlOEIXtX3dBtR"
66
+ }
67
+ };
68
+ var getEnvironment = () => {
69
+ const env = process.env.SYMBOLS_APP_ENV || "" || "development";
70
+ if (!CONFIG[env]) {
71
+ console.warn(`Unknown environment "${env}", falling back to development`);
72
+ return "development";
73
+ }
74
+ return env;
75
+ };
76
+ var getConfig = () => {
77
+ try {
78
+ const env = getEnvironment();
79
+ const envConfig = { ...CONFIG.common, ...CONFIG[env] };
80
+ const finalConfig = {
81
+ ...envConfig,
82
+ baseUrl: process.env.SYMBOLS_APP_BASE_URL || envConfig.baseUrl,
83
+ socketUrl: process.env.SYMBOLS_APP_SOCKET_URL || envConfig.socketUrl,
84
+ routerUrl: process.env.SYMBOLS_APP_ROUTER_URL || envConfig.routerUrl,
85
+ apiUrl: process.env.SYMBOLS_APP_API_URL || envConfig.apiUrl,
86
+ basedEnv: process.env.SYMBOLS_APP_BASED_ENV || envConfig.basedEnv,
87
+ basedProject: process.env.SYMBOLS_APP_BASED_PROJECT || envConfig.basedProject,
88
+ basedOrg: process.env.SYMBOLS_APP_BASED_ORG || envConfig.basedOrg,
89
+ githubClientId: process.env.SYMBOLS_APP_GITHUB_CLIENT_ID || envConfig.githubClientId,
90
+ isDevelopment: env === "development" || env === "local",
91
+ isStaging: env === "staging",
92
+ isProduction: env === "production"
93
+ };
94
+ const requiredFields = [
95
+ "baseUrl",
96
+ "socketUrl",
97
+ "apiUrl",
98
+ "basedEnv",
99
+ "basedProject",
100
+ "basedOrg",
101
+ "githubClientId",
102
+ "googleClientId"
103
+ ];
104
+ const missingFields = requiredFields.filter((field) => !finalConfig[field]);
105
+ if (missingFields.length > 0) {
106
+ console.error(
107
+ `Missing required configuration: ${missingFields.join(", ")}`
108
+ );
109
+ }
110
+ if (finalConfig.isDevelopment) {
111
+ console.log(
112
+ "environment in SDK:",
113
+ env,
114
+ "",
115
+ process.env.SYMBOLS_APP_ENV
116
+ );
117
+ console.log(finalConfig);
118
+ }
119
+ return finalConfig;
120
+ } catch (error) {
121
+ console.error("Failed to load environment configuration:", error);
122
+ return {
123
+ baseUrl: "https://story.symbo.ls",
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"
131
+ };
132
+ }
133
+ };
134
+ var environment_default = getConfig();
135
+
136
+ // src/utils/symstoryClient.js
137
+ var DEFAULT_OPTIONS = {
138
+ baseUrl: environment_default.baseUrl
139
+ };
140
+ var SymstoryClient = class {
141
+ /**
142
+ * Creates an instance of SymstoryClient.
143
+ * @param {string} appKey - The application key.
144
+ * @param {object} [options={}] - The options for the client.
145
+ */
146
+ constructor(appKey, options = {}) {
147
+ if (!appKey) {
148
+ throw new Error("AppKey is required");
149
+ }
150
+ this.appKey = appKey;
151
+ this.options = { ...DEFAULT_OPTIONS, ...options };
152
+ this.headers = {
153
+ "Content-Type": "application/json",
154
+ ...this.options.headers,
155
+ "X-AppKey": appKey
156
+ };
157
+ }
158
+ /**
159
+ * Makes a request to the Symstory service.
160
+ * @param {string} [path=''] - The request path.
161
+ * @param {object} [options={}] - The request options.
162
+ * @returns {Promise<any>} - The response data.
163
+ */
164
+ async request(path = "", options = {}) {
165
+ const url = `${this.options.baseUrl}/${this.appKey}${path}`;
166
+ const response = await fetch(url, {
167
+ ...options,
168
+ headers: { ...this.headers, ...options.headers }
169
+ });
170
+ if (!response.ok) {
171
+ const error = await response.json();
172
+ throw new Error(error.message || error.error || "Request failed");
173
+ }
174
+ return response.status === 204 ? null : response.json();
175
+ }
176
+ /**
177
+ * Fetches project data.
178
+ * @param {object} query - The query object to filter data.
179
+ * @param {string|null} [branch=null] - The branch name.
180
+ * @param {string|null} [version=null] - The version number.
181
+ * @returns {Promise<any>} - The project data.
182
+ */
183
+ get(query, branch = null, version = null) {
184
+ const params = new URLSearchParams({
185
+ ...branch && { branch },
186
+ ...version ? { version } : { cacheId: Math.random() },
187
+ ...query && { query: JSON.stringify(query) }
188
+ });
189
+ return this.request(`?${params}`);
190
+ }
191
+ /**
192
+ * Sets a value at the specified path.
193
+ * @param {string} path - The path where the value should be set.
194
+ * @param {any} value - The value to set.
195
+ * @returns {Promise<any>} - The response data.
196
+ */
197
+ set(path, value) {
198
+ return this.request("", {
199
+ method: "POST",
200
+ body: JSON.stringify({ changes: [["update", path, value]] })
201
+ });
202
+ }
203
+ /**
204
+ * Updates project data.
205
+ * @param {Array} changes - The changes to apply.
206
+ * @param {object} [options={}] - The update options.
207
+ * @param {string} [options.type='patch'] - The type of update.
208
+ * @param {string} [options.message=''] - A message describing the update.
209
+ * @param {string} [options.branch='main'] - The branch name.
210
+ * @returns {Promise<any>} - The response data.
211
+ */
212
+ async update(changes, { type = "patch", message = "", branch = "main" } = {}) {
213
+ return await this.request("", {
214
+ method: "POST",
215
+ body: JSON.stringify({ changes, type, message, branch })
216
+ });
217
+ }
218
+ /**
219
+ * Retrieves all branches of the project.
220
+ * @returns {Promise<any>} - The branches data.
221
+ */
222
+ getBranches() {
223
+ return this.request("/branches");
224
+ }
225
+ /**
226
+ * Creates a new branch.
227
+ * @param {string} branch - The name of the new branch.
228
+ * @param {object} [options={}] - The branch creation options.
229
+ * @param {string} [options.message] - A message describing the branch creation.
230
+ * @param {string} [options.source='main'] - The source branch.
231
+ * @param {string} [options.version] - The version number.
232
+ * @returns {Promise<any>} - The response data.
233
+ */
234
+ createBranch(branch, { message, source = "main", version } = {}) {
235
+ return this.request("/branch", {
236
+ method: "POST",
237
+ body: JSON.stringify({ branch, message, source, version })
238
+ });
239
+ }
240
+ /**
241
+ * Edit an existing branch. (For now only supports branch renaming)
242
+ * @param {string} branch - The current name of the branch to edit.
243
+ * @param {object} [options={}] - The branch edit options.
244
+ * @param {string} [options.name] - New name for the branch
245
+ * @returns {Promise<any>} - The response data.
246
+ */
247
+ editBranch(branch, { name } = {}) {
248
+ return this.request("/branch", {
249
+ method: "PATCH",
250
+ body: JSON.stringify({ branch, name })
251
+ });
252
+ }
253
+ /**
254
+ * Delete an existing branch.
255
+ * @param {string} branch - The name of the branch to delete.
256
+ * @returns {Promise<any>} - The response data.
257
+ */
258
+ deleteBranch(branch) {
259
+ return this.request("/branch", {
260
+ method: "DELETE",
261
+ body: JSON.stringify({ branch })
262
+ });
263
+ }
264
+ /**
265
+ * Merges a branch into the target branch.
266
+ * @param {string} target - The target branch.
267
+ * @param {object} [options={}] - The merge options.
268
+ * @param {string} [options.message] - A message describing the merge.
269
+ * @param {string} [options.source='main'] - The source branch.
270
+ * @param {string} [options.type='patch'] - The type of merge.
271
+ * @param {string} [options.version] - The version number.
272
+ * @param {boolean} [options.commit='false'] - Whether to commit the merge.
273
+ * @param {Array} [options.changes] - The changes to apply during the merge.
274
+ * @returns {Promise<any>} - The response data.
275
+ */
276
+ mergeBranch(target, {
277
+ message,
278
+ source = "main",
279
+ type = "patch",
280
+ version,
281
+ commit = "false",
282
+ changes
283
+ } = {}) {
284
+ return this.request("/merge", {
285
+ method: "POST",
286
+ body: JSON.stringify({
287
+ target,
288
+ source,
289
+ message,
290
+ type,
291
+ version,
292
+ commit,
293
+ changes
294
+ })
295
+ });
296
+ }
297
+ /**
298
+ * Restores an older version of the project.
299
+ * @param {string} version - The version number to restore.
300
+ * @param {object} [options={}] - The restore options.
301
+ * @param {string} [options.branch='main'] - The branch name.
302
+ * @param {string} [options.type='patch'] - The type of restore.
303
+ * @param {string} [options.message] - A message describing the restore.
304
+ * @returns {Promise<any>} - The response data.
305
+ */
306
+ restoreVersion(version, { branch = "main", type = "patch", message } = {}) {
307
+ return this.request("/restore", {
308
+ method: "POST",
309
+ body: JSON.stringify({ branch, version, type, message })
310
+ });
311
+ }
312
+ };
313
+ var symstoryClient_default = {
314
+ /**
315
+ * Creates a new SymstoryClient instance.
316
+ * @param {string} appKey - The application key.
317
+ * @param {object} options - The options for the client.
318
+ * @returns {SymstoryClient} - The SymstoryClient instance.
319
+ */
320
+ create: (appKey, options) => new SymstoryClient(appKey, options),
321
+ /**
322
+ * Initializes the Symstory client.
323
+ * @param {string} appKey - The application key.
324
+ * @param {object} options - The options for the client.
325
+ * @returns {SymstoryClient} - The initialized SymstoryClient instance.
326
+ */
327
+ init(appKey, options) {
328
+ this.client = this.create(appKey, options);
329
+ return this;
330
+ }
331
+ };
332
+ export {
333
+ symstoryClient_default as default
334
+ };
@@ -219,12 +219,12 @@ var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
219
219
  var ref = Object.prototype;
220
220
  var hasOwnProperty = ref.hasOwnProperty;
221
221
  var toString = ref.toString;
222
- var hasOwn = Object.hasOwn || (function(obj, propName) {
222
+ var hasOwn = Object.hasOwn || function(obj, propName) {
223
223
  return hasOwnProperty.call(obj, propName);
224
- });
225
- var isArray = Array.isArray || (function(obj) {
224
+ };
225
+ var isArray = Array.isArray || function(obj) {
226
226
  return toString.call(obj) === "[object Array]";
227
- });
227
+ };
228
228
  var regexpCache = /* @__PURE__ */ Object.create(null);
229
229
  function wordsRegexp(words) {
230
230
  return regexpCache[words] || (regexpCache[words] = new RegExp("^(?:" + words.replace(/ /g, "|") + ")$"));
@@ -741,44 +741,6 @@ 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
- };
782
744
  pp$8.parseStatement = function(context, topLevel, exports) {
783
745
  var starttype = this.type, node = this.startNode(), kind;
784
746
  if (this.isLet(context)) {
@@ -862,22 +824,6 @@ pp$8.parseStatement = function(context, topLevel, exports) {
862
824
  this.next();
863
825
  return this.parseFunctionStatement(node, true, !context);
864
826
  }
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
- }
881
827
  var maybeName = this.value, expr = this.parseExpression();
882
828
  if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon)) {
883
829
  return this.parseLabeledStatement(node, maybeName, expr, context);
@@ -951,20 +897,24 @@ pp$8.parseForStatement = function(node) {
951
897
  this.next();
952
898
  this.parseVar(init$1, true, kind);
953
899
  this.finishNode(init$1, "VariableDeclaration");
954
- return this.parseForAfterInit(node, init$1, awaitAt);
955
- }
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();
900
+ if ((this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && init$1.declarations.length === 1) {
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);
963
911
  }
964
- this.parseVar(init$2, true, usingKind);
965
- this.finishNode(init$2, "VariableDeclaration");
966
- return this.parseForAfterInit(node, init$2, awaitAt);
912
+ if (awaitAt > -1) {
913
+ this.unexpected(awaitAt);
914
+ }
915
+ return this.parseFor(node, init$1);
967
916
  }
917
+ var startsWithLet = this.isContextual("let"), isForOf = false;
968
918
  var containsEsc = this.containsEsc;
969
919
  var refDestructuringErrors = new DestructuringErrors();
970
920
  var initPos = this.start;
@@ -996,24 +946,6 @@ pp$8.parseForStatement = function(node) {
996
946
  }
997
947
  return this.parseFor(node, init);
998
948
  };
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
- };
1017
949
  pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) {
1018
950
  this.next();
1019
951
  return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync);
@@ -1239,8 +1171,6 @@ pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) {
1239
1171
  decl.init = this.parseMaybeAssign(isFor);
1240
1172
  } else if (!allowMissingInitializer && kind === "const" && !(this.type === types$1._in || this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
1241
1173
  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");
1244
1174
  } else if (!allowMissingInitializer && decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) {
1245
1175
  this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value");
1246
1176
  } else {
@@ -1254,7 +1184,7 @@ pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) {
1254
1184
  return node;
1255
1185
  };
1256
1186
  pp$8.parseVarId = function(decl, kind) {
1257
- decl.id = kind === "using" || kind === "await using" ? this.parseIdent() : this.parseBindingAtom();
1187
+ decl.id = this.parseBindingAtom();
1258
1188
  this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false);
1259
1189
  };
1260
1190
  var FUNC_STATEMENT = 1;
@@ -2724,7 +2654,7 @@ pp$5.parseLiteral = function(value) {
2724
2654
  node.value = value;
2725
2655
  node.raw = this.input.slice(this.start, this.end);
2726
2656
  if (node.raw.charCodeAt(node.raw.length - 1) === 110) {
2727
- node.bigint = node.value != null ? node.value.toString() : node.raw.slice(0, -1).replace(/_/g, "");
2657
+ node.bigint = node.raw.slice(0, -1).replace(/_/g, "");
2728
2658
  }
2729
2659
  this.next();
2730
2660
  return this.finishNode(node, "Literal");
@@ -5584,7 +5514,7 @@ pp.readWord = function() {
5584
5514
  }
5585
5515
  return this.finishToken(type, word);
5586
5516
  };
5587
- var version = "8.15.0";
5517
+ var version = "8.14.1";
5588
5518
  Parser.acorn = {
5589
5519
  Parser,
5590
5520
  version,
@@ -6059,6 +5989,9 @@ var validateParams = {
6059
5989
  if (!data2.key) {
6060
5990
  throw new Error("Data must contain a key property");
6061
5991
  }
5992
+ if (!data2.value) {
5993
+ throw new Error("Data must contain a value property");
5994
+ }
6062
5995
  if (CODE_TYPES.includes(type)) {
6063
5996
  if (RESERVED_KEYWORDS.includes(data2.key)) {
6064
5997
  throw new Error(