File tree Expand file tree Collapse file tree 5 files changed +33
-10
lines changed
Expand file tree Collapse file tree 5 files changed +33
-10
lines changed Original file line number Diff line number Diff line change 55jobs :
66 include :
77 - stage : NPM RC Release
8- if : tag == *-rc*
8+ if : tag =~ /-(rc|RC)/
99 node_js : " 14.16"
1010 script :
1111 - npm install
1717 api_key : $NPM_API_KEY
1818 tag : next
1919 - stage : NPM Release
20- if : tag != *-rc*
20+ if : not tag =~ /-(rc|RC)/
2121 node_js : " 14.16"
2222 script :
2323 - npm install
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ import { Client, Account } from "appwrite";
3333To install with a CDN (content delivery network) add the following scripts to the bottom of your <body > tag, but before you use any Appwrite services:
3434
3535``` html
36- <script src =" https://cdn.jsdelivr.net/npm/appwrite@14.0.0 " ></script >
36+ <script src =" https://cdn.jsdelivr.net/npm/appwrite@14.0.1 " ></script >
3737```
3838
3939
Original file line number Diff line number Diff line change 22 "name" : " appwrite" ,
33 "homepage" : " https://appwrite.io/support" ,
44 "description" : " Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API" ,
5- "version" : " 14.0.0 " ,
5+ "version" : " 14.0.1 " ,
66 "license" : " BSD-3-Clause" ,
77 "main" : " dist/cjs/sdk.js" ,
88 "exports" : {
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ class Client {
103103 'x-sdk-name' : 'Web' ,
104104 'x-sdk-platform' : 'client' ,
105105 'x-sdk-language' : 'web' ,
106- 'x-sdk-version' : '14.0.0 ' ,
106+ 'x-sdk-version' : '14.0.1 ' ,
107107 'X-Appwrite-Response-Format' : '1.5.0' ,
108108 } ;
109109
@@ -224,7 +224,11 @@ class Client {
224224 }
225225 } ,
226226 createSocket : ( ) => {
227- if ( this . realtime . channels . size < 1 ) return ;
227+ if ( this . realtime . channels . size < 1 ) {
228+ this . realtime . reconnect = false ;
229+ this . realtime . socket ?. close ( ) ;
230+ return ;
231+ }
228232
229233 const channels = new URLSearchParams ( ) ;
230234 channels . set ( 'project' , this . config . project ) ;
Original file line number Diff line number Diff line change 11export class ID {
2+ // Generate an hex ID based on timestamp
3+ // Recreated from https://www.php.net/manual/en/function.uniqid.php
4+ static #hexTimestamp( ) : string {
5+ const now = new Date ( ) ;
6+ const sec = Math . floor ( now . getTime ( ) / 1000 ) ;
7+ const msec = now . getMilliseconds ( ) ;
8+
9+ // Convert to hexadecimal
10+ const hexTimestamp = sec . toString ( 16 ) + msec . toString ( 16 ) . padStart ( 5 , '0' ) ;
11+ return hexTimestamp ;
12+ }
13+
214 public static custom ( id : string ) : string {
315 return id
416 }
5-
6- public static unique ( ) : string {
7- return 'unique()'
17+
18+ public static unique ( padding : number = 7 ) : string {
19+ // Generate a unique ID with padding to have a longer ID
20+ const baseId = ID . #hexTimestamp( ) ;
21+ let randomPadding = '' ;
22+ for ( let i = 0 ; i < padding ; i ++ ) {
23+ const randomHexDigit = Math . floor ( Math . random ( ) * 16 ) . toString ( 16 ) ;
24+ randomPadding += randomHexDigit ;
25+ }
26+ return baseId + randomPadding ;
827 }
9- }
28+ }
You can’t perform that action at this time.
0 commit comments