@promptbook/remote-client 0.85.0-0 → 0.85.0-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.
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import type fs from 'fs/promises';
2
+ import type fs from 'node:fs/promises';
3
3
  /**
4
4
  * Container for all the tools needed to manipulate with filesystem
5
5
  */
@@ -11,6 +11,8 @@ import type { RemoteServerOptions } from './types/RemoteServerOptions';
11
11
  */
12
12
  export declare function startRemoteServer<TCustomOptions = undefined>(options: RemoteServerOptions<TCustomOptions>): IDestroyable;
13
13
  /**
14
+ * TODO: !!!!!!! CORS and security
15
+ * TODO: !!!!!!! Allow to pass tokem here
14
16
  * TODO: [👩🏾‍🤝‍🧑🏾] Allow to pass custom fetch function here - PromptbookFetch
15
17
  * TODO: Split this file into multiple functions - handler for each request
16
18
  * TODO: Maybe use `$exportJson`
@@ -25,12 +25,14 @@ export type RemoteServerOptions<TCustomOptions> = CommonToolsOptions & {
25
25
  */
26
26
  readonly port: number;
27
27
  /**
28
- * Path for the Socket.io server to listen
28
+ * Root path of the server
29
29
  *
30
- * @default '/socket.io'
31
- * @example '/promptbook/socket.io'
30
+ * Note: This is useful when you reverse proxy the server without changing the path
31
+ *
32
+ * @default '/'
33
+ * @example '/api/promptbook/'
32
34
  */
33
- readonly path: string_uri;
35
+ readonly rootPath: string_uri;
34
36
  } & (AnonymousRemoteServerOptions | ApplicationRemoteServerOptions<TCustomOptions> | (AnonymousRemoteServerOptions & ApplicationRemoteServerOptions<TCustomOptions>));
35
37
  export type AnonymousRemoteServerOptions = {
36
38
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/remote-client",
3
- "version": "0.85.0-0",
3
+ "version": "0.85.0-1",
4
4
  "description": "It's time for a paradigm shift. The future of software in plain English, French or Latin",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -47,7 +47,7 @@
47
47
  "module": "./esm/index.es.js",
48
48
  "typings": "./esm/typings/src/_packages/remote-client.index.d.ts",
49
49
  "peerDependencies": {
50
- "@promptbook/core": "0.85.0-0"
50
+ "@promptbook/core": "0.85.0-1"
51
51
  },
52
52
  "dependencies": {
53
53
  "crypto-js": "4.2.0",
package/umd/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('spacetrim'), require('socket.io-client'), require('crypto-js'), require('crypto-js/enc-hex'), require('papaparse'), require('path')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'spacetrim', 'socket.io-client', 'crypto-js', 'crypto-js/enc-hex', 'papaparse', 'path'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-remote-client"] = {}, global.spaceTrim, global.socket_ioClient, global.cryptoJs, global.hexEncoder, global.papaparse, global.path));
5
- })(this, (function (exports, spaceTrim, socket_ioClient, cryptoJs, hexEncoder, papaparse, path) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('spacetrim'), require('socket.io-client'), require('crypto-js'), require('crypto-js/enc-hex'), require('papaparse'), require('node:path')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'spacetrim', 'socket.io-client', 'crypto-js', 'crypto-js/enc-hex', 'papaparse', 'node:path'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-remote-client"] = {}, global.spaceTrim, global.socket_ioClient, global.cryptoJs, global.hexEncoder, global.papaparse, global.node_path));
5
+ })(this, (function (exports, spaceTrim, socket_ioClient, cryptoJs, hexEncoder, papaparse, node_path) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -23,7 +23,7 @@
23
23
  * @generated
24
24
  * @see https://github.com/webgptorg/promptbook
25
25
  */
26
- var PROMPTBOOK_ENGINE_VERSION = '0.84.0';
26
+ var PROMPTBOOK_ENGINE_VERSION = '0.85.0-0';
27
27
  /**
28
28
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
29
29
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -4957,7 +4957,7 @@
4957
4957
  value = value.replace(/\.html$/, '');
4958
4958
  }
4959
4959
  else if (isValidFilePath(value)) {
4960
- value = path.basename(value);
4960
+ value = node_path.basename(value);
4961
4961
  // Note: Keeping extension in the name
4962
4962
  }
4963
4963
  value = value.split('/').join('-');