@twilio/conversations 1.3.0-rc7 → 2.0.0-rc.3
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.
- package/CHANGELOG.md +201 -0
- package/README.md +5 -5
- package/dist/browser.js +7866 -0
- package/dist/browser.js.map +1 -0
- package/dist/docs/assets/css/main.css +2660 -0
- package/dist/docs/assets/images/icons.png +0 -0
- package/dist/docs/assets/images/icons@2x.png +0 -0
- package/dist/docs/assets/images/widgets.png +0 -0
- package/dist/docs/assets/images/widgets@2x.png +0 -0
- package/dist/docs/assets/js/main.js +248 -0
- package/dist/docs/assets/js/search.js +1 -0
- package/dist/docs/classes/AggregatedDeliveryReceipt.html +3286 -0
- package/dist/docs/classes/Client.html +4181 -0
- package/dist/docs/classes/Conversation.html +4397 -0
- package/dist/docs/classes/DetailedDeliveryReceipt.html +3265 -0
- package/dist/docs/classes/Media.html +3295 -0
- package/dist/docs/classes/Message.html +3713 -0
- package/dist/docs/classes/MessageBuilder.html +3280 -0
- package/dist/docs/classes/Participant.html +3517 -0
- package/dist/docs/classes/PushNotification.html +3232 -0
- package/dist/docs/classes/RestPaginator.html +3262 -0
- package/dist/docs/classes/UnsentMessage.html +3144 -0
- package/dist/docs/classes/User.html +3451 -0
- package/dist/docs/index.html +3387 -212
- package/dist/docs/interfaces/ClientOptions.html +3136 -0
- package/dist/docs/interfaces/ConversationState.html +3152 -0
- package/dist/docs/interfaces/CreateConversationOptions.html +3168 -0
- package/dist/docs/interfaces/LastMessage.html +3152 -0
- package/dist/docs/interfaces/Paginator.html +3243 -0
- package/dist/docs/interfaces/PushNotificationData.html +3168 -0
- package/dist/docs/interfaces/SendEmailOptions.html +3136 -0
- package/dist/docs/interfaces/SendMediaOptions.html +3169 -0
- package/dist/docs/modules.html +3418 -0
- package/dist/lib.d.ts +1944 -0
- package/dist/lib.js +7866 -0
- package/dist/lib.js.map +1 -0
- package/dist/post-install.js +29 -0
- package/dist/react-native.js +4031 -0
- package/dist/react-native.js.map +1 -0
- package/dist/twilio-conversations.js +40905 -0
- package/dist/twilio-conversations.min.js +156 -0
- package/package.json +59 -48
- package/.circleci/config.yml +0 -650
- package/.deepsource.toml +0 -6
- package/.env.example +0 -13
- package/browser/aggregateddeliveryreceipt.js +0 -152
- package/browser/client.js +0 -991
- package/browser/configuration.js +0 -80
- package/browser/conversation.js +0 -1826
- package/browser/data/conversations.js +0 -665
- package/browser/data/messages.js +0 -522
- package/browser/data/participants.js +0 -411
- package/browser/data/users.js +0 -281
- package/browser/detaileddeliveryreceipt.js +0 -44
- package/browser/index.js +0 -4
- package/browser/interfaces/limits.js +0 -3
- package/browser/interfaces/notificationtypes.js +0 -21
- package/browser/interfaces/paginator.js +0 -53
- package/browser/interfaces/responsecodes.js +0 -20
- package/browser/interfaces/transport.js +0 -3
- package/browser/logger.js +0 -141
- package/browser/media.js +0 -198
- package/browser/message.js +0 -685
- package/browser/participant.js +0 -415
- package/browser/pushnotification.js +0 -49
- package/browser/restpaginator.js +0 -74
- package/browser/services/network.js +0 -223
- package/browser/services/readhorizon.js +0 -181
- package/browser/services/typingindicator.js +0 -142
- package/browser/session.js +0 -505
- package/browser/sessionerror.js +0 -93
- package/browser/sri.json +0 -1
- package/browser/synclist.js +0 -90
- package/browser/synclistdescriptor.js +0 -29
- package/browser/syncpaginator.js +0 -63
- package/browser/user.js +0 -431
- package/browser/util/deferred.js +0 -56
- package/browser/util/index.js +0 -108
- package/dist/@twilio/conversations.js +0 -35565
- package/dist/@twilio/conversations.min.js +0 -204
- package/dist/docs/AggregatedDeliveryReceipt.html +0 -948
- package/dist/docs/Client.html +0 -5075
- package/dist/docs/Conversation.html +0 -6018
- package/dist/docs/DetailedDeliveryReceipt.html +0 -641
- package/dist/docs/Media.html +0 -694
- package/dist/docs/Message.html +0 -1934
- package/dist/docs/Paginator.html +0 -605
- package/dist/docs/Participant.html +0 -1510
- package/dist/docs/PushNotification.html +0 -836
- package/dist/docs/SessionError.html +0 -379
- package/dist/docs/User.html +0 -1315
- package/dist/docs/classes.list.html +0 -4431
- package/dist/docs/fonts/glyphicons-halflings-regular.eot +0 -0
- package/dist/docs/fonts/glyphicons-halflings-regular.svg +0 -288
- package/dist/docs/fonts/glyphicons-halflings-regular.ttf +0 -0
- package/dist/docs/fonts/glyphicons-halflings-regular.woff +0 -0
- package/dist/docs/fonts/glyphicons-halflings-regular.woff2 +0 -0
- package/dist/docs/img/glyphicons-halflings-white.png +0 -0
- package/dist/docs/img/glyphicons-halflings.png +0 -0
- package/dist/docs/quicksearch.html +0 -31
- package/dist/docs/scripts/docstrap.lib.js +0 -11
- package/dist/docs/scripts/fulltext-search-ui.js +0 -89
- package/dist/docs/scripts/fulltext-search.js +0 -36
- package/dist/docs/scripts/lunr.min.js +0 -6
- package/dist/docs/scripts/prettify/Apache-License-2.0.txt +0 -202
- package/dist/docs/scripts/prettify/jquery.min.js +0 -6
- package/dist/docs/scripts/prettify/lang-css.js +0 -21
- package/dist/docs/scripts/prettify/prettify.js +0 -496
- package/dist/docs/scripts/sunlight.js +0 -1157
- package/dist/docs/scripts/toc.js +0 -203
- package/dist/docs/styles/darkstrap.css +0 -960
- package/dist/docs/styles/prettify-tomorrow.css +0 -132
- package/dist/docs/styles/site.cerulean.css +0 -7008
- package/dist/docs/styles/site.cosmo.css +0 -7061
- package/dist/docs/styles/site.cyborg.css +0 -7048
- package/dist/docs/styles/site.darkly.css +0 -7171
- package/dist/docs/styles/site.darkstrap.css +0 -5638
- package/dist/docs/styles/site.dibs-bootstrap.css +0 -5899
- package/dist/docs/styles/site.flatly.css +0 -7147
- package/dist/docs/styles/site.journal.css +0 -6973
- package/dist/docs/styles/site.lumen.css +0 -7298
- package/dist/docs/styles/site.paper.css +0 -7623
- package/dist/docs/styles/site.readable.css +0 -6997
- package/dist/docs/styles/site.sandstone.css +0 -7035
- package/dist/docs/styles/site.simplex.css +0 -7023
- package/dist/docs/styles/site.slate.css +0 -7343
- package/dist/docs/styles/site.spacelab.css +0 -7055
- package/dist/docs/styles/site.superhero.css +0 -7131
- package/dist/docs/styles/site.united.css +0 -6895
- package/dist/docs/styles/site.yeti.css +0 -7195
- package/dist/docs/styles/sunlight.dark.css +0 -345
- package/dist/docs/styles/sunlight.default.css +0 -344
- package/dist/sri.json +0 -1
- package/lib/aggregateddeliveryreceipt.d.ts +0 -98
- package/lib/aggregateddeliveryreceipt.js +0 -112
- package/lib/client.d.ts +0 -317
- package/lib/client.js +0 -633
- package/lib/configuration.d.ts +0 -21
- package/lib/configuration.js +0 -41
- package/lib/conversation.d.ts +0 -460
- package/lib/conversation.js +0 -940
- package/lib/data/conversations.d.ts +0 -57
- package/lib/data/conversations.js +0 -318
- package/lib/data/messages.d.ts +0 -75
- package/lib/data/messages.js +0 -208
- package/lib/data/participants.d.ts +0 -94
- package/lib/data/participants.js +0 -204
- package/lib/data/users.d.ts +0 -42
- package/lib/data/users.js +0 -113
- package/lib/detaileddeliveryreceipt.d.ts +0 -45
- package/lib/detaileddeliveryreceipt.js +0 -34
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -3
- package/lib/interfaces/limits.d.ts +0 -8
- package/lib/interfaces/limits.js +0 -2
- package/lib/interfaces/notificationtypes.d.ts +0 -8
- package/lib/interfaces/notificationtypes.js +0 -11
- package/lib/interfaces/paginator.d.ts +0 -52
- package/lib/interfaces/paginator.js +0 -28
- package/lib/interfaces/responsecodes.d.ts +0 -8
- package/lib/interfaces/responsecodes.js +0 -10
- package/lib/interfaces/transport.d.ts +0 -13
- package/lib/interfaces/transport.js +0 -2
- package/lib/logger.d.ts +0 -18
- package/lib/logger.js +0 -35
- package/lib/media.d.ts +0 -52
- package/lib/media.js +0 -69
- package/lib/message.d.ts +0 -136
- package/lib/message.js +0 -305
- package/lib/participant.d.ts +0 -142
- package/lib/participant.js +0 -219
- package/lib/pushnotification.d.ts +0 -48
- package/lib/pushnotification.js +0 -39
- package/lib/restpaginator.d.ts +0 -19
- package/lib/restpaginator.js +0 -36
- package/lib/services/network.d.ts +0 -22
- package/lib/services/network.js +0 -87
- package/lib/services/readhorizon.d.ts +0 -28
- package/lib/services/readhorizon.js +0 -112
- package/lib/services/typingindicator.d.ts +0 -50
- package/lib/services/typingindicator.js +0 -102
- package/lib/session.d.ts +0 -63
- package/lib/session.js +0 -213
- package/lib/sessionerror.d.ts +0 -12
- package/lib/sessionerror.js +0 -24
- package/lib/sri.json +0 -1
- package/lib/synclist.d.ts +0 -24
- package/lib/synclist.js +0 -28
- package/lib/synclistdescriptor.d.ts +0 -27
- package/lib/synclistdescriptor.js +0 -19
- package/lib/syncpaginator.d.ts +0 -22
- package/lib/syncpaginator.js +0 -37
- package/lib/user.d.ts +0 -98
- package/lib/user.js +0 -219
- package/lib/util/deferred.d.ts +0 -12
- package/lib/util/deferred.js +0 -22
- package/lib/util/index.d.ts +0 -28
- package/lib/util/index.js +0 -82
- package/tools/rtd-sdk-cdn-pin/.gitrepo +0 -12
- package/tools/rtd-sdk-cdn-pin/README.md +0 -54
- package/tools/rtd-sdk-cdn-pin/bintray-settings.xml.template +0 -16
- package/tools/rtd-sdk-cdn-pin/cdn-common/cdn-prepare.sh +0 -67
- package/tools/rtd-sdk-cdn-pin/cdn-pin-latest.sh +0 -19
- package/tools/rtd-sdk-cdn-pin/cdn-pin.sh +0 -19
- package/tools/rtd-sdk-cdn-pin/cdn-upload.sh +0 -13
- package/tools/rtd-sdk-cdn-pin/fetch/common/fetch-bintray-android.sh +0 -34
- package/tools/rtd-sdk-cdn-pin/fetch/common/fetch-npm.sh +0 -18
- package/tools/rtd-sdk-cdn-pin/fetch/twilio-chat-android.sh +0 -5
- package/tools/rtd-sdk-cdn-pin/fetch/twilio-chat-js.sh +0 -5
- package/tools/rtd-sdk-cdn-pin/fetch/twilio-conversations-android.sh +0 -6
- package/tools/rtd-sdk-cdn-pin/fetch/twilio-conversations-js.sh +0 -5
- package/tools/rtd-sdk-cdn-pin/fetch/twilio-sync-android.sh +0 -5
- package/tools/rtd-sdk-cdn-pin/fetch/twilio-sync-js.sh +0 -5
- package/tools/rtd-sdk-cdn-pin/fetch-artifact.sh +0 -26
- package/tools/sdk-release-tool/.gitrepo +0 -12
- package/tools/sdk-release-tool/Makefile +0 -49
- package/tools/sdk-release-tool/README.md +0 -275
- package/tools/sdk-release-tool/delete +0 -3
- package/tools/sdk-release-tool/download +0 -3
- package/tools/sdk-release-tool/get-cors +0 -3
- package/tools/sdk-release-tool/list +0 -3
- package/tools/sdk-release-tool/pin +0 -3
- package/tools/sdk-release-tool/pin-latest +0 -3
- package/tools/sdk-release-tool/requirements.txt +0 -4
- package/tools/sdk-release-tool/sdk-release-tool +0 -3
- package/tools/sdk-release-tool/sdk_release_tools/__init__.py +0 -0
- package/tools/sdk-release-tool/sdk_release_tools/__main__.py +0 -110
- package/tools/sdk-release-tool/sdk_release_tools/aws.py +0 -70
- package/tools/sdk-release-tool/sdk_release_tools/cli.py +0 -181
- package/tools/sdk-release-tool/sdk_release_tools/log.py +0 -24
- package/tools/sdk-release-tool/sdk_release_tools/ops.py +0 -295
- package/tools/sdk-release-tool/sdk_release_tools/rpm.py +0 -28
- package/tools/sdk-release-tool/sdk_release_tools/util.py +0 -186
- package/tools/sdk-release-tool/sdk_release_tools/versions.py +0 -362
- package/tools/sdk-release-tool/signal-sdk-js.json +0 -28
- package/tools/sdk-release-tool/tests/test_versions.py +0 -94
- package/tools/sdk-release-tool/twilio-accessmanager-android.json +0 -19
- package/tools/sdk-release-tool/twilio-accessmanager-ios.json +0 -26
- package/tools/sdk-release-tool/twilio-auth-ios.json +0 -29
- package/tools/sdk-release-tool/twilio-authenticator-ios.json +0 -29
- package/tools/sdk-release-tool/twilio-chat-android-2.json +0 -19
- package/tools/sdk-release-tool/twilio-chat-android.json +0 -22
- package/tools/sdk-release-tool/twilio-chat-ios.json +0 -26
- package/tools/sdk-release-tool/twilio-chat-js.json +0 -27
- package/tools/sdk-release-tool/twilio-client-android-aar.json +0 -22
- package/tools/sdk-release-tool/twilio-client-android.json +0 -22
- package/tools/sdk-release-tool/twilio-client-ios.json +0 -20
- package/tools/sdk-release-tool/twilio-client-js.json +0 -17
- package/tools/sdk-release-tool/twilio-client-sounds-js.json +0 -14
- package/tools/sdk-release-tool/twilio-common-android-maven.json +0 -16
- package/tools/sdk-release-tool/twilio-common-android.json +0 -22
- package/tools/sdk-release-tool/twilio-common-ios-rtc.json +0 -25
- package/tools/sdk-release-tool/twilio-common-ios.json +0 -25
- package/tools/sdk-release-tool/twilio-common-js.json +0 -19
- package/tools/sdk-release-tool/twilio-conversations-android.json +0 -22
- package/tools/sdk-release-tool/twilio-conversations-ios.json +0 -26
- package/tools/sdk-release-tool/twilio-conversations-js.json +0 -27
- package/tools/sdk-release-tool/twilio-flex-js.json +0 -20
- package/tools/sdk-release-tool/twilio-flex-webchat-js.json +0 -16
- package/tools/sdk-release-tool/twilio-frame-chat-android.json +0 -22
- package/tools/sdk-release-tool/twilio-frame-chat-ios.json +0 -23
- package/tools/sdk-release-tool/twilio-frame-chat-js.json +0 -23
- package/tools/sdk-release-tool/twilio-ip-messaging-android-maven.json +0 -16
- package/tools/sdk-release-tool/twilio-ip-messaging-android.json +0 -22
- package/tools/sdk-release-tool/twilio-ip-messaging-ios.json +0 -25
- package/tools/sdk-release-tool/twilio-ip-messaging-js.json +0 -21
- package/tools/sdk-release-tool/twilio-sync-android.json +0 -22
- package/tools/sdk-release-tool/twilio-sync-ios.json +0 -26
- package/tools/sdk-release-tool/twilio-sync-js.json +0 -39
- package/tools/sdk-release-tool/twilio-taskrouter-js.json +0 -17
- package/tools/sdk-release-tool/twilio-video-android.json +0 -22
- package/tools/sdk-release-tool/twilio-video-cpp-linux-cross-rootfs.json +0 -13
- package/tools/sdk-release-tool/twilio-video-cpp.json +0 -33
- package/tools/sdk-release-tool/twilio-video-ios.json +0 -25
- package/tools/sdk-release-tool/twilio-video-js.json +0 -19
- package/tools/sdk-release-tool/twilio-video-jsdocs.json +0 -14
- package/tools/sdk-release-tool/twilio-voice-android.json +0 -22
- package/tools/sdk-release-tool/twilio-voice-ios.json +0 -29
- package/tools/sdk-release-tool/unpin +0 -3
- package/tools/sdk-release-tool/unpin-latest +0 -3
- package/tools/sdk-release-tool/upload +0 -3
- package/twilio-chat.js.iml +0 -9
@@ -1,19 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
class SyncListDescriptor {
|
4
|
-
/**
|
5
|
-
* @param {Object} descriptor - sync list descriptor data object
|
6
|
-
* @private
|
7
|
-
*/
|
8
|
-
constructor(descriptor) {
|
9
|
-
this.channel_sid = descriptor.channel_sid;
|
10
|
-
this.status = descriptor.status;
|
11
|
-
this.channel = descriptor.channel;
|
12
|
-
this.messages = descriptor.messages;
|
13
|
-
this.roster = descriptor.roster;
|
14
|
-
this.lastConsumedMessageIndex = descriptor.last_consumed_message_index;
|
15
|
-
this.notificationLevel = descriptor.notification_level;
|
16
|
-
this.descriptor = descriptor;
|
17
|
-
}
|
18
|
-
}
|
19
|
-
exports.SyncListDescriptor = SyncListDescriptor;
|
package/lib/syncpaginator.d.ts
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
import { Paginator } from './interfaces/paginator';
|
2
|
-
/**
|
3
|
-
* @classdesc Pagination helper class for Sync
|
4
|
-
*
|
5
|
-
* @property {Array} items Array of elements on current page
|
6
|
-
* @property {boolean} hasNextPage
|
7
|
-
* @property {boolean} hasPrevPage
|
8
|
-
*/
|
9
|
-
declare class SyncPaginator<T> implements Paginator<T> {
|
10
|
-
private state;
|
11
|
-
hasNextPage: boolean;
|
12
|
-
hasPrevPage: boolean;
|
13
|
-
get items(): Array<T>;
|
14
|
-
/**
|
15
|
-
* @param {Array} items Array of element for current page
|
16
|
-
* @param {Object} params
|
17
|
-
*/
|
18
|
-
constructor(items: any, pageSize: any, anchor: any, direction: any, source: any);
|
19
|
-
nextPage(): Promise<SyncPaginator<T>>;
|
20
|
-
prevPage(): Promise<SyncPaginator<T>>;
|
21
|
-
}
|
22
|
-
export { SyncPaginator };
|
package/lib/syncpaginator.js
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
'use strict';
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
/**
|
4
|
-
* @classdesc Pagination helper class for Sync
|
5
|
-
*
|
6
|
-
* @property {Array} items Array of elements on current page
|
7
|
-
* @property {boolean} hasNextPage
|
8
|
-
* @property {boolean} hasPrevPage
|
9
|
-
*/
|
10
|
-
class SyncPaginator {
|
11
|
-
/**
|
12
|
-
* @param {Array} items Array of element for current page
|
13
|
-
* @param {Object} params
|
14
|
-
*/
|
15
|
-
constructor(items, pageSize, anchor, direction, source) {
|
16
|
-
this.hasNextPage = direction === 'backwards' ? anchor !== 'end' : items.length === pageSize;
|
17
|
-
this.hasPrevPage = direction === 'backwards'
|
18
|
-
? items.length === pageSize && (items.length > 0 && items[0].index !== 0)
|
19
|
-
: anchor !== 'end';
|
20
|
-
this.state = {
|
21
|
-
source,
|
22
|
-
nextPageArgs: this.hasNextPage ? [pageSize, items[items.length - 1].index, 'forward'] : null,
|
23
|
-
prevPageArgs: this.hasPrevPage ? [pageSize, (items.length > 0 ? items[0].index : 'end'), 'backwards'] : null,
|
24
|
-
items
|
25
|
-
};
|
26
|
-
}
|
27
|
-
get items() { return this.state.items; }
|
28
|
-
nextPage() {
|
29
|
-
return this.hasNextPage ? this.state.source.apply(null, this.state.nextPageArgs)
|
30
|
-
: Promise.reject(new Error('No next page for query'));
|
31
|
-
}
|
32
|
-
prevPage() {
|
33
|
-
return this.hasPrevPage ? this.state.source.apply(null, this.state.prevPageArgs)
|
34
|
-
: Promise.reject(new Error('No prev page for query'));
|
35
|
-
}
|
36
|
-
}
|
37
|
-
exports.SyncPaginator = SyncPaginator;
|
package/lib/user.d.ts
DELETED
@@ -1,98 +0,0 @@
|
|
1
|
-
/// <reference types="node" />
|
2
|
-
import { EventEmitter } from 'events';
|
3
|
-
import { Session } from './session';
|
4
|
-
import { SyncClient } from 'twilio-sync';
|
5
|
-
export interface UserServices {
|
6
|
-
session: Session;
|
7
|
-
syncClient: SyncClient;
|
8
|
-
}
|
9
|
-
declare namespace User {
|
10
|
-
type SubscriptionState = 'initializing' | 'subscribed' | 'unsubscribed';
|
11
|
-
type UpdateReason = 'friendlyName' | 'attributes' | 'reachabilityOnline' | 'reachabilityNotifiable';
|
12
|
-
interface UpdatedEventArgs {
|
13
|
-
user: User;
|
14
|
-
updateReasons: User.UpdateReason[];
|
15
|
-
}
|
16
|
-
}
|
17
|
-
/**
|
18
|
-
* @classdesc Extended user information.
|
19
|
-
* Note that <code>isOnline</code> and <code>isNotifiable</code> properties are eligible
|
20
|
-
* to use only if reachability function is enabled.
|
21
|
-
* You may check if it is enabled by reading value of {@link Client}'s <code>reachabilityEnabled</code> property.
|
22
|
-
*
|
23
|
-
* @property {String} identity - User identity
|
24
|
-
* @property {String} friendlyName - User friendly name, null if not set
|
25
|
-
* @property {any} attributes - Object with custom attributes for user
|
26
|
-
* @property {Boolean} isOnline - User real-time conversation connection status
|
27
|
-
* @property {Boolean} isNotifiable - User push notification registration status
|
28
|
-
* @property {Boolean} isSubscribed - Check if this user receives real-time status updates
|
29
|
-
*
|
30
|
-
* @fires User#updated
|
31
|
-
* @fires User#userSubscribed
|
32
|
-
* @fires User#userUnsubscribed
|
33
|
-
*
|
34
|
-
* @constructor
|
35
|
-
* @param {String} identity - Identity of user
|
36
|
-
* @param {String} entityId - id of user's object
|
37
|
-
* @param {Object} datasync - datasync service
|
38
|
-
* @param {Object} session - session service
|
39
|
-
*/
|
40
|
-
declare class User extends EventEmitter {
|
41
|
-
private entity;
|
42
|
-
private services;
|
43
|
-
private state;
|
44
|
-
private promiseToFetch;
|
45
|
-
private subscribed;
|
46
|
-
/**
|
47
|
-
* The update reason for <code>updated</code> event emitted on User
|
48
|
-
* @typedef {('friendlyName' | 'attributes' | 'reachabilityOnline' | 'reachabilityNotifiable')} User#UpdateReason
|
49
|
-
*/
|
50
|
-
constructor(identity: string, entityName: string, services: UserServices);
|
51
|
-
get identity(): string;
|
52
|
-
set identity(identity: string);
|
53
|
-
set entityName(name: string);
|
54
|
-
get attributes(): any;
|
55
|
-
get friendlyName(): string;
|
56
|
-
get isOnline(): boolean;
|
57
|
-
get isNotifiable(): boolean;
|
58
|
-
get isSubscribed(): boolean;
|
59
|
-
_update(key: string, value: any): void;
|
60
|
-
_updateReachabilityInfo(map: any, update: any): any;
|
61
|
-
_fetch(): Promise<User>;
|
62
|
-
_ensureFetched(): Promise<User>;
|
63
|
-
/**
|
64
|
-
* Updates user attributes.
|
65
|
-
* @param {any} attributes new attributes for User.
|
66
|
-
* @returns {Promise<User>}
|
67
|
-
*/
|
68
|
-
updateAttributes(attributes: any): Promise<User>;
|
69
|
-
/**
|
70
|
-
* Update Users friendlyName.
|
71
|
-
* @param {String|null} friendlyName - Updated friendlyName
|
72
|
-
* @returns {Promise<User>}
|
73
|
-
*/
|
74
|
-
updateFriendlyName(friendlyName: string | null): Promise<User>;
|
75
|
-
/**
|
76
|
-
* Removes User from subscription list.
|
77
|
-
* @returns {Promise<void>} Promise of completion
|
78
|
-
*/
|
79
|
-
unsubscribe(): Promise<void>;
|
80
|
-
}
|
81
|
-
export { User };
|
82
|
-
/**
|
83
|
-
* Fired when User's properties or reachability status have been updated.
|
84
|
-
* @event User#updated
|
85
|
-
* @type {Object}
|
86
|
-
* @property {User} user - Updated User
|
87
|
-
* @property {User#UpdateReason[]} updateReasons - Array of User's updated event reasons
|
88
|
-
*/
|
89
|
-
/**
|
90
|
-
* Fired when Client is subscribed to User.
|
91
|
-
* @event User#userSubscribed
|
92
|
-
* @type {User}
|
93
|
-
*/
|
94
|
-
/**
|
95
|
-
* Fired when Client is unsubscribed from this User.
|
96
|
-
* @event User#userUnsubscribed
|
97
|
-
* @type {User}
|
98
|
-
*/
|
package/lib/user.js
DELETED
@@ -1,219 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
-
};
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
-
};
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
-
const events_1 = require("events");
|
13
|
-
const logger_1 = require("./logger");
|
14
|
-
const util_1 = require("./util");
|
15
|
-
const twilio_sdk_type_validator_1 = require("twilio-sdk-type-validator");
|
16
|
-
const log = logger_1.Logger.scope('User');
|
17
|
-
/**
|
18
|
-
* @classdesc Extended user information.
|
19
|
-
* Note that <code>isOnline</code> and <code>isNotifiable</code> properties are eligible
|
20
|
-
* to use only if reachability function is enabled.
|
21
|
-
* You may check if it is enabled by reading value of {@link Client}'s <code>reachabilityEnabled</code> property.
|
22
|
-
*
|
23
|
-
* @property {String} identity - User identity
|
24
|
-
* @property {String} friendlyName - User friendly name, null if not set
|
25
|
-
* @property {any} attributes - Object with custom attributes for user
|
26
|
-
* @property {Boolean} isOnline - User real-time conversation connection status
|
27
|
-
* @property {Boolean} isNotifiable - User push notification registration status
|
28
|
-
* @property {Boolean} isSubscribed - Check if this user receives real-time status updates
|
29
|
-
*
|
30
|
-
* @fires User#updated
|
31
|
-
* @fires User#userSubscribed
|
32
|
-
* @fires User#userUnsubscribed
|
33
|
-
*
|
34
|
-
* @constructor
|
35
|
-
* @param {String} identity - Identity of user
|
36
|
-
* @param {String} entityId - id of user's object
|
37
|
-
* @param {Object} datasync - datasync service
|
38
|
-
* @param {Object} session - session service
|
39
|
-
*/
|
40
|
-
class User extends events_1.EventEmitter {
|
41
|
-
/**
|
42
|
-
* The update reason for <code>updated</code> event emitted on User
|
43
|
-
* @typedef {('friendlyName' | 'attributes' | 'reachabilityOnline' | 'reachabilityNotifiable')} User#UpdateReason
|
44
|
-
*/
|
45
|
-
constructor(identity, entityName, services) {
|
46
|
-
super();
|
47
|
-
this.subscribed = 'initializing';
|
48
|
-
this.setMaxListeners(0);
|
49
|
-
this.services = services;
|
50
|
-
this.state = {
|
51
|
-
identity: identity,
|
52
|
-
entityName: entityName,
|
53
|
-
friendlyName: null,
|
54
|
-
attributes: {},
|
55
|
-
online: null,
|
56
|
-
notifiable: null
|
57
|
-
};
|
58
|
-
}
|
59
|
-
get identity() { return this.state.identity; }
|
60
|
-
set identity(identity) { this.state.identity = identity; }
|
61
|
-
set entityName(name) { this.state.entityName = name; }
|
62
|
-
get attributes() { return this.state.attributes; }
|
63
|
-
get friendlyName() { return this.state.friendlyName; }
|
64
|
-
get isOnline() { return this.state.online; }
|
65
|
-
get isNotifiable() { return this.state.notifiable; }
|
66
|
-
get isSubscribed() { return this.subscribed == 'subscribed'; }
|
67
|
-
// Handles service updates
|
68
|
-
_update(key, value) {
|
69
|
-
let updateReasons = [];
|
70
|
-
log.debug('User for', this.state.identity, 'updated:', key, value);
|
71
|
-
switch (key) {
|
72
|
-
case 'friendlyName':
|
73
|
-
if (this.state.friendlyName !== value.value) {
|
74
|
-
updateReasons.push('friendlyName');
|
75
|
-
this.state.friendlyName = value.value;
|
76
|
-
}
|
77
|
-
break;
|
78
|
-
case 'attributes':
|
79
|
-
const updateAttributes = util_1.parseAttributes(value.value, `Retrieved malformed attributes from the server for user: ${this.state.identity}`, log);
|
80
|
-
if (!util_1.isDeepEqual(this.state.attributes, updateAttributes)) {
|
81
|
-
this.state.attributes = updateAttributes;
|
82
|
-
updateReasons.push('attributes');
|
83
|
-
}
|
84
|
-
break;
|
85
|
-
case 'reachability':
|
86
|
-
if (this.state.online !== value.online) {
|
87
|
-
this.state.online = value.online;
|
88
|
-
updateReasons.push('reachabilityOnline');
|
89
|
-
}
|
90
|
-
if (this.state.notifiable !== value.notifiable) {
|
91
|
-
this.state.notifiable = value.notifiable;
|
92
|
-
updateReasons.push('reachabilityNotifiable');
|
93
|
-
}
|
94
|
-
break;
|
95
|
-
default:
|
96
|
-
return;
|
97
|
-
}
|
98
|
-
if (updateReasons.length > 0) {
|
99
|
-
this.emit('updated', { user: this, updateReasons: updateReasons });
|
100
|
-
}
|
101
|
-
}
|
102
|
-
// Fetch reachability info
|
103
|
-
_updateReachabilityInfo(map, update) {
|
104
|
-
if (!this.services.session.reachabilityEnabled) {
|
105
|
-
return Promise.resolve();
|
106
|
-
}
|
107
|
-
return map.get('reachability')
|
108
|
-
.then(update)
|
109
|
-
.catch(err => { log.warn('Failed to get reachability info for ', this.state.identity, err); });
|
110
|
-
}
|
111
|
-
// Fetch user
|
112
|
-
async _fetch() {
|
113
|
-
if (!this.state.entityName) {
|
114
|
-
return this;
|
115
|
-
}
|
116
|
-
this.promiseToFetch = this.services.syncClient.map({ id: this.state.entityName, mode: 'open_existing', includeItems: true })
|
117
|
-
.then(map => {
|
118
|
-
this.entity = map;
|
119
|
-
map.on('itemUpdated', args => {
|
120
|
-
log.debug(this.state.entityName + ' (' + this.state.identity + ') itemUpdated: ' + args.item.key);
|
121
|
-
return this._update(args.item.key, args.item.data);
|
122
|
-
});
|
123
|
-
return Promise.all([
|
124
|
-
map.get('friendlyName')
|
125
|
-
.then(item => this._update(item.key, item.data)),
|
126
|
-
map.get('attributes')
|
127
|
-
.then(item => this._update(item.key, item.data)),
|
128
|
-
this._updateReachabilityInfo(map, item => this._update(item.key, item.data))
|
129
|
-
]);
|
130
|
-
})
|
131
|
-
.then(() => {
|
132
|
-
log.debug('Fetched for', this.identity);
|
133
|
-
this.subscribed = 'subscribed';
|
134
|
-
this.emit('userSubscribed', this);
|
135
|
-
return this;
|
136
|
-
})
|
137
|
-
.catch(err => {
|
138
|
-
this.promiseToFetch = null;
|
139
|
-
throw err;
|
140
|
-
});
|
141
|
-
return this.promiseToFetch;
|
142
|
-
}
|
143
|
-
_ensureFetched() {
|
144
|
-
return this.promiseToFetch || this._fetch();
|
145
|
-
}
|
146
|
-
/**
|
147
|
-
* Updates user attributes.
|
148
|
-
* @param {any} attributes new attributes for User.
|
149
|
-
* @returns {Promise<User>}
|
150
|
-
*/
|
151
|
-
async updateAttributes(attributes) {
|
152
|
-
if (this.subscribed == 'unsubscribed') {
|
153
|
-
throw new Error('Can\'t modify unsubscribed object');
|
154
|
-
}
|
155
|
-
await this.services.session.addCommand('editUserAttributes', {
|
156
|
-
username: this.state.identity,
|
157
|
-
attributes: JSON.stringify(attributes)
|
158
|
-
});
|
159
|
-
return this;
|
160
|
-
}
|
161
|
-
/**
|
162
|
-
* Update Users friendlyName.
|
163
|
-
* @param {String|null} friendlyName - Updated friendlyName
|
164
|
-
* @returns {Promise<User>}
|
165
|
-
*/
|
166
|
-
async updateFriendlyName(friendlyName) {
|
167
|
-
if (this.subscribed == 'unsubscribed') {
|
168
|
-
throw new Error('Can\'t modify unsubscribed object');
|
169
|
-
}
|
170
|
-
await this.services.session.addCommand('editUserFriendlyName', {
|
171
|
-
username: this.state.identity,
|
172
|
-
friendlyName: friendlyName
|
173
|
-
});
|
174
|
-
return this;
|
175
|
-
}
|
176
|
-
/**
|
177
|
-
* Removes User from subscription list.
|
178
|
-
* @returns {Promise<void>} Promise of completion
|
179
|
-
*/
|
180
|
-
async unsubscribe() {
|
181
|
-
if (this.promiseToFetch) {
|
182
|
-
await this.promiseToFetch;
|
183
|
-
this.entity.close();
|
184
|
-
this.promiseToFetch = null;
|
185
|
-
this.subscribed = 'unsubscribed';
|
186
|
-
this.emit('userUnsubscribed', this);
|
187
|
-
}
|
188
|
-
}
|
189
|
-
}
|
190
|
-
__decorate([
|
191
|
-
twilio_sdk_type_validator_1.validateTypesAsync(['string', 'number', 'boolean', 'object', twilio_sdk_type_validator_1.literal(null)]),
|
192
|
-
__metadata("design:type", Function),
|
193
|
-
__metadata("design:paramtypes", [Object]),
|
194
|
-
__metadata("design:returntype", Promise)
|
195
|
-
], User.prototype, "updateAttributes", null);
|
196
|
-
__decorate([
|
197
|
-
twilio_sdk_type_validator_1.validateTypesAsync(['string', twilio_sdk_type_validator_1.literal(null)]),
|
198
|
-
__metadata("design:type", Function),
|
199
|
-
__metadata("design:paramtypes", [String]),
|
200
|
-
__metadata("design:returntype", Promise)
|
201
|
-
], User.prototype, "updateFriendlyName", null);
|
202
|
-
exports.User = User;
|
203
|
-
/**
|
204
|
-
* Fired when User's properties or reachability status have been updated.
|
205
|
-
* @event User#updated
|
206
|
-
* @type {Object}
|
207
|
-
* @property {User} user - Updated User
|
208
|
-
* @property {User#UpdateReason[]} updateReasons - Array of User's updated event reasons
|
209
|
-
*/
|
210
|
-
/**
|
211
|
-
* Fired when Client is subscribed to User.
|
212
|
-
* @event User#userSubscribed
|
213
|
-
* @type {User}
|
214
|
-
*/
|
215
|
-
/**
|
216
|
-
* Fired when Client is unsubscribed from this User.
|
217
|
-
* @event User#userUnsubscribed
|
218
|
-
* @type {User}
|
219
|
-
*/
|
package/lib/util/deferred.d.ts
DELETED
package/lib/util/deferred.js
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
class Deferred {
|
4
|
-
constructor() {
|
5
|
-
this._promise = new Promise((resolve, reject) => {
|
6
|
-
this._resolve = resolve;
|
7
|
-
this._reject = reject;
|
8
|
-
});
|
9
|
-
}
|
10
|
-
get promise() { return this._promise; }
|
11
|
-
update(value) {
|
12
|
-
this._resolve(value);
|
13
|
-
}
|
14
|
-
set(value) {
|
15
|
-
this.current = value;
|
16
|
-
this._resolve(value);
|
17
|
-
}
|
18
|
-
fail(e) {
|
19
|
-
this._reject(e);
|
20
|
-
}
|
21
|
-
}
|
22
|
-
exports.Deferred = Deferred;
|
package/lib/util/index.d.ts
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
import { Logger } from '../logger';
|
2
|
-
/**
|
3
|
-
* Checks if objects are equal
|
4
|
-
*/
|
5
|
-
declare function isDeepEqual(o1: Object, o2: Object): boolean;
|
6
|
-
/**
|
7
|
-
* Deep-clone an object. Note that this does not work on object containing
|
8
|
-
* functions.
|
9
|
-
* @param {object} obj - the object to deep-clone
|
10
|
-
* @returns {object}
|
11
|
-
*/
|
12
|
-
declare function deepClone<T>(obj: T): T;
|
13
|
-
declare function parseToNumber(value: any): number;
|
14
|
-
declare function parseTime(timeString: any): Date;
|
15
|
-
declare function parseAttributes(rawAttributes: any, warningMessage: string, log: Logger): Object;
|
16
|
-
/**
|
17
|
-
* Construct URI with query parameters
|
18
|
-
*/
|
19
|
-
declare class UriBuilder {
|
20
|
-
private base;
|
21
|
-
private args;
|
22
|
-
private paths;
|
23
|
-
constructor(base: string);
|
24
|
-
arg(name: string, value: any): UriBuilder;
|
25
|
-
path(name: string): UriBuilder;
|
26
|
-
build(): string;
|
27
|
-
}
|
28
|
-
export { isDeepEqual, deepClone, UriBuilder, parseToNumber, parseTime, parseAttributes };
|
package/lib/util/index.js
DELETED
@@ -1,82 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const JsonDiff = require("rfc6902");
|
4
|
-
/**
|
5
|
-
* Checks if objects are equal
|
6
|
-
*/
|
7
|
-
function isDeepEqual(o1, o2) {
|
8
|
-
return JsonDiff.createPatch(o1, o2).length === 0;
|
9
|
-
}
|
10
|
-
exports.isDeepEqual = isDeepEqual;
|
11
|
-
/**
|
12
|
-
* Deep-clone an object. Note that this does not work on object containing
|
13
|
-
* functions.
|
14
|
-
* @param {object} obj - the object to deep-clone
|
15
|
-
* @returns {object}
|
16
|
-
*/
|
17
|
-
function deepClone(obj) {
|
18
|
-
return JSON.parse(JSON.stringify(obj));
|
19
|
-
}
|
20
|
-
exports.deepClone = deepClone;
|
21
|
-
function parseToNumber(value) {
|
22
|
-
if (typeof value !== 'undefined' && !isNaN(Number(value))) {
|
23
|
-
return Number(value);
|
24
|
-
}
|
25
|
-
return null;
|
26
|
-
}
|
27
|
-
exports.parseToNumber = parseToNumber;
|
28
|
-
// timeString cannot be typed `string` because in member.ts
|
29
|
-
// call to parseTime(data.lastReadTimestamp) uses number not a string for timestamp.
|
30
|
-
function parseTime(timeString) {
|
31
|
-
try {
|
32
|
-
return new Date(timeString);
|
33
|
-
}
|
34
|
-
catch (e) {
|
35
|
-
return null;
|
36
|
-
}
|
37
|
-
}
|
38
|
-
exports.parseTime = parseTime;
|
39
|
-
function parseAttributes(rawAttributes, warningMessage, log) {
|
40
|
-
let attributes = {};
|
41
|
-
if (rawAttributes) {
|
42
|
-
try {
|
43
|
-
attributes = JSON.parse(rawAttributes);
|
44
|
-
}
|
45
|
-
catch (e) {
|
46
|
-
log.warn(warningMessage, e);
|
47
|
-
}
|
48
|
-
}
|
49
|
-
return attributes;
|
50
|
-
}
|
51
|
-
exports.parseAttributes = parseAttributes;
|
52
|
-
/**
|
53
|
-
* Construct URI with query parameters
|
54
|
-
*/
|
55
|
-
class UriBuilder {
|
56
|
-
constructor(base) {
|
57
|
-
this.base = base.replace(/\/$/, '');
|
58
|
-
this.args = [];
|
59
|
-
this.paths = [];
|
60
|
-
}
|
61
|
-
arg(name, value) {
|
62
|
-
if (typeof value !== 'undefined') {
|
63
|
-
this.args.push(encodeURIComponent(name) + '=' + encodeURIComponent(value));
|
64
|
-
}
|
65
|
-
return this;
|
66
|
-
}
|
67
|
-
path(name) {
|
68
|
-
this.paths.push(encodeURIComponent(name));
|
69
|
-
return this;
|
70
|
-
}
|
71
|
-
build() {
|
72
|
-
let result = this.base;
|
73
|
-
if (this.paths.length) {
|
74
|
-
result += '/' + this.paths.join('/');
|
75
|
-
}
|
76
|
-
if (this.args.length) {
|
77
|
-
result += '?' + this.args.join('&');
|
78
|
-
}
|
79
|
-
return result;
|
80
|
-
}
|
81
|
-
}
|
82
|
-
exports.UriBuilder = UriBuilder;
|
@@ -1,12 +0,0 @@
|
|
1
|
-
; DO NOT EDIT (unless you know what you are doing)
|
2
|
-
;
|
3
|
-
; This subdirectory is a git "subrepo", and this file is maintained by the
|
4
|
-
; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
|
5
|
-
;
|
6
|
-
[subrepo]
|
7
|
-
remote = git@github.com:twilio/rtd-sdk-cdn-pin.git
|
8
|
-
branch = master
|
9
|
-
commit = be676abe2c634426ca410d25a95eeaf0afdc3430
|
10
|
-
parent = 5e75275aa2f795042f27357eddacadb826442a70
|
11
|
-
method = merge
|
12
|
-
cmdver = 0.4.0
|
@@ -1,54 +0,0 @@
|
|
1
|
-
# rtd-sdk-cdn-pin
|
2
|
-
Scripts to fetch Messaging SDKs and then upload and pin to CDN.
|
3
|
-
Usecase is fetch the artifact from distribution system and then with help of `sdk-release-tool` put it to Twilio CDN (dev/stage/prod).
|
4
|
-
|
5
|
-
## Supported Messaging SDKs:
|
6
|
-
* twilio-sync-js
|
7
|
-
* twilio-sync-android
|
8
|
-
* twilio-chat-js
|
9
|
-
* twilio-chat-android
|
10
|
-
* twilio-conversations-js
|
11
|
-
* twilio-conversations-android
|
12
|
-
|
13
|
-
## Fetching artifacts
|
14
|
-
Fetching is made with `fetch-artifact.sh` script.
|
15
|
-
The script takes the artifact and docs from respective distribution system (npmjs or bintray) and then places it in `artifacts/<sdk-name>/<release-version>` folder preseving structure needed for further upload to cdn with `sdk-release-tool`.
|
16
|
-
|
17
|
-
To fetch Android or iOS artifacts `mvn` should be installed and the `bintray-settings.xml` file should be present at root of workspace to access `internal-release` repo on Bintray.
|
18
|
-
|
19
|
-
**Usage:** `SDK_NAME=<sdk-name> RELEASE_VERSION=<release-version> ./fetch-artifact.sh` where `RELEASE_VERSION` can be `x.y.z` or `x.y.z-rcN`
|
20
|
-
|
21
|
-
**Examples:**
|
22
|
-
* `SDK_NAME=twilio-chat-js RELEASE_VERSION=3.3.0 ./fetch-artifact.sh`
|
23
|
-
* `SDK_NAME=twilio-chat-android RELEASE_VERSION=4.1.1-rc1 ./fetch-artifact.sh`
|
24
|
-
|
25
|
-
## Uploading to CDN
|
26
|
-
Uploading is made with `cdn-upload.sh` script.
|
27
|
-
Script assumes that the version of artifact is fetched to `artifacts/<sdk-name>/<release-version>` with directory structure required for `sdk-release-tool`.
|
28
|
-
Default behavior of script is dry run, no forced upload/pinning.
|
29
|
-
|
30
|
-
**Usage:** `SDK_NAME=<sdk-name> RELEASE_VERSION=<release-version> SDK_RELEASE_TOOL_HOME=<absolute-path-to-sdk-release-tool> DEPLOY_REALM=<realm> FORCE_OVERWRITE=<force-upload-and-pin?> DRY_RUN=<dry-run?> ./cdn-upload.sh`, where:
|
31
|
-
* `release-version` can be `x.y.z` or `x.y.z-rcN`
|
32
|
-
* `realm` can be `dev`, `stage`, `prod`
|
33
|
-
* `force-upload-and-pin?` is `true` or `false`, indicating should script overwrite (if already exists) files on CDN
|
34
|
-
* `dry-run?` is `true` or `false`, indicating should script actually perform actions or it should simply print out what it's going to do (dry-run)
|
35
|
-
|
36
|
-
**Examples:**
|
37
|
-
* `SDK_NAME=twilio-chat-js RELEASE_VERSION=3.3.0 SDK_RELEASE_TOOL_HOME=/home/jenkins/sdk-release-tool DEPLOY_REALM=dev DRY_RUN=true ./cdn-upload.sh`
|
38
|
-
* `SDK_NAME=twilio-chat-android RELEASE_VERSION=4.1.1-rc1 SDK_RELEASE_TOOL_HOME=/home/jenkins/sdk-release-tool DEPLOY_REALM=stage DRY_RUN=false FORCE_OVERWRITE=true ./cdn-upload.sh`
|
39
|
-
|
40
|
-
## Pinning to CDN
|
41
|
-
Pinning is made with `cd-pin.sh` script.
|
42
|
-
Default behavior of script is dry run, no forced upload/pinning.
|
43
|
-
|
44
|
-
**Usage:** `SDK_NAME=<sdk-name> RELEASE_VERSION=<release-version> SDK_RELEASE_TOOL_HOME=<absolute-path-to-sdk-release-tool> DEPLOY_REALM=<realm> PIN_RELEASE=<pin-release?> PIN_LATEST=<pin-latest?> FORCE_OVERWRITE=<force-upload-and-pin?> DRY_RUN=<dry-run?> ./cdn-pin.sh`, where:
|
45
|
-
* `release-version` can be `x.y.z` or `x.y.z-rcN`
|
46
|
-
* `realm` can be `dev`, `stage`, `prod`
|
47
|
-
* `pin-release?` is `true` or `false`, indicating should script pin release or not, i.e. pin `x.y.z` to `x.y` on CDN
|
48
|
-
* `pin-latest?` is `true` or `false`, indicating should script pin uploaded release to `latest` version code on CDN or not
|
49
|
-
* `force-upload-and-pin?` is `true` or `false`, indicating should script overwrite (if already exists) files on CDN
|
50
|
-
* `dry-run?` is `true` or `false`, indicating should script actually perform actions or it should simply print out what it's going to do (dry-run)
|
51
|
-
|
52
|
-
**Examples:**
|
53
|
-
* `SDK_NAME=twilio-chat-js RELEASE_VERSION=3.3.0 SDK_RELEASE_TOOL_HOME=/home/jenkins/sdk-release-tool DEPLOY_REALM=dev PIN_RELEASE=false PIN_LATEST=false DRY_RUN=true ./cdn-pin.sh`
|
54
|
-
* `SDK_NAME=twilio-chat-android RELEASE_VERSION=4.1.1-rc1 SDK_RELEASE_TOOL_HOME=/home/jenkins/sdk-release-tool DEPLOY_REALM=stage PIN_RELEASE=false PIN_LATEST=false DRY_RUN=false FORCE_OVERWRITE=true ./cdn-pin.sh`
|
@@ -1,16 +0,0 @@
|
|
1
|
-
<?xml version='1.0' encoding='UTF-8'?>
|
2
|
-
<settings xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd'
|
3
|
-
xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
|
4
|
-
<servers>
|
5
|
-
<server>
|
6
|
-
<id>bintray-twilio-internal-releases</id>
|
7
|
-
<username>${BINTRAY_USERNAME}</username>
|
8
|
-
<password>${BINTRAY_PASSWORD}</password>
|
9
|
-
</server>
|
10
|
-
<server>
|
11
|
-
<id>bintray-twilio-snapshots</id>
|
12
|
-
<username>${BINTRAY_USERNAME}</username>
|
13
|
-
<password>${BINTRAY_PASSWORD}</password>
|
14
|
-
</server>
|
15
|
-
</servers>
|
16
|
-
</settings>
|