@live-change/url-service 0.2.45 → 0.2.47

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 (3) hide show
  1. package/LICENSE.md +11 -0
  2. package/index.js +6 -8
  3. package/package.json +4 -4
package/LICENSE.md ADDED
@@ -0,0 +1,11 @@
1
+ Copyright 2019-2022 Michał Łaszczewski
2
+
3
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4
+
5
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6
+
7
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8
+
9
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10
+
11
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/index.js CHANGED
@@ -70,9 +70,7 @@ async function generateUrl(props, emit) {
70
70
  const suffix = props.suffix || ''
71
71
  const randomCharacters = props.charset ? charsets[props.charset] : charsets.all
72
72
  let randomPathLength = props.length || defaultRandomPathLength
73
- const group = props.group
74
73
  let maxLength = props.maxLength || 125
75
- maxLength -= group.length
76
74
  const sufixLength = 15
77
75
  let path = ''
78
76
  let random = false
@@ -164,7 +162,7 @@ async function generateUrl(props, emit) {
164
162
  if(existingCanonical) {
165
163
  emit({
166
164
  type: 'targetOwnedRedirectCreated',
167
- redirect: url,
165
+ redirect: app.generateUid(),
168
166
  identifiers: {
169
167
  targetType: props.targetType,
170
168
  target: props.target,
@@ -220,7 +218,7 @@ definition.trigger({
220
218
  type: Number
221
219
  },
222
220
  redirect: {
223
- type: String
221
+ type: Boolean
224
222
  },
225
223
  charset: {
226
224
  type: String
@@ -263,7 +261,7 @@ definition.action({
263
261
  type: Number
264
262
  },
265
263
  redirect: {
266
- type: String
264
+ type: Boolean
267
265
  },
268
266
  charset: {
269
267
  type: String
@@ -307,7 +305,7 @@ definition.action({
307
305
  validation: ['nonEmpty']
308
306
  },
309
307
  redirect: {
310
- type: String
308
+ type: Boolean
311
309
  }
312
310
  },
313
311
  accessControl: {
@@ -329,8 +327,8 @@ definition.action({
329
327
  if(redirect) {
330
328
  url = app.generateUid()
331
329
  emit({
332
- type: 'targetOwnedCanonicalCreated',
333
- redirect: url,
330
+ type: 'targetOwnedRedirectCreated',
331
+ redirect: app.generateUid(),
334
332
  identifiers: {
335
333
  targetType, target,
336
334
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/url-service",
3
- "version": "0.2.45",
3
+ "version": "0.2.47",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,12 +21,12 @@
21
21
  "url": "https://www.viamage.com/"
22
22
  },
23
23
  "dependencies": {
24
- "@live-change/framework": "0.6.11",
25
- "@live-change/relations-plugin": "0.6.11",
24
+ "@live-change/framework": "0.6.12",
25
+ "@live-change/relations-plugin": "0.6.12",
26
26
  "lru-cache": "^7.12.0",
27
27
  "pluralize": "8.0.0",
28
28
  "progress-stream": "^2.0.0",
29
29
  "prosemirror-model": "^1.18.1"
30
30
  },
31
- "gitHead": "aab9b222492335dda687dcf4a1c2794ec4fa610f"
31
+ "gitHead": "710dc205163bf09d6b9469822101e9dfc11b74cb"
32
32
  }