polyapi 0.1.64 → 0.1.66

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.
@@ -32,6 +32,9 @@ export interface ErrorEvent {
32
32
  data?: any;
33
33
  status?: number;
34
34
  statusText?: string;
35
+ functionId: string;
36
+ applicationId?: string;
37
+ userId?: string;
35
38
  }
36
39
  export interface ErrorHandlerOptions {
37
40
  applicationIds?: string[];
@@ -21,7 +21,7 @@ const getVariableHandlers = (clientID, getSocket) => {
21
21
  set(variableHandlers, path, {
22
22
  get: () => {
23
23
  if (secret) {
24
- throw new Error('Cannot access secret variable from client. Use .onServer() instead within Poly function.');
24
+ throw new Error('Cannot access secret variable from client. Use .inject() instead within Poly function.');
25
25
  } else {
26
26
  return axios.get(
27
27
  `/variables/${id}/value`
@@ -68,7 +68,7 @@ const getVariableHandlers = (clientID, getSocket) => {
68
68
 
69
69
  return unregisterEventHandler;
70
70
  },
71
- onServer: (path) => ({
71
+ inject: (path) => ({
72
72
  type: 'PolyVariable',
73
73
  id,
74
74
  path
@@ -38,11 +38,11 @@ declare module vari {
38
38
  * Gets variable data.
39
39
  * This is intended to be used in Poly functions, so the variable values are resolved on the server
40
40
  * without fetching them from the client.
41
- * @param path The JSON path to the property within the value, e.g. `vari.products.shop.onServer('id')`
41
+ * @param path The JSON path to the property within the value, e.g. `vari.products.shop.inject('id')`
42
42
  * @example
43
- * await poly.products.addItem(vari.products.shopId.onServer(), 'Toy car', 1)
43
+ * await poly.products.addItem(vari.products.shopId.inject(), 'Toy car', 1)
44
44
  */
45
- onServer: (path?: string) => {{#if isObjectType}}any{{else}}{{{type}}}{{/if}};
45
+ inject: (path?: string) => {{#if isObjectType}}any{{else}}{{{type}}}{{/if}};
46
46
  }
47
47
  {{/each}}
48
48
  get: () => Promise<{{interfaceName}}Values>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polyapi",
3
- "version": "0.1.64",
3
+ "version": "0.1.66",
4
4
  "description": "Poly is a CLI tool to help create and manage your Poly definitions.",
5
5
  "license": "MIT",
6
6
  "repository": {