@shaxpir/duiduidui-models 1.2.0 → 1.2.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.
@@ -38,6 +38,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.ShareSync = exports.ShareSyncFactory = exports.ShareSyncDisposalStrategy = void 0;
40
40
  const client_1 = __importStar(require("@shaxpir/sharedb/lib/client"));
41
+ const shaxpir_common_1 = require("@shaxpir/shaxpir-common");
41
42
  const reconnecting_websocket_1 = __importDefault(require("reconnecting-websocket"));
42
43
  const models_1 = require("../models");
43
44
  const Content_1 = require("../models/Content");
@@ -178,7 +179,7 @@ class ShareSync {
178
179
  }
179
180
  }
180
181
  makeContentId() {
181
- return this._encryption.getRandomString(Content_1.Content.ID_LENGTH);
182
+ return this._encryption.getRandomString(shaxpir_common_1.Base62.CHARS, Content_1.Content.ID_LENGTH);
182
183
  }
183
184
  async exists(userId, kind, ref) {
184
185
  // Check to see if this item exists in the model cache
@@ -1,5 +1,5 @@
1
1
  import ShareDB, { Connection, Doc } from '@shaxpir/sharedb/lib/client';
2
- import { CompactDateTime } from '@shaxpir/shaxpir-common';
2
+ import { Base62, CompactDateTime } from '@shaxpir/shaxpir-common';
3
3
  import ReconnectingWebSocket from 'reconnecting-websocket';
4
4
  import { Model, Profile } from '../models';
5
5
  import { Content, ContentBody, ContentId, ContentRef } from '../models/Content';
@@ -197,7 +197,7 @@ export class ShareSync {
197
197
  }
198
198
 
199
199
  public makeContentId():ContentId {
200
- return this._encryption.getRandomString(Content.ID_LENGTH) as ContentId;
200
+ return this._encryption.getRandomString(Base62.CHARS, Content.ID_LENGTH) as ContentId;
201
201
  }
202
202
 
203
203
  public async exists(userId:ContentId, kind:ContentKind, ref:ContentRef):Promise<boolean> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shaxpir/duiduidui-models",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/shaxpir/duiduidui-models"