diff --git a/kii-cloud-sdk/index.d.ts b/kii-cloud-sdk/index.d.ts
index 26decd07a0..8dec3a94c8 100644
--- a/kii-cloud-sdk/index.d.ts
+++ b/kii-cloud-sdk/index.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for Kii Cloud SDK v2.4.6
+// Type definitions for Kii Cloud SDK v2.4.9
// Project: http://en.kii.com/
// Definitions by: Kii Consortium
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -10,6 +10,9 @@ declare namespace KiiCloud {
KiiACLBucketActionDropBucket,
KiiACLObjectActionRead,
KiiACLObjectActionWrite,
+ KiiACLBucketActionReadObjects,
+ KiiACLSubscribeToTopic,
+ KiiACLSendMessageToTopic,
}
export enum KiiSite {
@@ -44,7 +47,7 @@ declare namespace KiiCloud {
} | {
oauth_token: string,
oauth_token_secret: string
- }
+ };
interface KiiSocialAccountInfo {
createdAt: number;
@@ -195,6 +198,12 @@ declare namespace KiiCloud {
portWSS: number;
}
+ interface KiiError {
+ status: number;
+ code: string;
+ message: string;
+ }
+
/**
* The main SDK class
*/
@@ -245,7 +254,9 @@ declare namespace KiiCloud {
* @example
* Kii.setAccessTokenExpiration(3600);
*/
- static setAccessTokenExpiration(expiresIn: number): void;
+ static setAccessTokenExpiration(
+ expiresIn: number
+ ): void;
/**
* Returns access token lifetime in seconds.
@@ -266,7 +277,9 @@ declare namespace KiiCloud {
* @param appID The application ID found in your Kii developer console
* @param appKey The application key found in your Kii developer console
* @param site Can be one of the constants KiiSite.US, KiiSite.JP, KiiSite.CN or KiiSite.SG depending on your location.
- * @param analyticsOption An object used for initializing KiiAnalytics, If not provided or invalid object provided, KiiAnalytics won't be initialized. If provided, it can be empty object or with analyticsOption.deviceId.
If provided, but deviceId is not provided, SDK generates a new deviceId and use it when upload events. It can be retrieved by {@link KiiAnalytics.getDeviceId()}. It is recommended to retrieve the deviceId and store it to identify the device properly.
+ * @param analyticsOption An object used for initializing KiiAnalytics, If not provided or invalid object provided, KiiAnalytics won't be initialized. If provided, it can be empty object or
+ * with analyticsOption.deviceId.
If provided, but deviceId is not provided, SDK generates a new deviceId and use it when upload events. It can be retrieved by {@link
+ * KiiAnalytics.getDeviceId()}. It is recommended to retrieve the deviceId and store it to identify the device properly.
*
* @example
* // Disable KiiAnalytics
@@ -279,7 +292,12 @@ declare namespace KiiCloud {
* // Enable KiiAnalytics without deviceId
* Kii.initializeWithSite("my-app-id", "my-app-key", KiiSite.JP, {});
*/
- static initializeWithSite(appID: string, appKey: string, site: KiiSite, analyticsOption?: any): void;
+ static initializeWithSite(
+ appID: string,
+ appKey: string,
+ site: KiiSite,
+ analyticsOption?: any
+ ): void;
/**
* Initialize the Kii SDK
@@ -289,7 +307,9 @@ declare namespace KiiCloud {
*
* @param appID The application ID found in your Kii developer console
* @param appKey The application key found in your Kii developer console
- * @param analyticsOption An object used for initializing KiiAnalytics, If not provided or invalid object provided, KiiAnalytics won't be initialized. If provided, it can be empty object or with analyticsOption.deviceId.
If provided, but deviceId is not provided, SDK generates a new deviceId and use it when upload events. It can be retrieved by {@link KiiAnalytics.getDeviceId()}. It is recommended to retrieve the deviceId and store it to identify the device properly.
+ * @param analyticsOption An object used for initializing KiiAnalytics, If not provided or invalid object provided, KiiAnalytics won't be initialized. If provided, it can be empty object or
+ * with analyticsOption.deviceId.
If provided, but deviceId is not provided, SDK generates a new deviceId and use it when upload events. It can be retrieved by {@link
+ * KiiAnalytics.getDeviceId()}. It is recommended to retrieve the deviceId and store it to identify the device properly.
*
* @example
* // Disable KiiAnalytics
@@ -302,7 +322,11 @@ declare namespace KiiCloud {
* // Enable KiiAnalytics without deviceId
* Kii.initialize("my-app-id", "my-app-key", {});
*/
- static initialize(appID: string, appKey: string, analyticsOption?: any): void;
+ static initialize(
+ appID: string,
+ appKey: string,
+ analyticsOption?: any
+ ): void;
/**
* Creates a reference to a bucket for this app
@@ -316,7 +340,9 @@ declare namespace KiiCloud {
* @example
* var bucket = Kii.bucketWithName("myBucket");
*/
- static bucketWithName(bucketName: string): KiiBucket;
+ static bucketWithName(
+ bucketName: string
+ ): KiiBucket;
/**
* Creates a reference to a encrypted bucket for this app
@@ -330,7 +356,9 @@ declare namespace KiiCloud {
* @example
* var bucket = Kii.encryptedBucketWithName("myBucket");
*/
- static encryptedBucketWithName(bucketName: string): KiiBucket;
+ static encryptedBucketWithName(
+ bucketName: string
+ ): KiiBucket;
/**
* Creates a reference to a group with the given name
@@ -342,7 +370,9 @@ declare namespace KiiCloud {
* @example
* var group = new Kii.groupWithName("myGroup");
*/
- static groupWithName(groupName: string): KiiGroup;
+ static groupWithName(
+ groupName: string
+ ): KiiGroup;
/**
* Creates a reference to a group with the given name and a list of default members
@@ -355,7 +385,10 @@ declare namespace KiiCloud {
* @example
* var group = new KiiGroup.groupWithName("myGroup", members);
*/
- static groupWithNameAndMembers(groupName: string, members: KiiUser[]): KiiGroup;
+ static groupWithNameAndMembers(
+ groupName: string,
+ members: KiiUser[]
+ ): KiiGroup;
/**
* Authenticate as app admin.
@@ -405,7 +438,11 @@ declare namespace KiiCloud {
* }
* );
*/
- static authenticateAsAppAdmin(clientId: string, clientSecret: string, callbacks?: { success(adminContext: KiiAppAdminContext): any; failure(error: string, statusCode: number): any; }): Promise;
+ static authenticateAsAppAdmin(
+ clientId: string,
+ clientSecret: string,
+ callbacks?: { success(adminContext: KiiAppAdminContext): any; failure(error: string, statusCode: number): any; }
+ ): Promise;
/**
* Instantiate KiiServerCodeEntry with specified entry name.
@@ -422,7 +459,9 @@ declare namespace KiiCloud {
* @example
* var entry = Kii.serverCodeEntry("main");
*/
- static serverCodeEntry(entryName: string): KiiServerCodeEntry;
+ static serverCodeEntry(
+ entryName: string
+ ): KiiServerCodeEntry;
/**
* Instantiate serverCodeEntryWithVersion with specified entry name and version.
@@ -440,7 +479,10 @@ declare namespace KiiCloud {
* @example
* var entry = Kii.serverCodeEntryWithVersion("main", "gulsdf6ful8jvf8uq6fe7vjy6");
*/
- static serverCodeEntryWithVersion(entryName: string, version: string): KiiServerCodeEntry;
+ static serverCodeEntryWithVersion(
+ entryName: string,
+ version: string
+ ): KiiServerCodeEntry;
/**
* Instantiate topic belongs to application.
@@ -449,13 +491,16 @@ declare namespace KiiCloud {
*
* @return topic instance.
*/
- static topicWithName(topicName: string): KiiTopic;
+ static topicWithName(
+ topicName: string
+ ): KiiTopic;
/**
* Gets a list of topics in app scope
*
* @param callbacks An object with callback methods defined
- * @param paginationKey You can specify the pagination key with the nextPaginationKey passed by callbacks.success or fullfill callback of promise. If empty string or no string object is provided, this API regards no paginationKey specified.
+ * @param paginationKey You can specify the pagination key with the nextPaginationKey passed by callbacks.success or fullfill callback of promise. If empty string or no string object is
+ * provided, this API regards no paginationKey specified.
*
* @return return promise object.
*
@@ -513,7 +558,10 @@ declare namespace KiiCloud {
* }
* );
*/
- static listTopics(callbacks?: { success(topicList: KiiTopic[], nextPaginationKey: string): any; failure(anErrorString: string): any; }, paginationKey?: string): Promise<[KiiTopic[], string]>;
+ static listTopics(
+ callbacks?: { success(topicList: KiiTopic[], nextPaginationKey: string): any; failure(anErrorString: string): any; },
+ paginationKey?: string
+ ): Promise<[KiiTopic[], string]>;
/**
* Authenticate as Thing.
@@ -562,7 +610,11 @@ declare namespace KiiCloud {
* }
* );
*/
- static authenticateAsThing(vendorThingID: string, password: string, callbacks?: { success(thingAuthContext: KiiThingContext): any; failure(error: Error): any; }): Promise;
+ static authenticateAsThing(
+ vendorThingID: string,
+ password: string,
+ callbacks?: { success(thingAuthContext: KiiThingContext): any; failure(error: Error): any; }
+ ): Promise;
/**
* Create a KiiThingContext reference
@@ -611,7 +663,11 @@ declare namespace KiiCloud {
* }
* );
*/
- static authenticateAsThingWithToken(thingID: string, token: string, callbacks?: { success(thingContext: KiiThingContext): any; failure(error: Error): any; }): Promise;
+ static authenticateAsThingWithToken(
+ thingID: string,
+ token: string,
+ callbacks?: { success(thingContext: KiiThingContext): any; failure(error: Error): any; }
+ ): Promise;
}
/**
@@ -666,10 +722,13 @@ declare namespace KiiCloud {
* // do something with the error response
* });
*/
- listACLEntries(callbacks?: { success(theACL: KiiACL, theEntries: KiiACLEntry[]): any; failure(theACL: KiiACL, anErrorString: string): any; }): Promise<[KiiACL, KiiACLEntry[]]>;
+ listACLEntries(
+ callbacks?: { success(theACL: KiiACL, theEntries: KiiACLEntry[]): any; failure(theACL: KiiACL, anErrorString: string): any; }
+ ): Promise<[KiiACL, KiiACLEntry[]]>;
/**
- * Add a KiiACLEntry to the local object, if not already present. This does not explicitly grant any permissions, which should be done through the KiiACLEntry itself. This method simply adds the entry to the local ACL object so it can be saved to the server.
+ * Add a KiiACLEntry to the local object, if not already present. This does not explicitly grant any permissions, which should be done through the KiiACLEntry itself. This method simply adds
+ * the entry to the local ACL object so it can be saved to the server.
*
* @param entry The KiiACLEntry to add
*
@@ -680,10 +739,13 @@ declare namespace KiiCloud {
* var acl = . . .; // a KiiACL object
* acl.putACLEntry(aclEntry);
*/
- putACLEntry(entry: KiiACLEntry): void;
+ putACLEntry(
+ entry: KiiACLEntry
+ ): void;
/**
- * Remove a KiiACLEntry to the local object. This does not explicitly revoke any permissions, which should be done through the KiiACLEntry itself. This method simply removes the entry from the local ACL object and will not be saved to the server.
+ * Remove a KiiACLEntry to the local object. This does not explicitly revoke any permissions, which should be done through the KiiACLEntry itself. This method simply removes the entry from the
+ * local ACL object and will not be saved to the server.
*
* @param entry The KiiACLEntry to remove
*
@@ -694,7 +756,9 @@ declare namespace KiiCloud {
* var acl = . . .; // a KiiACL object
* acl.removeACLEntry(aclEntry);
*/
- removeACLEntry(entry: KiiACLEntry): void;
+ removeACLEntry(
+ entry: KiiACLEntry
+ ): void;
/**
* Save the list of ACLEntry objects associated with this ACL object to the server
@@ -737,7 +801,9 @@ declare namespace KiiCloud {
* // do something with the error response
* });
*/
- save(callbacks?: { success(theSavedACL: KiiACL): any; failure(theACL: KiiACL, anErrorString: string): any; }): Promise;
+ save(
+ callbacks?: { success(theSavedACL: KiiACL): any; failure(theACL: KiiACL, anErrorString: string): any; }
+ ): Promise;
}
/**
@@ -760,7 +826,9 @@ declare namespace KiiCloud {
*
* @throws If the value is not one of the permitted values
*/
- setAction(value: KiiACLAction): void;
+ setAction(
+ value: KiiACLAction
+ ): void;
/**
* Get the action that is being permitted/restricted in this entry
@@ -776,7 +844,9 @@ declare namespace KiiCloud {
*
* @throws If the value is not one of the permitted values
*/
- setSubject(subject: KiiACLSubject): void;
+ setSubject(
+ subject: KiiACLSubject
+ ): void;
/**
* Get the subject that is being permitted/restricted in this entry
@@ -792,7 +862,9 @@ declare namespace KiiCloud {
*
* @throws If the value is not a boolean type
*/
- setGrant(value: boolean): void;
+ setGrant(
+ value: boolean
+ ): void;
/**
* Get whether or not the action is being permitted to the subject
@@ -817,7 +889,10 @@ declare namespace KiiCloud {
* @throws If specified subject is invalid.
* @throws If the specified action is invalid.
*/
- static entryWithSubject(Subject: KiiACLSubject, action: KiiACLAction): KiiACLEntry;
+ static entryWithSubject(
+ Subject: KiiACLSubject,
+ action: KiiACLAction
+ ): KiiACLEntry;
}
/**
@@ -839,7 +914,8 @@ declare namespace KiiCloud {
static getAppKey(): string;
/**
- * Get the deviceId. If deviceId has not specified while initialization, it returns SDK generated deviceId.It is recommended to retrieve the deviceId and store it to identify the device properly.
+ * Get the deviceId. If deviceId has not specified while initialization, it returns SDK generated deviceId.It is recommended to retrieve the deviceId and store it to identify the device
+ * properly.
*
* @return deviceId.
*/
@@ -862,7 +938,9 @@ declare namespace KiiCloud {
* @example
* KiiAnalytics.setLogging(true);
*/
- static setLogging(True: boolean): void;
+ static setLogging(
+ True: boolean
+ ): void;
/**
*
@@ -874,7 +952,8 @@ declare namespace KiiCloud {
* @param appID The application ID found in your Kii developer console
* @param appKey The application key found in your Kii developer console
* @param site Can be one of the constants KiiAnalyticsSite.US, KiiAnalyticsSite.JP, KiiAnalyticsSite.CN, KiiAnalyticsSite.CN3 or KiiAnalyticsSite.SG depending on your location.
- * @param deviceid If deviceId is not provided, SDK generates a new deviceId and use it when upload events.deviceId can be retrieved by {@link KiiAnalytics.getDeviceId()}.It is recommended to retrieve the deviceId and store it to identify the device properly.
+ * @param deviceid If deviceId is not provided, SDK generates a new deviceId and use it when upload events.deviceId can be retrieved by {@link KiiAnalytics.getDeviceId()}.It is recommended to
+ * retrieve the deviceId and store it to identify the device properly.
*
* @example
* // initialize without deviceId
@@ -882,7 +961,12 @@ declare namespace KiiCloud {
* // initialize with deviceId
* Kii.initializeWithSite("my-app-id", "my-app-key", KiiAnalyticsSite.JP, "my-device-id");
*/
- static initializeWithSite(appID: string, appKey: string, site: KiiAnalyticsSite, deviceid: string): void;
+ static initializeWithSite(
+ appID: string,
+ appKey: string,
+ site: KiiAnalyticsSite,
+ deviceid: string
+ ): void;
/**
*
@@ -893,7 +977,8 @@ declare namespace KiiCloud {
*
* @param appID The application ID found in your Kii developer console
* @param appKey The application key found in your Kii developer console
- * @param deviceid If deviceId is not provided, SDK generates a new deviceId and use it when upload events. deviceId can be retrieved by {@link KiiAnalytics.getDeviceId()}.It is recommended to retrieve the deviceId and store it to identify the device properly.
+ * @param deviceid If deviceId is not provided, SDK generates a new deviceId and use it when upload events. deviceId can be retrieved by {@link KiiAnalytics.getDeviceId()}.It is recommended to
+ * retrieve the deviceId and store it to identify the device properly.
*
* @example
* // initialize without deviceId
@@ -901,7 +986,11 @@ declare namespace KiiCloud {
* // initialize with deviceId
* Kii.initializeWithSite("my-app-id", "my-app-key", KiiAnalyticsSite.JP, "my-device-id");
*/
- static initialize(appID: string, appKey: string, deviceid: string): void;
+ static initialize(
+ appID: string,
+ appKey: string,
+ deviceid: string
+ ): void;
/**
* Utilize the KiiAnalytics logger to track SDK-specific actions
@@ -913,7 +1002,9 @@ declare namespace KiiCloud {
* @example
* KiiAnalytics.logger("My message");
*/
- static logger(message: string): void;
+ static logger(
+ message: string
+ ): void;
/**
* Log a single event to be uploaded to KiiAnalytics
@@ -932,7 +1023,9 @@ declare namespace KiiCloud {
*
*
*/
- static trackEvent(eventName: string): Promise;
+ static trackEvent(
+ eventName: string
+ ): Promise;
/**
* Log a single event to be uploaded to KiiAnalytics
@@ -955,7 +1048,10 @@ declare namespace KiiCloud {
*
*
*/
- static trackEventWithExtras(eventName: string, extras: any): Promise;
+ static trackEventWithExtras(
+ eventName: string,
+ extras: any
+ ): Promise;
/**
* Log a single event to be uploaded to KiiAnalytics
@@ -979,7 +1075,11 @@ declare namespace KiiCloud {
*
*
*/
- static trackEventWithExtrasAndCallbacks(eventName: string, extras: any, callbacks?: { success(): any; failure(error: Error): any; }): Promise;
+ static trackEventWithExtrasAndCallbacks(
+ eventName: string,
+ extras: any,
+ callbacks?: { success(): any; failure(error: Error): any; }
+ ): Promise;
/**
*
@@ -988,7 +1088,9 @@ declare namespace KiiCloud {
*
* @param url A string containing the desired endpoint
*/
- static setBaseURL(url: string): void;
+ static setBaseURL(
+ url: string
+ ): void;
/**
*
@@ -1054,7 +1156,9 @@ declare namespace KiiCloud {
* }
* });
*/
- bucketWithName(bucketName: string): KiiBucket;
+ bucketWithName(
+ bucketName: string
+ ): KiiBucket;
/**
* Creates a reference to a encrypted bucket operated by app admin.
@@ -1075,7 +1179,9 @@ declare namespace KiiCloud {
* }
* });
*/
- encryptedBucketWithName(bucketName: string): KiiBucket;
+ encryptedBucketWithName(
+ bucketName: string
+ ): KiiBucket;
/**
* Creates a reference to a group operated by app admin.
@@ -1099,7 +1205,9 @@ declare namespace KiiCloud {
* }
* });
*/
- groupWithName(group: string): KiiGroup;
+ groupWithName(
+ group: string
+ ): KiiGroup;
/**
* Creates a reference to a user operated by app admin.
@@ -1119,7 +1227,9 @@ declare namespace KiiCloud {
* }
* });
*/
- userWithID(user: string): KiiUser;
+ userWithID(
+ user: string
+ ): KiiUser;
/**
* Creates a reference to an object operated by app admin using object`s URI.
@@ -1130,7 +1240,9 @@ declare namespace KiiCloud {
*
* @throws If the URI is null, empty or does not have correct format.
*/
- objectWithURI(object: string): KiiObject;
+ objectWithURI(
+ object: string
+ ): KiiObject;
/**
* Creates a reference to a group operated by app admin using group's ID.
@@ -1157,7 +1269,9 @@ declare namespace KiiCloud {
* }
* });
*/
- groupWithID(group: string): KiiGroup;
+ groupWithID(
+ group: string
+ ): KiiGroup;
/**
* Register new group own by specified user on Kii Cloud with specified ID.
@@ -1216,7 +1330,13 @@ declare namespace KiiCloud {
* }
* );
*/
- registerGroupWithOwnerAndID(groupID: string, groupName: string, user: string, members: KiiUser[], callbacks?: { success(adminContext: KiiAppAdminContext): any; failure(theGroup: KiiGroup, anErrorString: string, addMembersArray: KiiUser[], removeMembersArray: KiiUser[]): any; }): Promise;
+ registerGroupWithOwnerAndID(
+ groupID: string,
+ groupName: string,
+ user: string,
+ members: KiiUser[],
+ callbacks?: { success(adminContext: KiiAppAdminContext): any; failure(theGroup: KiiGroup, anErrorString: string, addMembersArray: KiiUser[], removeMembersArray: KiiUser[]): any; }
+ ): Promise;
/**
* Creates a reference to a group operated by app admin using group's URI.
@@ -1243,7 +1363,9 @@ declare namespace KiiCloud {
* }
* });
*/
- groupWithURI(group: string): KiiGroup;
+ groupWithURI(
+ group: string
+ ): KiiGroup;
/**
* Find registered KiiUser with the email.
@@ -1317,7 +1439,10 @@ declare namespace KiiCloud {
* }
* );
*/
- findUserByEmail(email: string, callbacks?: { success(adminContext: KiiAppAdminContext, theMatchedUser: KiiUser): any; failure(adminContext: KiiAppAdminContext, anErrorString: string): any; }): Promise<[KiiAppAdminContext, KiiUser]>;
+ findUserByEmail(
+ email: string,
+ callbacks?: { success(adminContext: KiiAppAdminContext, theMatchedUser: KiiUser): any; failure(adminContext: KiiAppAdminContext, anErrorString: string): any; }
+ ): Promise<[KiiAppAdminContext, KiiUser]>;
/**
* Find registered KiiUser with the phone.
@@ -1391,7 +1516,10 @@ declare namespace KiiCloud {
* }
* );
*/
- findUserByPhone(phone: string, callbacks?: { success(adminContext: KiiAppAdminContext, theMatchedUser: KiiUser): any; failure(adminContext: KiiAppAdminContext, anErrorString: string): any; }): Promise<[KiiAppAdminContext, KiiUser]>;
+ findUserByPhone(
+ phone: string,
+ callbacks?: { success(adminContext: KiiAppAdminContext, theMatchedUser: KiiUser): any; failure(adminContext: KiiAppAdminContext, anErrorString: string): any; }
+ ): Promise<[KiiAppAdminContext, KiiUser]>;
/**
* Find registered KiiUser with the user name.
@@ -1463,7 +1591,10 @@ declare namespace KiiCloud {
* }
* );
*/
- findUserByUsername(username: string, callbacks?: { success(adminContext: KiiAppAdminContext, theMatchedUser: KiiUser): any; failure(adminContext: KiiAppAdminContext, anErrorString: string): any; }): Promise<[KiiAppAdminContext, KiiUser]>;
+ findUserByUsername(
+ username: string,
+ callbacks?: { success(adminContext: KiiAppAdminContext, theMatchedUser: KiiUser): any; failure(adminContext: KiiAppAdminContext, anErrorString: string): any; }
+ ): Promise<[KiiAppAdminContext, KiiUser]>;
/**
* Register thing by app admin.
@@ -1533,7 +1664,10 @@ declare namespace KiiCloud {
* }
* );
*/
- registerThing(fields: KiiThingFields, callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise;
+ registerThing(
+ fields: KiiThingFields,
+ callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }
+ ): Promise;
/**
* Creates a reference to a thing operated by app admin.
@@ -1546,7 +1680,9 @@ declare namespace KiiCloud {
* // Assume you already have adminContext instance.
* adminContext.thingWithID(thingID);
*/
- thingWithID(thing: string): KiiThing;
+ thingWithID(
+ thing: string
+ ): KiiThing;
/**
* Register user/group as owner of specified thing by app admin.
@@ -1599,7 +1735,11 @@ declare namespace KiiCloud {
* }
* );
*/
- registerOwnerWithThingID(thingID: string, owner: T, callbacks?: { success(group: T): any; failure(error: Error): any; }): Promise;
+ registerOwnerWithThingID(
+ thingID: string,
+ owner: T,
+ callbacks?: { success(group: T): any; failure(error: Error): any; }
+ ): Promise;
/**
* Register user/group as owner of specified thing by app admin.
@@ -1651,7 +1791,11 @@ declare namespace KiiCloud {
* }
* );
*/
- registerOwnerWithVendorThingID(vendorThingID: string, owner: T, callbacks?: { success(group: T): any; failure(error: Error): any; }): Promise;
+ registerOwnerWithVendorThingID(
+ vendorThingID: string,
+ owner: T,
+ callbacks?: { success(group: T): any; failure(error: Error): any; }
+ ): Promise;
/**
* Load thing with vendor thing ID by app admin.
@@ -1698,7 +1842,10 @@ declare namespace KiiCloud {
* }
* );
*/
- loadThingWithVendorThingID(vendorThingID: string, callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise;
+ loadThingWithVendorThingID(
+ vendorThingID: string,
+ callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }
+ ): Promise;
/**
* Load thing with thing ID by app admin.
@@ -1745,7 +1892,10 @@ declare namespace KiiCloud {
* }
* );
*/
- loadThingWithThingID(thingID: string, callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise;
+ loadThingWithThingID(
+ thingID: string,
+ callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }
+ ): Promise;
/**
* Creates a reference to a topic operated by app admin
@@ -1754,13 +1904,16 @@ declare namespace KiiCloud {
*
* @return topic instance.
*/
- topicWithName(topicName: string): KiiTopic;
+ topicWithName(
+ topicName: string
+ ): KiiTopic;
/**
* Gets a list of topics in app scope
*
* @param callbacks An object with callback methods defined
- * @param paginationKey You can specify the pagination key with the nextPaginationKey passed by callbacks.success. If empty string or no string object is provided, this API regards no paginationKey specified.
+ * @param paginationKey You can specify the pagination key with the nextPaginationKey passed by callbacks.success. If empty string or no string object is provided, this API regards no
+ * paginationKey specified.
*
* @return return promise object.
*
@@ -1821,7 +1974,10 @@ declare namespace KiiCloud {
* }
* );
*/
- listTopics(callbacks?: { success(topicList: KiiTopic[], nextPaginationKey: string): any; failure(anErrorString: string): any; }, paginationKey?: string): Promise<[KiiTopic[], string]>;
+ listTopics(
+ callbacks?: { success(topicList: KiiTopic[], nextPaginationKey: string): any; failure(anErrorString: string): any; },
+ paginationKey?: string
+ ): Promise<[KiiTopic[], string]>;
}
/**
@@ -1851,7 +2007,8 @@ declare namespace KiiCloud {
/**
* Create a KiiObject within the current bucket, with type
*
- *
The object will not be created on the server until the KiiObject is explicitly saved. This method simply returns an empty working KiiObject with a specified type. The type allows for better indexing and improved query results. It is recommended to use this method - but for lazy creation, the createObject method is also available.
+ *
The object will not be created on the server until the KiiObject is explicitly saved. This method simply returns an empty working KiiObject with a specified type. The type allows
+ * for better indexing and improved query results. It is recommended to use this method - but for lazy creation, the createObject method is also available.
*
* @param type A string representing the desired object type
*
@@ -1861,7 +2018,9 @@ declare namespace KiiCloud {
* var bucket = . . .; // a KiiBucket
* var object = bucket.createObjectWithType("scores");
*/
- createObjectWithType(type: string): KiiObject;
+ createObjectWithType(
+ type: string
+ ): KiiObject;
/**
* Create a KiiObject within the current bucket, specifying its ID.
@@ -1883,7 +2042,9 @@ declare namespace KiiCloud {
* var bucket = . . .; // KiiBucket
* var object = bucket.createObjectWithID('__OBJECT_ID_');
*/
- createObjectWithID(objectID: string): KiiObject;
+ createObjectWithID(
+ objectID: string
+ ): KiiObject;
/**
* Get the ACL handle for this bucket
@@ -1985,7 +2146,10 @@ declare namespace KiiCloud {
* }
* );
*/
- executeQuery(query: KiiQuery, callbacks?: { success(queryPerformed: KiiQuery, resultSet: T[], nextQuery: KiiQuery): any; failure(bucket: KiiBucket, anErrorString: string): any; }): Promise<[KiiQuery, T[], KiiQuery]>;
+ executeQuery(
+ query: KiiQuery,
+ callbacks?: { success(queryPerformed: KiiQuery, resultSet: T[], nextQuery: KiiQuery): any; failure(bucket: KiiBucket, anErrorString: string): any; }
+ ): Promise<[KiiQuery, T[], KiiQuery]>;
/**
* Execute count aggregation of specified query on current bucket.
@@ -2048,7 +2212,10 @@ declare namespace KiiCloud {
* }
* );
*/
- countWithQuery(query: KiiQuery, callbacks?: { success(bucket: KiiBucket, query: KiiQuery, count: number): any; failure(bucket: KiiBucket, errorString: string): any; }): Promise<[KiiBucket, KiiQuery, number]>;
+ countWithQuery(
+ query: KiiQuery,
+ callbacks?: { success(bucket: KiiBucket, query: KiiQuery, count: number): any; failure(bucket: KiiBucket, errorString: string): any; }
+ ): Promise<[KiiBucket, KiiQuery, number]>;
/**
* Execute count aggregation of all clause query on current bucket.
@@ -2105,7 +2272,9 @@ declare namespace KiiCloud {
* }
* );
*/
- count(callbacks?: { success(bucket: KiiBucket, query: KiiQuery, count: number): any; failure(bucket: KiiBucket, errorString: string): any; }): Promise<[KiiBucket, KiiQuery, number]>;
+ count(
+ callbacks?: { success(bucket: KiiBucket, query: KiiQuery, count: number): any; failure(bucket: KiiBucket, errorString: string): any; }
+ ): Promise<[KiiBucket, KiiQuery, number]>;
/**
* Delete the given bucket from the server
@@ -2155,7 +2324,9 @@ declare namespace KiiCloud {
* }
* );
*/
- delete(callbacks?: { success(deletedBucket: KiiBucket): any; failure(bucketToDelete: KiiBucket, anErrorString: string): any; }): Promise;
+ delete(
+ callbacks?: { success(deletedBucket: KiiBucket): any; failure(bucketToDelete: KiiBucket, anErrorString: string): any; }
+ ): Promise;
}
/**
@@ -2170,17 +2341,36 @@ declare namespace KiiCloud {
* @example
* KiiClause clause = KiiClause.and(clause1, clause2, clause3, . . .)
*/
- static and(...A: KiiClause[]): KiiClause;
+ static and(
+ ...A: KiiClause[]
+ ): KiiClause;
/**
* Create a KiiClause with the OR operator concatenating multiple KiiClause objects
+ *
+ * Note:
+ * Query performance will be worse as the number of objects in bucket increases, so we recommend you avoid the OR clause if possible.
*
* @param A variable-length list of KiiClause objects to concatenate
*
* @example
* KiiClause clause = KiiClause.or(clause1, clause2, clause3, . . .)
*/
- static or(...A: KiiClause[]): KiiClause;
+ static or(
+ ...A: KiiClause[]
+ ): KiiClause;
+
+ /**
+ * Create a KiiClause with the NOT operator concatenating a KiiClause object
+ *
+ * Note:
+ * Query performance will be worse as the number of objects in bucket increases, so we recommend you avoid the NOT clause if possible.
+ *
+ * @param clause KiiClause object to negate
+ */
+ static not(
+ clause: KiiClause
+ ): KiiClause;
/**
* Create an expression of the form (key == value)
@@ -2188,7 +2378,10 @@ declare namespace KiiCloud {
* @param key The key to compare
* @param value the value to compare
*/
- static equals(key: string, value: any): KiiClause;
+ static equals(
+ key: string,
+ value: any
+ ): KiiClause;
/**
* Create an expression of the form (key != value)
@@ -2196,7 +2389,10 @@ declare namespace KiiCloud {
* @param key The key to compare
* @param value the value to compare
*/
- static notEquals(key: string, value: any): KiiClause;
+ static notEquals(
+ key: string,
+ value: any
+ ): KiiClause;
/**
* Create an expression of the form (key > value)
@@ -2204,7 +2400,10 @@ declare namespace KiiCloud {
* @param key The key to compare
* @param value the value to compare
*/
- static greaterThan(key: string, value: any): KiiClause;
+ static greaterThan(
+ key: string,
+ value: any
+ ): KiiClause;
/**
* Create an expression of the form (key >= value)
@@ -2212,7 +2411,10 @@ declare namespace KiiCloud {
* @param key The key to compare
* @param value the value to compare
*/
- static greaterThanOrEqual(key: string, value: any): KiiClause;
+ static greaterThanOrEqual(
+ key: string,
+ value: any
+ ): KiiClause;
/**
* Create an expression of the form (key < value)
@@ -2220,7 +2422,10 @@ declare namespace KiiCloud {
* @param key The key to compare
* @param value the value to compare
*/
- static lessThan(key: string, value: any): KiiClause;
+ static lessThan(
+ key: string,
+ value: any
+ ): KiiClause;
/**
* Create an expression of the form (key <= value)
@@ -2228,7 +2433,10 @@ declare namespace KiiCloud {
* @param key The key to compare
* @param value the value to compare
*/
- static lessThanOrEqual(key: string, value: any): KiiClause;
+ static lessThanOrEqual(
+ key: string,
+ value: any
+ ): KiiClause;
/**
* Create an expression of the form (key in values)
@@ -2236,7 +2444,10 @@ declare namespace KiiCloud {
* @param key The key to compare
* @param values to compare
*/
- static inClause(key: string, values: any[]): KiiClause;
+ static inClause(
+ key: string,
+ values: any[]
+ ): KiiClause;
/**
* Create an expression of the form (key STARTS WITH value)
@@ -2244,7 +2455,10 @@ declare namespace KiiCloud {
* @param key The key to compare
* @param value the value to compare
*/
- static startsWith(key: string, value: any): KiiClause;
+ static startsWith(
+ key: string,
+ value: any
+ ): KiiClause;
/**
* Create a clause of geo distance. This clause inquires objects in the specified circle.
@@ -2287,7 +2501,12 @@ declare namespace KiiCloud {
* };
* bucket.executeQuery(query, queryCallback);
*/
- static geoDistance(key: string, center: KiiGeoPoint, radius: number, putDistanceInto: string): KiiClause;
+ static geoDistance(
+ key: string,
+ center: KiiGeoPoint,
+ radius: number,
+ putDistanceInto: string
+ ): KiiClause;
/**
* Create a clause of geo box. This clause inquires objects in the specified rectangle.
@@ -2302,7 +2521,54 @@ declare namespace KiiCloud {
* @throws - Specified key is not a string or is an empty string.
* - northEast or southWest is not a reference of KiiGeoPoint.
*/
- static geoBox(key: string, northEast: KiiGeoPoint, southWest: KiiGeoPoint): KiiClause;
+ static geoBox(
+ key: string,
+ northEast: KiiGeoPoint,
+ southWest: KiiGeoPoint
+ ): KiiClause;
+
+ /**
+ * Create an expression to returns all entities that have a specified field and type.
+ *
+ * @param key name of the specified field.
+ * @param fieldType The type of the content of the field. The type of the content of the field must be provided, possible values are "STRING", "INTEGER", "DECIMAL" and "BOOLEAN".
+ */
+ static hasField(
+ key: string,
+ fieldType: string
+ ): KiiClause;
+ }
+
+ /**
+ * A Parser for error string or error object returned by SDK.
+ */
+ export class KiiErrorParser {
+ /**
+ * Parse an error string or error object returned by SDK.
+ *
+ * @param error An error string or error object
+ *
+ * @return return parsed error object.
+ *
+ * @example
+ * var err = KiiErrorParser.parse(errorString);
+ * var httpStatus = err.status;
+ * if (httpStatus == 0) {
+ * // NetworkError
+ * } else if (httpStatus == -1) {
+ * // Error is not related the http error. eg. argument error, illegal state error, etc.
+ * } else if (httpStatus == -2) {
+ * // Unknown error is detected.
+ * // Please confirm that you are using the latest version of SDK.
+ * } else if (httpStatus >= 400 && httpStatus < 600) {
+ * // Http error
+ * }
+ * var errorCode = err.code;
+ * var errorMessage = err.message;
+ */
+ static parse(
+ error: T
+ ): KiiError;
}
/**
@@ -2332,7 +2598,10 @@ declare namespace KiiCloud {
* @example
* var point = KiiGeoPoint.geoPoint(35.07, 139.02);
*/
- static geoPoint(latitude: number, longitude: number): KiiGeoPoint;
+ static geoPoint(
+ latitude: number,
+ longitude: number
+ ): KiiGeoPoint;
}
/**
@@ -2445,7 +2714,12 @@ declare namespace KiiCloud {
* // do something with the error response
* });
*/
- static registerGroupWithID(groupID: string, groupName: string, members: KiiUser[], callbacks?: { success(theSavedGroup: KiiGroup): any; failure(theGroup: KiiGroup, anErrorString: string, addMembersArray: KiiUser[], removeMembersArray: KiiUser[]): any; }): Promise;
+ static registerGroupWithID(
+ groupID: string,
+ groupName: string,
+ members: KiiUser[],
+ callbacks?: { success(theSavedGroup: KiiGroup): any; failure(theGroup: KiiGroup, anErrorString: string, addMembersArray: KiiUser[], removeMembersArray: KiiUser[]): any; }
+ ): Promise;
/**
* Creates a reference to a bucket for this group
@@ -2460,7 +2734,9 @@ declare namespace KiiCloud {
* var group = . . .; // a KiiGroup
* var bucket = group.bucketWithName("myBucket");
*/
- bucketWithName(bucketName: string): KiiBucket;
+ bucketWithName(
+ bucketName: string
+ ): KiiBucket;
/**
* Creates a reference to a encrypted bucket for this group
@@ -2475,7 +2751,9 @@ declare namespace KiiCloud {
* var group = . . .; // a KiiGroup
* var bucket = group.encryptedBucketWithName("myBucket");
*/
- encryptedBucketWithName(bucketName: string): KiiBucket;
+ encryptedBucketWithName(
+ bucketName: string
+ ): KiiBucket;
/**
* Adds a user to the given group
@@ -2490,7 +2768,9 @@ declare namespace KiiCloud {
* group.addUser(user);
* group.save(callbacks);
*/
- addUser(member: KiiUser): void;
+ addUser(
+ member: KiiUser
+ ): void;
/**
* Removes a user from the given group
@@ -2505,7 +2785,9 @@ declare namespace KiiCloud {
* group.removeUser(user);
* group.save(callbacks);
*/
- removeUser(member: KiiUser): void;
+ removeUser(
+ member: KiiUser
+ ): void;
/**
* Gets a list of all current members of a group
@@ -2560,7 +2842,9 @@ declare namespace KiiCloud {
* }
* );
*/
- getMemberList(callbacks?: { success(theGroup: KiiGroup, memberList: KiiUser[]): any; failure(theGroup: KiiGroup, anErrorString: string): any; }): Promise<[KiiGroup, KiiUser[]]>;
+ getMemberList(
+ callbacks?: { success(theGroup: KiiGroup, memberList: KiiUser[]): any; failure(theGroup: KiiGroup, anErrorString: string): any; }
+ ): Promise<[KiiGroup, KiiUser[]]>;
/**
* Updates the group name on the server
@@ -2603,12 +2887,16 @@ declare namespace KiiCloud {
* }
* );
*/
- changeGroupName(newName: string, callbacks?: { success(theRenamedGroup: KiiGroup): any; failure(theGroup: KiiGroup, anErrorString: string): any; }): Promise;
+ changeGroupName(
+ newName: string,
+ callbacks?: { success(theRenamedGroup: KiiGroup): any; failure(theGroup: KiiGroup, anErrorString: string): any; }
+ ): Promise;
/**
* Saves the latest group values to the server
*
- *
If the group does not yet exist, it will be created. If the group already exists, the members that have changed will be updated accordingly. If the group already exists and there is no updates of members, it will allways succeed but does not execute update. To change the name of group, use {@link #changeGroupName}.
+ *
If the group does not yet exist, it will be created. If the group already exists, the members that have changed will be updated accordingly. If the group already exists and there is
+ * no updates of members, it will allways succeed but does not execute update. To change the name of group, use {@link #changeGroupName}.
*
* @param callbacks An object with callback methods defined
*
@@ -2652,13 +2940,16 @@ declare namespace KiiCloud {
* // do something with the error response
* });
*/
- save(callbacks?: { success(theSavedGroup: KiiGroup): any; failure(theGroup: KiiGroup, anErrorString: string, addMembersArray: KiiUser[], removeMembersArray: KiiUser[]): any; }): Promise;
+ save(
+ callbacks?: { success(theSavedGroup: KiiGroup): any; failure(theGroup: KiiGroup, anErrorString: string, addMembersArray: KiiUser[], removeMembersArray: KiiUser[]): any; }
+ ): Promise;
/**
* Saves the latest group values to the server with specified owner.
* This method can be used only by the group owner or app admin.
*
- *
If the group does not yet exist, it will be created. If the group already exists, the members and owner that have changed will be updated accordingly. If the group already exists and there is no updates of members and owner, it will allways succeed but does not execute update. To change the name of group, use {@link #changeGroupName}.
+ *
If the group does not yet exist, it will be created. If the group already exists, the members and owner that have changed will be updated accordingly. If the group already exists
+ * and there is no updates of members and owner, it will allways succeed but does not execute update. To change the name of group, use {@link #changeGroupName}.
*
* @param user id of owner
* @param callbacks An object with callback methods defined
@@ -2703,7 +2994,10 @@ declare namespace KiiCloud {
* // do something with the error response
* });
*/
- saveWithOwner(user: string, callbacks?: { success(theSavedGroup: KiiGroup): any; failure(theGroup: KiiGroup, anErrorString: string, addMembersArray: KiiUser[], removeMembersArray: KiiUser[]): any; }): Promise;
+ saveWithOwner(
+ user: string,
+ callbacks?: { success(theSavedGroup: KiiGroup): any; failure(theGroup: KiiGroup, anErrorString: string, addMembersArray: KiiUser[], removeMembersArray: KiiUser[]): any; }
+ ): Promise;
/**
* Updates the local group's data with the group data on the server
@@ -2747,7 +3041,9 @@ declare namespace KiiCloud {
* }
* );
*/
- refresh(callbacks?: { success(theRefreshedGroup: KiiGroup): any; failure(theGroup: KiiGroup, anErrorString: string): any; }): Promise;
+ refresh(
+ callbacks?: { success(theRefreshedGroup: KiiGroup): any; failure(theGroup: KiiGroup, anErrorString: string): any; }
+ ): Promise;
/**
* Delete the group from the server
@@ -2795,7 +3091,9 @@ declare namespace KiiCloud {
* }
* );
*/
- delete(callbacks?: { success(theDeletedGroup: KiiGroup): any; failure(theGroup: KiiGroup, anErrorString: string): any; }): Promise;
+ delete(
+ callbacks?: { success(theDeletedGroup: KiiGroup): any; failure(theGroup: KiiGroup, anErrorString: string): any; }
+ ): Promise;
/**
* Gets the owner of the associated group
@@ -2844,7 +3142,9 @@ declare namespace KiiCloud {
* }
* );
*/
- getOwner(callbacks?: { success(theGroup: KiiGroup, theOwner: KiiUser): any; failure(theGroup: KiiGroup, anErrorString: string): any; }): Promise<[KiiGroup, KiiUser]>;
+ getOwner(
+ callbacks?: { success(theGroup: KiiGroup, theOwner: KiiUser): any; failure(theGroup: KiiGroup, anErrorString: string): any; }
+ ): Promise<[KiiGroup, KiiUser]>;
/**
* Creates a reference to a group with the given name
@@ -2860,7 +3160,9 @@ declare namespace KiiCloud {
* @example
* var group = new KiiGroup.groupWithName("myGroup");
*/
- static groupWithName(groupName: string): KiiGroup;
+ static groupWithName(
+ groupName: string
+ ): KiiGroup;
/**
* Creates a reference to a group with the given name and a list of default members
@@ -2877,7 +3179,10 @@ declare namespace KiiCloud {
* @example
* var group = new KiiGroup.groupWithName("myGroup", members);
*/
- static groupWithNameAndMembers(groupName: string, members: KiiUser[]): KiiGroup;
+ static groupWithNameAndMembers(
+ groupName: string,
+ members: KiiUser[]
+ ): KiiGroup;
/**
* Instantiate KiiGroup that refers to existing group which has specified ID.
@@ -2895,7 +3200,9 @@ declare namespace KiiCloud {
* @example
* var group = new KiiUser.groupWithID("__GROUP_ID__");
*/
- static groupWithID(groupId: string): KiiGroup;
+ static groupWithID(
+ groupId: string
+ ): KiiGroup;
/**
* Generate a new KiiGroup based on a given URI
@@ -2913,7 +3220,9 @@ declare namespace KiiCloud {
* @example
* var group = new KiiGroup.groupWithURI("kiicloud://myuri");
*/
- static groupWithURI(uri: string): KiiGroup;
+ static groupWithURI(
+ uri: string
+ ): KiiGroup;
/**
* Instantiate topic belongs to this group.
@@ -2922,13 +3231,16 @@ declare namespace KiiCloud {
*
* @return topic instance.
*/
- topicWithName(topicName: string): KiiTopic;
+ topicWithName(
+ topicName: string
+ ): KiiTopic;
/**
* Gets a list of topics in this group scope
*
* @param callbacks An object with callback methods defined
- * @param paginationKey You can specify the pagination key with the nextPaginationKey passed by callbacks.success. If empty string or no string object is provided, this API regards no paginationKey specified.
+ * @param paginationKey You can specify the pagination key with the nextPaginationKey passed by callbacks.success. If empty string or no string object is provided, this API regards no
+ * paginationKey specified.
*
* @return return promise object.
*
@@ -2989,7 +3301,10 @@ declare namespace KiiCloud {
* }
* );
*/
- listTopics(callbacks?: { success(topicList: KiiTopic[], nextPaginationKey: string): any; failure(anErrorString: string): any; }, paginationKey?: string): Promise<[KiiTopic[], string]>;
+ listTopics(
+ callbacks?: { success(topicList: KiiTopic[], nextPaginationKey: string): any; failure(anErrorString: string): any; },
+ paginationKey?: string
+ ): Promise<[KiiTopic[], string]>;
}
/**
@@ -3048,7 +3363,8 @@ declare namespace KiiCloud {
* The reason is:
* - Will dramatically improve the performance of bucket query.
* - Bucket query does not support the mixed result of integer and floating point.
- * ex.) If you use same key for integer and floating point and inquire object with the integer value, objects which has floating point value with the key would not be evaluated in the query. (and vice versa)
+ * ex.) If you use same key for integer and floating point and inquire object with the integer value, objects which has floating point value with the key would not be evaluated in the
+ * query. (and vice versa)
*
* @param key The key to set.
* if null, empty string or string prefixed with '_' is specified, silently ignored and have no effect.
@@ -3060,7 +3376,10 @@ declare namespace KiiCloud {
* var obj = . . .; // a KiiObject
* obj.set("score", 4298);
*/
- set(key: string, value: any): void;
+ set(
+ key: string,
+ value: any
+ ): void;
/**
* Gets the value associated with the given key
@@ -3073,7 +3392,38 @@ declare namespace KiiCloud {
* var obj = . . .; // a KiiObject
* var score = obj.get("score");
*/
- get(key: string): T;
+ get(
+ key: string
+ ): T;
+
+ /**
+ * Gets the array object that contains all keys of custom field.
+ * The array of keys from local cache will be returned.
+ * To get the latest array of keys from cloud, calling refresh() is necessary prior calling this method.
+ * The returned array object does not include reserved keys such as _created, _modified, etc.
+ *
+ * @return keys An array of all keys of custom field.
+ *
+ * @example
+ * var obj = . . .; // a KiiObject
+ * for(var key of obj.keys()) {
+ * }
+ */
+ getKeys(): string[];
+
+ /**
+ * Removes a pair of key/value from this object.
+ * This pair is also removed from server when saveAllFields() is succeeded.
+ *
+ * @param key The key to be removed
+ *
+ * @example
+ * var obj = . . .; // a KiiObject
+ * obj.remove("score");
+ */
+ remove(
+ key: string
+ ): void;
/**
* Set Geo point to this object with the specified key.
@@ -3083,7 +3433,10 @@ declare namespace KiiCloud {
*
* @throws Specified kiiGeoPint is not an instance of KiiGeoPoint.
*/
- setGeoPoint(key: string, KiiGeoPoint: KiiGeoPoint): void;
+ setGeoPoint(
+ key: string,
+ KiiGeoPoint: KiiGeoPoint
+ ): void;
/**
* Gets the geo point associated with the given key.
@@ -3092,7 +3445,9 @@ declare namespace KiiCloud {
*
* @return KiiGeoPoint tied to the key. null if null exists.
*/
- getGeoPoint(key: string): KiiGeoPoint;
+ getGeoPoint(
+ key: string
+ ): KiiGeoPoint;
/**
* Get the ACL handle for this file
@@ -3175,7 +3530,10 @@ declare namespace KiiCloud {
* }
* );
*/
- saveAllFields(callbacks?: { success(theSavedObject: KiiObject): any; failure(theObject: KiiObject, anErrorString: string): any; }, overwrite?: boolean): Promise;
+ saveAllFields(
+ callbacks?: { success(theSavedObject: KiiObject): any; failure(theObject: KiiObject, anErrorString: string): any; },
+ overwrite?: boolean
+ ): Promise;
/**
* Create or update the KiiObject on KiiCloud.
@@ -3233,7 +3591,10 @@ declare namespace KiiCloud {
* }
* );
*/
- save(callbacks?: { success(theSavedObject: KiiObject): any; failure(theObject: KiiObject, anErrorString: string): any; }, overwrite?: boolean): Promise;
+ save(
+ callbacks?: { success(theSavedObject: KiiObject): any; failure(theObject: KiiObject, anErrorString: string): any; },
+ overwrite?: boolean
+ ): Promise;
/**
* Updates the local object's data with the user data on the server
@@ -3277,7 +3638,9 @@ declare namespace KiiCloud {
* }
* );
*/
- refresh(callbacks?: { success(theRefreshedObject: KiiObject): any; failure(theObject: KiiObject, anErrorString: string): any; }): Promise;
+ refresh(
+ callbacks?: { success(theRefreshedObject: KiiObject): any; failure(theObject: KiiObject, anErrorString: string): any; }
+ ): Promise;
/**
* Delete the object from the server
@@ -3319,7 +3682,9 @@ declare namespace KiiCloud {
* }
* );
*/
- delete(callbacks?: { success(theDeletedObject: KiiObject): any; failure(theObject: KiiObject, anErrorString: string): any; }): Promise;
+ delete(
+ callbacks?: { success(theDeletedObject: KiiObject): any; failure(theObject: KiiObject, anErrorString: string): any; }
+ ): Promise;
/**
* Generate a new KiiObject based on a given URI
@@ -3333,7 +3698,9 @@ declare namespace KiiCloud {
* @example
* var group = new KiiObject.objectWithURI("kiicloud://myuri");
*/
- static objectWithURI(uri: string): KiiObject;
+ static objectWithURI(
+ uri: string
+ ): KiiObject;
/**
* Move KiiObject body from an object to another object.
@@ -3392,7 +3759,10 @@ declare namespace KiiCloud {
* }
* );
*/
- moveBody(targetObjectUri: string, callbacks?: { success(theSrcObject: KiiObject, theTgtObjectUri: string): any; failure(theSrcObject: KiiObject, theTgtObjectUri: string, anErrorString: string): any; }): Promise<[KiiObject, string]>;
+ moveBody(
+ targetObjectUri: string,
+ callbacks?: { success(theSrcObject: KiiObject, theTgtObjectUri: string): any; failure(theSrcObject: KiiObject, theTgtObjectUri: string, anErrorString: string): any; }
+ ): Promise<[KiiObject, string]>;
/**
* Upload body data of this object.
@@ -3472,7 +3842,10 @@ declare namespace KiiCloud {
* }
* );
*/
- uploadBody(srcDataBlob: Blob, callbacks?: { success(obj: KiiObject): any; failure(obj: KiiObject, anErrorString: string): any; }): Promise;
+ uploadBody(
+ srcDataBlob: Blob,
+ callbacks?: { success(obj: KiiObject): any; failure(obj: KiiObject, anErrorString: string): any; }
+ ): Promise;
/**
* Download body data of this object.
@@ -3547,7 +3920,9 @@ declare namespace KiiCloud {
* }
* );
*/
- downloadBody(callbacks?: { success(obj: KiiObject, bodyBlob: Blob): any; failure(obj: KiiObject, anErrorString: string): any; }): Promise<[KiiObject, Blob]>;
+ downloadBody(
+ callbacks?: { success(obj: KiiObject, bodyBlob: Blob): any; failure(obj: KiiObject, anErrorString: string): any; }
+ ): Promise<[KiiObject, Blob]>;
/**
* Publish object body.
@@ -3600,7 +3975,9 @@ declare namespace KiiCloud {
* }
* );
*/
- publishBody(callbacks?: { success(obj: KiiObject, publishedUrl: string): any; failure(obj: KiiObject, anErrorString: string): any; }): Promise<[KiiObject, string]>;
+ publishBody(
+ callbacks?: { success(obj: KiiObject, publishedUrl: string): any; failure(obj: KiiObject, anErrorString: string): any; }
+ ): Promise<[KiiObject, string]>;
/**
* Publish object body with expiration date.
@@ -3656,7 +4033,10 @@ declare namespace KiiCloud {
* }
* );
*/
- publishBodyExpiresAt(expiresAt: Date, callbacks?: { success(obj: KiiObject, publishedUrl: string): any; failure(obj: KiiObject, anErrorString: string): any; }): Promise<[KiiObject, string]>;
+ publishBodyExpiresAt(
+ expiresAt: Date,
+ callbacks?: { success(obj: KiiObject, publishedUrl: string): any; failure(obj: KiiObject, anErrorString: string): any; }
+ ): Promise<[KiiObject, string]>;
/**
* Publish object body with expiration duration.
@@ -3712,7 +4092,10 @@ declare namespace KiiCloud {
* }
* );
*/
- publishBodyExpiresIn(expiresIn: number, callbacks?: { success(obj: KiiObject, publishedUrl: string): any; failure(obj: KiiObject, anErrorString: string): any; }): Promise<[KiiObject, string]>;
+ publishBodyExpiresIn(
+ expiresIn: number,
+ callbacks?: { success(obj: KiiObject, publishedUrl: string): any; failure(obj: KiiObject, anErrorString: string): any; }
+ ): Promise<[KiiObject, string]>;
/**
* Delete the object body from the server.
@@ -3757,7 +4140,9 @@ declare namespace KiiCloud {
* }
* );
*/
- deleteBody(callbacks?: { success(theDeletedObject: KiiObject): any; failure(obj: KiiObject, anErrorString: string): any; }): Promise;
+ deleteBody(
+ callbacks?: { success(theDeletedObject: KiiObject): any; failure(obj: KiiObject, anErrorString: string): any; }
+ ): Promise;
/**
* Check if given ID is valid for object ID.
@@ -3767,7 +4152,9 @@ declare namespace KiiCloud {
*
* @return true if given ID is valid, false otherwise.
*/
- static isValidObjectID(objectID: string): boolean;
+ static isValidObjectID(
+ objectID: string
+ ): boolean;
}
/**
@@ -3798,7 +4185,11 @@ declare namespace KiiCloud {
* @example
*
*/
- installGcm(installationRegistrationID: string, development: boolean, callbacks?: { success(response: KiiGcmInstallationResponse): any; failure(error: Error): any; }): Promise;
+ installGcm(
+ installationRegistrationID: string,
+ development: boolean,
+ callbacks?: { success(response: KiiGcmInstallationResponse): any; failure(error: Error): any; }
+ ): Promise;
/**
* Register a MQTT installation to the Kii cloud for current logged in user.
@@ -3824,7 +4215,10 @@ declare namespace KiiCloud {
* @example
*
*/
- installMqtt(development: boolean, callbacks?: { success(response: KiiMqttInstallationResponse): any; failure(error: Error): any; }): Promise;
+ installMqtt(
+ development: boolean,
+ callbacks?: { success(response: KiiMqttInstallationResponse): any; failure(error: Error): any; }
+ ): Promise;
/**
* Get MQTT endpoint.
@@ -3862,7 +4256,10 @@ declare namespace KiiCloud {
* @example
*
*/
- getMqttEndpoint(installationID: string, callbacks?: { success(response: KiiMqttEndpoint): any; failure(error: Error): any; }): Promise;
+ getMqttEndpoint(
+ installationID: string,
+ callbacks?: { success(response: KiiMqttEndpoint): any; failure(error: Error): any; }
+ ): Promise;
/**
* Unregister the push settings by the id(issued by push provider) that is used for installation.
@@ -3884,7 +4281,11 @@ declare namespace KiiCloud {
* @example
*
*/
- uninstall(installationRegistrationID: string, deviceType: string, callbacks?: { success(): any; failure(error: Error): any; }): Promise;
+ uninstall(
+ installationRegistrationID: string,
+ deviceType: string,
+ callbacks?: { success(): any; failure(error: Error): any; }
+ ): Promise;
/**
* Unregister the push settings by the id(issued by KiiCloud) that is used for installation.
@@ -3905,7 +4306,10 @@ declare namespace KiiCloud {
* @example
*
*/
- uninstallByInstallationID(installationID: string, callbacks?: { success(): any; failure(error: Error): any; }): Promise;
+ uninstallByInstallationID(
+ installationID: string,
+ callbacks?: { success(): any; failure(error: Error): any; }
+ ): Promise;
}
/**
@@ -3922,7 +4326,9 @@ declare namespace KiiCloud {
*
* @param data sent to all push channels (gcm, apns, jpush, mqtt).
*/
- constructor(data: any);
+ constructor(
+ data: any
+ );
/**
* build push message.
@@ -3939,7 +4345,9 @@ declare namespace KiiCloud {
*
* @return builder instance.
*/
- setSendToDevelopment(flag: boolean): KiiPushMessageBuilder;
+ setSendToDevelopment(
+ flag: boolean
+ ): KiiPushMessageBuilder;
/**
* Indicate whether send this message to production environment.
@@ -3949,7 +4357,9 @@ declare namespace KiiCloud {
*
* @return builder instance.
*/
- setSendToProduction(flag: boolean): KiiPushMessageBuilder;
+ setSendToProduction(
+ flag: boolean
+ ): KiiPushMessageBuilder;
/**
* Enable/ Disable message distribution via GCM.
@@ -3959,7 +4369,9 @@ declare namespace KiiCloud {
*
* @return builder instance.
*/
- enableGcm(enable: boolean): KiiPushMessageBuilder;
+ enableGcm(
+ enable: boolean
+ ): KiiPushMessageBuilder;
/**
* Enable/ Disable message distribution via APNS.
@@ -3969,7 +4381,9 @@ declare namespace KiiCloud {
*
* @return builder instance.
*/
- enableApns(enable: boolean): KiiPushMessageBuilder;
+ enableApns(
+ enable: boolean
+ ): KiiPushMessageBuilder;
/**
* Enable/ Disable message distribution via JPush.
@@ -3979,7 +4393,9 @@ declare namespace KiiCloud {
*
* @return builder instance.
*/
- enableJpush(enable: boolean): KiiPushMessageBuilder;
+ enableJpush(
+ enable: boolean
+ ): KiiPushMessageBuilder;
/**
* Enable/ Disable message distribution via MQTT.
@@ -3989,7 +4405,9 @@ declare namespace KiiCloud {
*
* @return builder instance.
*/
- enableMqtt(enable: boolean): KiiPushMessageBuilder;
+ enableMqtt(
+ enable: boolean
+ ): KiiPushMessageBuilder;
/**
* Set specific data for GCM subscribers.
@@ -4002,7 +4420,9 @@ declare namespace KiiCloud {
*
* @return builder instance.
*/
- gcmData(data: { [key: string]: string }): KiiPushMessageBuilder;
+ gcmData(
+ data: { [key: string]: string }
+ ): KiiPushMessageBuilder;
/**
* Set collapse_key for GCM subscribers.
@@ -4013,7 +4433,9 @@ declare namespace KiiCloud {
*
* @return builder instance.
*/
- gcmCollapseKey(collapseKey: string): KiiPushMessageBuilder;
+ gcmCollapseKey(
+ collapseKey: string
+ ): KiiPushMessageBuilder;
/**
* Set delay_while_idle for GCM subscribers.
@@ -4024,7 +4446,9 @@ declare namespace KiiCloud {
*
* @return builder instance.
*/
- gcmDelayWhileIdle(delayWhileIdle: boolean): KiiPushMessageBuilder;
+ gcmDelayWhileIdle(
+ delayWhileIdle: boolean
+ ): KiiPushMessageBuilder;
/**
* Set time_to_live for GCM subscribers.
@@ -4035,7 +4459,9 @@ declare namespace KiiCloud {
*
* @return builder instance.
*/
- gcmTimeToLive(timeToLive: number): KiiPushMessageBuilder;
+ gcmTimeToLive(
+ timeToLive: number
+ ): KiiPushMessageBuilder;
/**
* Set restricted_package_name for GCM subscribers.
@@ -4046,7 +4472,9 @@ declare namespace KiiCloud {
*
* @return builder instance.
*/
- gcmRestrictedPackageName(restrictedPackageName: string): KiiPushMessageBuilder;
+ gcmRestrictedPackageName(
+ restrictedPackageName: string
+ ): KiiPushMessageBuilder;
/**
* Set specific data for APNS subscribers.
@@ -4059,7 +4487,9 @@ declare namespace KiiCloud {
*
* @return builder instance.
*/
- apnsData(data: { [key: string]: string | number | boolean }): KiiPushMessageBuilder;
+ apnsData(
+ data: { [key: string]: string | number | boolean }
+ ): KiiPushMessageBuilder;
/**
* Set alert for APNS subscribers.
@@ -4070,7 +4500,9 @@ declare namespace KiiCloud {
*
* @return builder instance.
*/
- apnsAlert(alert: string | APNSAlert): KiiPushMessageBuilder;
+ apnsAlert(
+ alert: string | APNSAlert
+ ): KiiPushMessageBuilder;
/**
* Set sound for APNS subscribers.
@@ -4081,7 +4513,9 @@ declare namespace KiiCloud {
*
* @return builder instance.
*/
- apnsSound(sound: string): KiiPushMessageBuilder;
+ apnsSound(
+ sound: string
+ ): KiiPushMessageBuilder;
/**
* Set badge for APNS subscribers.
@@ -4092,7 +4526,9 @@ declare namespace KiiCloud {
*
* @return builder instance.
*/
- apnsBadge(badge: number): KiiPushMessageBuilder;
+ apnsBadge(
+ badge: number
+ ): KiiPushMessageBuilder;
/**
* Set content-available for APNS subscribers.
@@ -4104,7 +4540,9 @@ declare namespace KiiCloud {
*
* @return builder instance.
*/
- apnsContentAvailable(contentAvailable: number): KiiPushMessageBuilder;
+ apnsContentAvailable(
+ contentAvailable: number
+ ): KiiPushMessageBuilder;
/**
* Set category for APNS subscribers.
@@ -4115,7 +4553,9 @@ declare namespace KiiCloud {
*
* @return builder instance.
*/
- apnsCategory(category: string): KiiPushMessageBuilder;
+ apnsCategory(
+ category: string
+ ): KiiPushMessageBuilder;
/**
* Set specific data for JPush subscribers.
@@ -4128,7 +4568,9 @@ declare namespace KiiCloud {
*
* @return builder instance.
*/
- jpushData(data: { [name: string]: string | number | boolean }): KiiPushMessageBuilder;
+ jpushData(
+ data: { [name: string]: string | number | boolean }
+ ): KiiPushMessageBuilder;
/**
* Set specific data for MQTT subscribers.
@@ -4141,7 +4583,9 @@ declare namespace KiiCloud {
*
* @return builder instance.
*/
- mqttData(data: { [key: string]: string }): KiiPushMessageBuilder;
+ mqttData(
+ data: { [key: string]: string }
+ ): KiiPushMessageBuilder;
}
/**
@@ -4197,7 +4641,10 @@ declare namespace KiiCloud {
* }
* );
*/
- subscribe(target: T, callbacks?: { success(subscription: KiiPushSubscription, topic: T): any; failure(error: Error): any; }): Promise<[KiiPushSubscription, T]>;
+ subscribe(
+ target: T,
+ callbacks?: { success(subscription: KiiPushSubscription, topic: T): any; failure(error: Error): any; }
+ ): Promise<[KiiPushSubscription, T]>;
/**
* Unsubscribe to bucket or topic.
@@ -4248,7 +4695,10 @@ declare namespace KiiCloud {
* }
* );
*/
- unsubscribe(target: T, callbacks?: { success(subscription: KiiPushSubscription, topic: T): any; failure(error: Error): any; }): Promise<[KiiPushSubscription, T]>;
+ unsubscribe(
+ target: T,
+ callbacks?: { success(subscription: KiiPushSubscription, topic: T): any; failure(error: Error): any; }
+ ): Promise<[KiiPushSubscription, T]>;
/**
* Check subscription of bucket, topic.
@@ -4311,7 +4761,10 @@ declare namespace KiiCloud {
* }
* );
*/
- isSubscribed(target: T, callbacks?: { success(subscription: KiiPushSubscription, topic: T, isSubscribed: boolean): any; failure(error: Error): any; }): Promise<[KiiPushSubscription, T, boolean]>;
+ isSubscribed(
+ target: T,
+ callbacks?: { success(subscription: KiiPushSubscription, topic: T, isSubscribed: boolean): any; failure(error: Error): any; }
+ ): Promise<[KiiPushSubscription, T, boolean]>;
}
/**
@@ -4332,7 +4785,9 @@ declare namespace KiiCloud {
*
* @throws InvalidLimitException
*/
- setLimit(value: number): void;
+ setLimit(
+ value: number
+ ): void;
/**
* Create a KiiQuery object based on a KiiClause
@@ -4341,7 +4796,9 @@ declare namespace KiiCloud {
*
* @param clause The KiiClause to be executed with the query
*/
- static queryWithClause(clause: KiiClause): KiiQuery;
+ static queryWithClause(
+ clause: KiiClause
+ ): KiiQuery;
/**
* Set the query to sort by a field in descending order
@@ -4350,7 +4807,9 @@ declare namespace KiiCloud {
*
* @param field The key that should be used to sort
*/
- sortByDesc(field: string): void;
+ sortByDesc(
+ field: string
+ ): void;
/**
* Set the query to sort by a field in ascending order
@@ -4359,7 +4818,9 @@ declare namespace KiiCloud {
*
* @param field The key that should be used to sort
*/
- sortByAsc(field: string): void;
+ sortByAsc(
+ field: string
+ ): void;
}
/**
@@ -4432,7 +4893,12 @@ declare namespace KiiCloud {
* }
* );
*/
- execute(argument: T, callbacks?: { success(entry: KiiServerCodeEntry, argument: T, execResult: KiiServerCodeExecResult): any; failure(entry: KiiServerCodeEntry, argument: T, execResult: KiiServerCodeExecResult, anErrorString: string): any; }): Promise<[KiiServerCodeEntry, T, KiiServerCodeExecResult]>;
+ execute(
+ argument: T,
+ callbacks?: {
+ success(entry: KiiServerCodeEntry, argument: T, execResult: KiiServerCodeExecResult): any;
+ failure(entry: KiiServerCodeEntry, argument: T, execResult: KiiServerCodeExecResult, anErrorString: string): any; }
+ ): Promise<[KiiServerCodeEntry, T, KiiServerCodeExecResult]>;
/**
* Get the entryName of this server code entry.
@@ -4592,7 +5058,12 @@ declare namespace KiiCloud {
*
* @throws For details refer to the table above
*/
- static setupNetwork(networkName: KiiSocialNetworkName, apiKey: string, apiSecret: string, extras: any): void;
+ static setupNetwork(
+ networkName: KiiSocialNetworkName,
+ apiKey: string,
+ apiSecret: string,
+ extras: any
+ ): void;
/**
* Log a user into the social network provided
@@ -4761,12 +5232,17 @@ declare namespace KiiCloud {
* }
* );
*/
- static logIn(networkName: KiiSocialNetworkName, options: KiiSocialConnectOptions, callbacks?: { success(user: KiiUser, network: KiiSocialNetworkName): any; failure(user: KiiUser, network: KiiSocialNetworkName, anErrorString: string): any; }): Promise<[KiiUser, KiiSocialNetworkName]>;
+ static logIn(
+ networkName: KiiSocialNetworkName,
+ options: KiiSocialConnectOptions,
+ callbacks?: { success(user: KiiUser, network: KiiSocialNetworkName): any; failure(user: KiiUser, network: KiiSocialNetworkName, anErrorString: string): any; }
+ ): Promise<[KiiUser, KiiSocialNetworkName]>;
/**
* Link the currently logged in user with a social network
*
- * This will initiate the login process for the given network, which for SSO-enabled services like Facebook, will send the user to the Facebook site for authentication. There must be a currently authenticated KiiUser. Otherwise, you can use the logIn: method to create and log in a KiiUser using a network. The network must already be set up via setupNetwork
+ * This will initiate the login process for the given network, which for SSO-enabled services like Facebook, will send the user to the Facebook site for authentication. There must be a
+ * currently authenticated KiiUser. Otherwise, you can use the logIn: method to create and log in a KiiUser using a network. The network must already be set up via setupNetwork
* If there is not logged-in user to link with, callbacks.failure or reject callback of promise will be called.
* If the opitons is invalid, callbacks.failure or reject callback of promise will be called.
*
@@ -4927,7 +5403,11 @@ declare namespace KiiCloud {
* }
* );
*/
- static linkCurrentUserWithNetwork(networkName: KiiSocialNetworkName, options: KiiSocialConnectOptions, callbacks?: { success(user: KiiUser, network: KiiSocialNetworkName): any; failure(user: KiiUser, network: KiiSocialNetworkName, anErrorString: string): any; }): Promise<[KiiUser, KiiSocialNetworkName]>;
+ static linkCurrentUserWithNetwork(
+ networkName: KiiSocialNetworkName,
+ options: KiiSocialConnectOptions,
+ callbacks?: { success(user: KiiUser, network: KiiSocialNetworkName): any; failure(user: KiiUser, network: KiiSocialNetworkName, anErrorString: string): any; }
+ ): Promise<[KiiUser, KiiSocialNetworkName]>;
/**
* Unlink the currently logged in user with a social network
@@ -4978,7 +5458,10 @@ declare namespace KiiCloud {
* }
* );
*/
- static unLinkCurrentUserFromNetwork(networkName: KiiSocialNetworkName, callbacks?: { success(user: KiiUser, network: KiiSocialNetworkName): any; failure(user: KiiUser, network: KiiSocialNetworkName, anErrorString: string): any; }): Promise<[KiiUser, KiiSocialNetworkName]>;
+ static unLinkCurrentUserFromNetwork(
+ networkName: KiiSocialNetworkName,
+ callbacks?: { success(user: KiiUser, network: KiiSocialNetworkName): any; failure(user: KiiUser, network: KiiSocialNetworkName, anErrorString: string): any; }
+ ): Promise<[KiiUser, KiiSocialNetworkName]>;
/**
* Retrieve the current user's access token from a social network
@@ -4990,7 +5473,9 @@ declare namespace KiiCloud {
*
* @return The current access token, null if unavailable
*/
- static getAccessTokenForNetwork(networkName: KiiSocialNetworkName): string;
+ static getAccessTokenForNetwork(
+ networkName: KiiSocialNetworkName
+ ): string;
/**
* Retrieve the current user's access token expiration date from a social network
@@ -5003,7 +5488,9 @@ declare namespace KiiCloud {
*
* @return The current access token expiration date, null if unavailable
*/
- static getAccessTokenExpirationForNetwork(networkName: KiiSocialNetworkName): string;
+ static getAccessTokenExpirationForNetwork(
+ networkName: KiiSocialNetworkName
+ ): string;
/**
* Retrieve the current user's access token object from a social network
@@ -5038,7 +5525,9 @@ declare namespace KiiCloud {
*
* @return tokenObject The current access token object, null if unavailable.
*/
- static getAccessTokenObjectForNetwork(networkName: KiiSocialNetworkName): any;
+ static getAccessTokenObjectForNetwork(
+ networkName: KiiSocialNetworkName
+ ): any;
}
/**
@@ -5176,7 +5665,10 @@ declare namespace KiiCloud {
* }
* );
*/
- static register(fields: KiiThingFields, callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise;
+ static register(
+ fields: KiiThingFields,
+ callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }
+ ): Promise;
/**
* Retrieve the latest thing information from KiiCloud.
@@ -5222,7 +5714,9 @@ declare namespace KiiCloud {
* }
* );
*/
- refresh(callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise;
+ refresh(
+ callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }
+ ): Promise;
/**
* Update registered thing information in Kii Cloud
@@ -5280,7 +5774,9 @@ declare namespace KiiCloud {
* }
* );
*/
- update(callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise;
+ update(
+ callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }
+ ): Promise;
/**
* Delete registered thing in Kii Cloud.
@@ -5330,7 +5826,9 @@ declare namespace KiiCloud {
* }
* );
*/
- deleteThing(callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise;
+ deleteThing(
+ callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }
+ ): Promise;
/**
* Check if user/ group is owner of the thing.
@@ -5396,7 +5894,10 @@ declare namespace KiiCloud {
* }
* );
*/
- isOwner(owner: T, callbacks?: { success(thing: KiiThing, user: T, isOwner: boolean): any; failure(error: Error): any; }): Promise<[KiiThing, T, boolean]>;
+ isOwner(
+ owner: T,
+ callbacks?: { success(thing: KiiThing, user: T, isOwner: boolean): any; failure(error: Error): any; }
+ ): Promise<[KiiThing, T, boolean]>;
/**
* Register user/group as owner of this thing.
@@ -5450,7 +5951,10 @@ declare namespace KiiCloud {
* }
* );
*/
- registerOwner(owner: T, callbacks?: { success(thing: KiiThing, group: T): any; failure(error: Error): any; }): Promise<[KiiThing, T]>;
+ registerOwner(
+ owner: T,
+ callbacks?: { success(thing: KiiThing, group: T): any; failure(error: Error): any; }
+ ): Promise<[KiiThing, T]>;
/**
* Register user/group as owner of specified thing.
@@ -5502,7 +6006,11 @@ declare namespace KiiCloud {
* }
* );
*/
- static registerOwnerWithThingID(thingID: string, owner: T, callbacks?: { success(group: T): any; failure(error: Error): any; }): Promise;
+ static registerOwnerWithThingID(
+ thingID: string,
+ owner: T,
+ callbacks?: { success(group: T): any; failure(error: Error): any; }
+ ): Promise;
/**
* Register user/group as owner of specified thing.
@@ -5553,7 +6061,11 @@ declare namespace KiiCloud {
* }
* );
*/
- static registerOwnerWithVendorThingID(vendorThingID: string, owner: T, callbacks?: { success(group: T): any; failure(error: Error): any; }): Promise;
+ static registerOwnerWithVendorThingID(
+ vendorThingID: string,
+ owner: T,
+ callbacks?: { success(group: T): any; failure(error: Error): any; }
+ ): Promise;
/**
* Remove ownership of thing from specified user/group.
@@ -5606,7 +6118,10 @@ declare namespace KiiCloud {
* }
* );
*/
- unregisterOwner(owner: T, callbacks?: { success(thing: KiiThing, group: T): any; failure(error: Error): any; }): Promise<[KiiThing, T]>;
+ unregisterOwner(
+ owner: T,
+ callbacks?: { success(thing: KiiThing, group: T): any; failure(error: Error): any; }
+ ): Promise<[KiiThing, T]>;
/**
* Disable the thing.
@@ -5657,7 +6172,9 @@ declare namespace KiiCloud {
* }
* );
*/
- disable(callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise;
+ disable(
+ callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }
+ ): Promise;
/**
* Enable the thing.
@@ -5708,7 +6225,9 @@ declare namespace KiiCloud {
* }
* );
*/
- enable(callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise;
+ enable(
+ callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }
+ ): Promise;
/**
* Load thing with given vendor thing id.
@@ -5752,7 +6271,10 @@ declare namespace KiiCloud {
* }
* );
*/
- static loadWithVendorThingID(vendorThingID: string, callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise;
+ static loadWithVendorThingID(
+ vendorThingID: string,
+ callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }
+ ): Promise;
/**
* Load thing with thing id given by Kii Cloud.
@@ -5798,7 +6320,10 @@ declare namespace KiiCloud {
* }
* );
*/
- static loadWithThingID(thingID: string, callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }): Promise;
+ static loadWithThingID(
+ thingID: string,
+ callbacks?: { success(thing: KiiThing): any; failure(error: Error): any; }
+ ): Promise;
/**
* Instantiate bucket belongs to this thing.
@@ -5807,7 +6332,9 @@ declare namespace KiiCloud {
*
* @return bucket instance.
*/
- bucketWithName(bucketName: string): KiiBucket;
+ bucketWithName(
+ bucketName: string
+ ): KiiBucket;
/**
* Creates a reference to a encrypted bucket for this thing
@@ -5822,7 +6349,9 @@ declare namespace KiiCloud {
* var thing = . . .; // a KiiThing
* var bucket = thing.encryptedBucketWithName("myBucket");
*/
- encryptedBucketWithName(bucketName: string): KiiBucket;
+ encryptedBucketWithName(
+ bucketName: string
+ ): KiiBucket;
/**
* Instantiate topic belongs to this thing.
@@ -5831,13 +6360,16 @@ declare namespace KiiCloud {
*
* @return topic instance.
*/
- topicWithName(topicName: string): KiiTopic;
+ topicWithName(
+ topicName: string
+ ): KiiTopic;
/**
* Gets a list of topics in this thing scope
*
* @param callbacks An object with callback methods defined
- * @param paginationKey You can specify the pagination key with the nextPaginationKey passed by callbacks.success. If empty string or no string object is provided, this API regards no paginationKey specified.
+ * @param paginationKey You can specify the pagination key with the nextPaginationKey passed by callbacks.success. If empty string or no string object is provided, this API regards no
+ * paginationKey specified.
*
* @return return promise object.
*
@@ -5898,7 +6430,10 @@ declare namespace KiiCloud {
* }
* );
*/
- listTopics(callbacks?: { success(topicList: KiiTopic[], nextPaginationKey: string): any; failure(anErrorString: string): any; }, paginationKey?: string): Promise<[KiiTopic[], string]>;
+ listTopics(
+ callbacks?: { success(topicList: KiiTopic[], nextPaginationKey: string): any; failure(anErrorString: string): any; },
+ paginationKey?: string
+ ): Promise<[KiiTopic[], string]>;
/**
* Instantiate push subscription for this thing.
@@ -5929,7 +6464,9 @@ declare namespace KiiCloud {
* }
* });
*/
- bucketWithName(bucketName: string): KiiBucket;
+ bucketWithName(
+ bucketName: string
+ ): KiiBucket;
/**
* Creates a reference to a encrypted bucket in App scope operated by thing.
@@ -5949,7 +6486,9 @@ declare namespace KiiCloud {
* }
* });
*/
- encryptedBucketWithName(bucketName: string): KiiBucket;
+ encryptedBucketWithName(
+ bucketName: string
+ ): KiiBucket;
/**
* Creates a reference to an object operated by thing using object`s URI.
@@ -5960,7 +6499,9 @@ declare namespace KiiCloud {
*
* @throws If the URI is null, empty or does not have correct format.
*/
- objectWithURI(object: string): KiiObject;
+ objectWithURI(
+ object: string
+ ): KiiObject;
/**
* Creates a reference to a topic in App scope operated by thing.
@@ -5970,13 +6511,16 @@ declare namespace KiiCloud {
*
* @return topic instance.
*/
- topicWithName(topicName: string): KiiTopic;
+ topicWithName(
+ topicName: string
+ ): KiiTopic;
/**
* Gets a list of topics in app scope
*
* @param callbacks An object with callback methods defined
- * @param paginationKey You can specify the pagination key with the nextPaginationKey passed by callbacks.success. If empty string or no string object is provided, this API regards no paginationKey specified.
+ * @param paginationKey You can specify the pagination key with the nextPaginationKey passed by callbacks.success. If empty string or no string object is provided, this API regards no
+ * paginationKey specified.
*
* @return return promise object.
*
@@ -6037,7 +6581,10 @@ declare namespace KiiCloud {
* }
* );
*/
- listTopics(callbacks?: { success(topicList: KiiTopic[], nextPaginationKey: string): any; failure(anErrorString: string): any; }, paginationKey?: string): Promise<[KiiTopic[], string]>;
+ listTopics(
+ callbacks?: { success(topicList: KiiTopic[], nextPaginationKey: string): any; failure(anErrorString: string): any; },
+ paginationKey?: string
+ ): Promise<[KiiTopic[], string]>;
/**
* Gets authenticated KiiThing instance.
@@ -6105,7 +6652,9 @@ declare namespace KiiCloud {
* // Handle error.
* });
*/
- exists(callbacks?: { success(existed: boolean): any; failure(error: Error): any; }): Promise;
+ exists(
+ callbacks?: { success(existed: boolean): any; failure(error: Error): any; }
+ ): Promise;
/**
* Save this topic on Kii Cloud.
@@ -6147,7 +6696,9 @@ declare namespace KiiCloud {
* }
* );
*/
- save(callbacks?: { success(topic: KiiTopic): any; failure(error: Error): any; }): Promise;
+ save(
+ callbacks?: { success(topic: KiiTopic): any; failure(error: Error): any; }
+ ): Promise;
/**
* Send message to the topic.
@@ -6202,7 +6753,10 @@ declare namespace KiiCloud {
* }
* );
*/
- sendMessage(message: T, callbacks?: { success(topic: KiiTopic, message: T): any; failure(error: Error): any; }): Promise<[KiiTopic, T]>;
+ sendMessage(
+ message: T,
+ callbacks?: { success(topic: KiiTopic, message: T): any; failure(error: Error): any; }
+ ): Promise<[KiiTopic, T]>;
/**
* Delete the topic.
@@ -6243,7 +6797,9 @@ declare namespace KiiCloud {
* }
* );
*/
- deleteTopic(callbacks?: { success(topic: KiiTopic): any; failure(error: Error): any; }): Promise;
+ deleteTopic(
+ callbacks?: { success(topic: KiiTopic): any; failure(error: Error): any; }
+ ): Promise;
/**
* Get ACL object of this topic.
@@ -6305,7 +6861,9 @@ declare namespace KiiCloud {
*
* @throws If the displayName is not a valid format
*/
- setDisplayName(value: string): void;
+ setDisplayName(
+ value: string
+ ): void;
/**
* Get whether or not the user is pseudo user.
@@ -6368,7 +6926,9 @@ declare namespace KiiCloud {
*
* @throws If the country code is not a valid format
*/
- setCountry(value: string): void;
+ setCountry(
+ value: string
+ ): void;
/**
* Get the locale associated with this user
@@ -6387,7 +6947,9 @@ declare namespace KiiCloud {
*
* @param value The locale to set.
*/
- setLocale(value: string): void;
+ setLocale(
+ value: string
+ ): void;
/**
* Get the server's creation date of this user
@@ -6488,7 +7050,10 @@ declare namespace KiiCloud {
* var user = . . .; // a KiiUser
* user.set("score", 4298);
*/
- set(key: string, value: any): void;
+ set(
+ key: string,
+ value: any
+ ): void;
/**
* Gets the value associated with the given key
@@ -6501,7 +7066,9 @@ declare namespace KiiCloud {
* var user = . . .; // a KiiUser
* var score = user.get("score");
*/
- get(key: string): T;
+ get(
+ key: string
+ ): T;
/**
* The currently authenticated user
@@ -6516,7 +7083,8 @@ declare namespace KiiCloud {
/**
* Create a user object to prepare for registration with credentials pre-filled
*
- *
Creates an pre-filled user object for manipulation. This user will not be authenticated until one of the authentication methods are called on it. It can be treated as any other KiiObject before it is authenticated.
+ *
Creates an pre-filled user object for manipulation. This user will not be authenticated until one of the authentication methods are called on it. It can be treated as any other
+ * KiiObject before it is authenticated.
*
* @param username The user's desired username. Must be between 3 and 64 characters, which can include alphanumeric characters as well as underscores '_', dashes '-' and periods '.'
* @param password The user's password. Must be between 4-50 characters, made up of ascii characters excludes control characters.
@@ -6529,12 +7097,16 @@ declare namespace KiiCloud {
* @example
* var user = KiiUser.userWithUsername("myusername", "mypassword");
*/
- static userWithUsername(username: string, password: string): KiiUser;
+ static userWithUsername(
+ username: string,
+ password: string
+ ): KiiUser;
/**
* Create a user object to prepare for registration with credentials pre-filled
*
- *
Creates an pre-filled user object for registration. This user will not be authenticated until the registration method is called on it. It can be treated as any other KiiUser before it is registered.
+ *
Creates an pre-filled user object for registration. This user will not be authenticated until the registration method is called on it. It can be treated as any other KiiUser before
+ * it is registered.
*
* @param phoneNumber The user's phone number
* @param password The user's password. Must be at least 4 characters, made up of alphanumeric and/or: @,#,$,%,^,&
@@ -6547,12 +7119,16 @@ declare namespace KiiCloud {
* @example
* var user = KiiUser.userWithPhoneNumber("+874012345678", "mypassword");
*/
- static userWithPhoneNumber(phoneNumber: string, password: string): KiiUser;
+ static userWithPhoneNumber(
+ phoneNumber: string,
+ password: string
+ ): KiiUser;
/**
* Create a user object to prepare for registration with credentials pre-filled
*
- *
Creates an pre-filled user object for registration. This user will not be authenticated until the registration method is called on it. It can be treated as any other KiiUser before it is registered.
+ *
Creates an pre-filled user object for registration. This user will not be authenticated until the registration method is called on it. It can be treated as any other KiiUser before
+ * it is registered.
*
* @param phoneNumber The user's phone number
* @param username The user's desired username. Must be between 3 and 64 characters, which can include alphanumeric characters as well as underscores '_', dashes '-' and periods '.'
@@ -6567,12 +7143,17 @@ declare namespace KiiCloud {
* @example
* var user = KiiUser.userWithPhoneNumberAndUsername("+874012345678", "johndoe", "mypassword");
*/
- static userWithPhoneNumberAndUsername(phoneNumber: string, username: string, password: string): KiiUser;
+ static userWithPhoneNumberAndUsername(
+ phoneNumber: string,
+ username: string,
+ password: string
+ ): KiiUser;
/**
* Create a user object to prepare for registration with credentials pre-filled
*
- *
Creates an pre-filled user object for registration. This user will not be authenticated until the registration method is called on it. It can be treated as any other KiiUser before it is registered.
+ *
Creates an pre-filled user object for registration. This user will not be authenticated until the registration method is called on it. It can be treated as any other KiiUser before
+ * it is registered.
*
* @param emailAddress The user's email address
* @param password The user's password. Must be at least 4 characters, made up of alphanumeric and/or: @,#,$,%,^,&
@@ -6585,12 +7166,16 @@ declare namespace KiiCloud {
* @example
* var user = KiiUser.userWithEmailAddress("johndoe@example.com", "mypassword");
*/
- static userWithEmailAddress(emailAddress: string, password: string): KiiUser;
+ static userWithEmailAddress(
+ emailAddress: string,
+ password: string
+ ): KiiUser;
/**
* Create a user object to prepare for registration with credentials pre-filled
*
- *
Creates an pre-filled user object for registration. This user will not be authenticated until the registration method is called on it. It can be treated as any other KiiUser before it is registered.
+ *
Creates an pre-filled user object for registration. This user will not be authenticated until the registration method is called on it. It can be treated as any other KiiUser before
+ * it is registered.
*
* @param emailAddress The user's email address
* @param username The user's desired username. Must be between 3 and 64 characters, which can include alphanumeric characters as well as underscores '_', dashes '-' and periods '.'
@@ -6605,12 +7190,17 @@ declare namespace KiiCloud {
* @example
* var user = KiiUser.userWithEmailAddressAndUsername("johndoe@example.com", "johndoe", "mypassword");
*/
- static userWithEmailAddressAndUsername(emailAddress: string, username: string, password: string): KiiUser;
+ static userWithEmailAddressAndUsername(
+ emailAddress: string,
+ username: string,
+ password: string
+ ): KiiUser;
/**
* Create a user object to prepare for registration with credentials pre-filled
*
- *
Creates an pre-filled user object for registration. This user will not be authenticated until the registration method is called on it. It can be treated as any other KiiUser before it is registered.
+ *
Creates an pre-filled user object for registration. This user will not be authenticated until the registration method is called on it. It can be treated as any other KiiUser before
+ * it is registered.
*
* @param emailAddress The user's email address
* @param phoneNumber The user's phone number
@@ -6625,12 +7215,17 @@ declare namespace KiiCloud {
* @example
* var user = KiiUser.userWithEmailAddressAndPhoneNumber("johndoe@example.com", "+874012345678", "mypassword");
*/
- static userWithEmailAddressAndPhoneNumber(emailAddress: string, phoneNumber: string, password: string): KiiUser;
+ static userWithEmailAddressAndPhoneNumber(
+ emailAddress: string,
+ phoneNumber: string,
+ password: string
+ ): KiiUser;
/**
* Create a user object to prepare for registration with credentials pre-filled
*
- *
Creates an pre-filled user object for registration. This user will not be authenticated until the registration method is called on it. It can be treated as any other KiiUser before it is registered.
+ *
Creates an pre-filled user object for registration. This user will not be authenticated until the registration method is called on it. It can be treated as any other KiiUser before
+ * it is registered.
*
* @param emailAddress The user's email address
* @param phoneNumber The user's phone number
@@ -6647,7 +7242,12 @@ declare namespace KiiCloud {
* @example
* var user = KiiUser.userWithCredentials("johndoe@example.com", "+874012345678", "johndoe", "mypassword");
*/
- static userWithCredentials(emailAddress: string, phoneNumber: string, username: string, password: string): KiiUser;
+ static userWithCredentials(
+ emailAddress: string,
+ phoneNumber: string,
+ username: string,
+ password: string
+ ): KiiUser;
/**
* Instantiate KiiUser that refers to existing user which has specified ID.
@@ -6665,7 +7265,9 @@ declare namespace KiiCloud {
* @example
* var user = new KiiUser.userWithID("__USER_ID__");
*/
- static userWithID(userID: string): KiiUser;
+ static userWithID(
+ userID: string
+ ): KiiUser;
/**
* Generate a new KiiUser based on a given URI
@@ -6679,7 +7281,9 @@ declare namespace KiiCloud {
* @example
* var user = new KiiUser.userWithURI("kiicloud://myuri");
*/
- static userWithURI(uri: string): KiiUser;
+ static userWithURI(
+ uri: string
+ ): KiiUser;
/**
* Creates a reference to a bucket for this user
@@ -6694,7 +7298,9 @@ declare namespace KiiCloud {
* var user = . . .; // a KiiUser
* var bucket = user.bucketWithName("myBucket");
*/
- bucketWithName(bucketName: string): KiiBucket;
+ bucketWithName(
+ bucketName: string
+ ): KiiBucket;
/**
* Creates a reference to a encrypted bucket for this user
@@ -6709,7 +7315,9 @@ declare namespace KiiCloud {
* var user = . . .; // a KiiUser
* var bucket = user.encryptedBucketWithName("myBucket");
*/
- encryptedBucketWithName(bucketName: string): KiiBucket;
+ encryptedBucketWithName(
+ bucketName: string
+ ): KiiBucket;
/**
* Authenticates a user with the server.
@@ -6756,7 +7364,11 @@ declare namespace KiiCloud {
* }
* );
*/
- static authenticate(userIdentifier: string, password: string, callbacks?: { success(theAuthenticatedUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise;
+ static authenticate(
+ userIdentifier: string,
+ password: string,
+ callbacks?: { success(theAuthenticatedUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }
+ ): Promise;
/**
* Asynchronously authenticates a user with the server using specified access token.
@@ -6822,7 +7434,11 @@ declare namespace KiiCloud {
* }
* );
*/
- static authenticateWithToken(accessToken: string, callbacks?: { success(theAuthenticatedUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }, expiresAt?: Date): Promise;
+ static authenticateWithToken(
+ accessToken: string,
+ callbacks?: { success(theAuthenticatedUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; },
+ expiresAt?: Date
+ ): Promise;
/**
* Registers a user with the server
@@ -6866,7 +7482,9 @@ declare namespace KiiCloud {
* }
* );
*/
- register(callbacks?: { success(theAuthenticatedUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise;
+ register(
+ callbacks?: { success(theAuthenticatedUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }
+ ): Promise;
/**
* Registers a user as pseudo user with the server
@@ -6909,7 +7527,10 @@ declare namespace KiiCloud {
* }
* );
*/
- static registerAsPseudoUser(callbacks?: { success(theAuthenticatedUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }, userFields?: any): Promise;
+ static registerAsPseudoUser(
+ callbacks?: { success(theAuthenticatedUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; },
+ userFields?: any
+ ): Promise;
/**
* Sets credentials data and custom fields to pseudo user.
@@ -6975,7 +7596,13 @@ declare namespace KiiCloud {
* }
* );
*/
- putIdentity(identityData: identityData, password: string, callbacks?: { success(user: KiiUser): any; failure(user: KiiUser, errorString: string): any; }, userFields?: any, removeFields?: string[]): Promise;
+ putIdentity(
+ identityData: identityData,
+ password: string,
+ callbacks?: { success(user: KiiUser): any; failure(user: KiiUser, errorString: string): any; },
+ userFields?: any,
+ removeFields?: string[]
+ ): Promise;
/**
* Update user attributes.
@@ -7037,7 +7664,12 @@ declare namespace KiiCloud {
* }
* );
*/
- update(identityData: identityData, callbacks?: { success(user: KiiUser): any; failure(user: KiiUser, errorString: string): any; }, userFields?: any, removeFields?: string[]): Promise;
+ update(
+ identityData: identityData,
+ callbacks?: { success(user: KiiUser): any; failure(user: KiiUser, errorString: string): any; },
+ userFields?: any,
+ removeFields?: string[]
+ ): Promise;
/**
* Update a user's password on the server
@@ -7083,12 +7715,17 @@ declare namespace KiiCloud {
* }
* );
*/
- updatePassword(fromPassword: string, toPassword: string, callbacks?: { success(theUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise;
+ updatePassword(
+ fromPassword: string,
+ toPassword: string,
+ callbacks?: { success(theUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }
+ ): Promise;
/**
* Reset a user's password on the server
*
- *
Reset a user's password on the server. The user is determined by the specified userIdentifier - which is an email address that has already been associated with an account. Reset instructions will be sent to that identifier.
+ *
Reset a user's password on the server. The user is determined by the specified userIdentifier - which is an email address that has already been associated with an account. Reset
+ * instructions will be sent to that identifier.
*
Please Note: This will reset the user's access token, so if they are currently logged in - their session will no longer be valid.
*
* @param userIdentifier The user's email address
@@ -7126,7 +7763,10 @@ declare namespace KiiCloud {
* }
* );
*/
- static resetPassword(userIdentifier: string, callbacks?: { success(): any; failure(anErrorString: string): any; }): Promise;
+ static resetPassword(
+ userIdentifier: string,
+ callbacks?: { success(): any; failure(anErrorString: string): any; }
+ ): Promise;
/**
* Reset the password of user
@@ -7136,7 +7776,12 @@ declare namespace KiiCloud {
* @param userIdentifier should be valid email address,
* global phone number or user identifier obtained by {@link #getID}.
* @param notificationMethod specify the destination of message include link
- * of resetting password. must be "EMAIL" or "SMS".
+ * of resetting password. must one of "EMAIL", "SMS" or "SMS_PIN".
+ * - "EMAIL": Send email include link URL to reset password or password.
+ * (Contents are depends on 'Password Reset Flow' setting in app's
+ * Security settings.)
+ * - "SMS" : Send SMS include link URL to reset password.
+ * - "SMS_PIN" : Send SMS include PIN Code for reset password.
* different type of identifier and destination can be used
* as long as user have verified email, phone.
* (ex. User registers both email and phone. Identifier is email and
@@ -7174,7 +7819,65 @@ declare namespace KiiCloud {
* }
* );
*/
- static resetPasswordWithNotificationMethod(userIdentifier: string, notificationMethod: string, callbacks?: { success(): any; failure(errString: string): any; }): Promise;
+ static resetPasswordWithNotificationMethod(
+ userIdentifier: string,
+ notificationMethod: string,
+ callbacks?: { success(): any; failure(errString: string): any; }
+ ): Promise;
+
+ /**
+ * Reset password with the PIN code in receipt SMS
+ * After {@link KiiUser.resetPasswordWithNotificationMethod} is called with
+ * "SMS_PIN", SMS includes the PIN code will be sent to the user's phone.
+ * User can request the new password for login with the PIN code.
+ * Need to call method for authentication after the new password is determined.
+ *
+ * @param userIdentifier should be valid email address,
+ * global phone number or user identifier obtained by {@link #getID}.
+ * @param pinCode Received PIN code.
+ * @param newPassword New password for login.
+ * If the 'Password Reset Flow' in app's security setting is set to
+ * 'Generate password', it would be ignored and null can be passed.
+ * In this case, new password is generated on Kii Cloud and sent to user's
+ * phone. Otherwise valid password is required.
+ * @param callbacks object includes callback functions.
+ *
+ * @return return promise object.
+ *
+ * - fulfill callback function: function(). No parameter used.
+ * - reject callback function: function(error). error is an Error instance.
+ *
+ *
+ *
+ *
+ * @example
+ * // Example using callback
+ * KiiUser.completeResetPassword("john.doe@kii.com", "new-password", "223789",
+ * {
+ * success: function() {
+ * // Succeeded.
+ * },
+ * failure: function(error) {
+ * // Handle error here.
+ * }
+ * });
+ *
+ * // Example using Promise
+ * KiiUser.completeResetPassword(
+ * "john.doe@kii.com", "new-password", "223789").then(function() {
+ * // Succeeded.
+ * }).catch(function(error) {
+ * // Handle error here.
+ * });
+ */
+ static completeResetPassword(
+ userIdentifier: string,
+ pinCode: string,
+ newPassword?: string,
+ callbacks?: { success(): any; failure(error: Error): any; }
+ ): Promise;
/**
* Verify the current user's phone number
@@ -7230,7 +7933,10 @@ declare namespace KiiCloud {
* }
* );
*/
- verifyPhoneNumber(verificationCode: string, callbacks?: { success(theUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise;
+ verifyPhoneNumber(
+ verificationCode: string,
+ callbacks?: { success(theUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }
+ ): Promise;
/**
* Resend the email verification code to the user
@@ -7274,7 +7980,9 @@ declare namespace KiiCloud {
* }
* );
*/
- resendEmailVerification(callbacks?: { success(theUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise;
+ resendEmailVerification(
+ callbacks?: { success(theUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }
+ ): Promise;
/**
* Resend the SMS verification code to the user
@@ -7318,7 +8026,9 @@ declare namespace KiiCloud {
* }
* );
*/
- resendPhoneNumberVerification(callbacks?: { success(theUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise;
+ resendPhoneNumberVerification(
+ callbacks?: { success(theUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }
+ ): Promise;
/**
* Retrieve a list of groups which the user is a member of
@@ -7373,7 +8083,9 @@ declare namespace KiiCloud {
* }
* );
*/
- memberOfGroups(callbacks?: { success(theUser: KiiUser, groupList: KiiGroup[]): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise<[KiiUser, KiiGroup[]]>;
+ memberOfGroups(
+ callbacks?: { success(theUser: KiiUser, groupList: KiiGroup[]): any; failure(theUser: KiiUser, anErrorString: string): any; }
+ ): Promise<[KiiUser, KiiGroup[]]>;
/**
* Retrieve the groups owned by this user. Group in the groupList
@@ -7430,7 +8142,9 @@ declare namespace KiiCloud {
* }
* );
*/
- ownerOfGroups(callbacks?: { success(theUser: KiiUser, groupList: KiiGroup[]): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise<[KiiUser, KiiGroup[]]>;
+ ownerOfGroups(
+ callbacks?: { success(theUser: KiiUser, groupList: KiiGroup[]): any; failure(theUser: KiiUser, anErrorString: string): any; }
+ ): Promise<[KiiUser, KiiGroup[]]>;
/**
* Change phone number of logged in user.
@@ -7478,7 +8192,10 @@ declare namespace KiiCloud {
* }
* );
*/
- changePhone(newPhoneNumber: string, callbacks?: { success(theUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise;
+ changePhone(
+ newPhoneNumber: string,
+ callbacks?: { success(theUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }
+ ): Promise;
/**
* Change email of logged in user.
@@ -7526,7 +8243,10 @@ declare namespace KiiCloud {
* }
* );
*/
- changeEmail(newEmail: string, callbacks?: { success(theUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise;
+ changeEmail(
+ newEmail: string,
+ callbacks?: { success(theUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }
+ ): Promise;
/**
* Saves the latest user values to the server
@@ -7570,7 +8290,9 @@ declare namespace KiiCloud {
* }
* );
*/
- save(callbacks?: { success(theSavedUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise;
+ save(
+ callbacks?: { success(theSavedUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }
+ ): Promise;
/**
* Updates the local user's data with the user data on the server
@@ -7614,7 +8336,9 @@ declare namespace KiiCloud {
* }
* );
*/
- refresh(callbacks?: { success(theRefreshedUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise;
+ refresh(
+ callbacks?: { success(theRefreshedUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }
+ ): Promise;
/**
* Delete the user from the server
@@ -7656,7 +8380,9 @@ declare namespace KiiCloud {
* }
* );
*/
- delete(callbacks?: { success(theDeletedUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }): Promise;
+ delete(
+ callbacks?: { success(theDeletedUser: KiiUser): any; failure(theUser: KiiUser, anErrorString: string): any; }
+ ): Promise;
/**
* Logs the currently logged-in user out of the KiiSDK
@@ -7723,7 +8449,10 @@ declare namespace KiiCloud {
* }
* );
*/
- static findUserByEmail(email: string, callbacks?: { success(theMatchedUser: KiiUser): any; failure(anErrorString: string): any; }): Promise;
+ static findUserByEmail(
+ email: string,
+ callbacks?: { success(theMatchedUser: KiiUser): any; failure(anErrorString: string): any; }
+ ): Promise;
/**
* Find registered KiiUser with the phone.
@@ -7772,7 +8501,10 @@ declare namespace KiiCloud {
* }
* );
*/
- static findUserByPhone(phone: string, callbacks?: { success(theMatchedUser: KiiUser): any; failure(anErrorString: string): any; }): Promise;
+ static findUserByPhone(
+ phone: string,
+ callbacks?: { success(theMatchedUser: KiiUser): any; failure(anErrorString: string): any; }
+ ): Promise;
/**
* Find registered KiiUser with the user name.
@@ -7820,7 +8552,10 @@ declare namespace KiiCloud {
* }
* );
*/
- static findUserByUsername(username: string, callbacks?: { success(theMatchedUser: KiiUser): any; failure(anErrorString: string): any; }): Promise;
+ static findUserByUsername(
+ username: string,
+ callbacks?: { success(theMatchedUser: KiiUser): any; failure(anErrorString: string): any; }
+ ): Promise;
/**
* Instantiate topic belongs to this user.
@@ -7829,13 +8564,16 @@ declare namespace KiiCloud {
*
* @return topic instance.
*/
- topicWithName(topicName: string): KiiTopic;
+ topicWithName(
+ topicName: string
+ ): KiiTopic;
/**
* Gets a list of topics in this user scope
*
* @param callbacks An object with callback methods defined
- * @param paginationKey You can specify the pagination key with the nextPaginationKey passed by callbacks.success. If empty string or no string object is provided, this API regards no paginationKey specified.
+ * @param paginationKey You can specify the pagination key with the nextPaginationKey passed by callbacks.success. If empty string or no string object is provided, this API regards no
+ * paginationKey specified.
*
* @return return promise object.
*
@@ -7896,7 +8634,10 @@ declare namespace KiiCloud {
* }
* );
*/
- listTopics(callbacks?: { success(topicList: KiiTopic[], nextPaginationKey: string): any; failure(anErrorString: string): any; }, paginationKey?: string): Promise<[KiiTopic[], string]>;
+ listTopics(
+ callbacks?: { success(topicList: KiiTopic[], nextPaginationKey: string): any; failure(anErrorString: string): any; },
+ paginationKey?: string
+ ): Promise<[KiiTopic[], string]>;
/**
* Instantiate push subscription for this user.
@@ -7943,7 +8684,10 @@ declare namespace KiiCloud {
* @throws If the password is not in the
* proper format
*/
- static builderWithIdentifier(identifier: string, password: string): KiiUserBuilder;
+ static builderWithIdentifier(
+ identifier: string,
+ password: string
+ ): KiiUserBuilder;
/**
* Create KiiUser builder with email address
@@ -7960,7 +8704,10 @@ declare namespace KiiCloud {
* @throws If the password is not in the
* proper format
*/
- static builderWithEmailAddress(emailAddress: string, password: string): KiiUserBuilder;
+ static builderWithEmailAddress(
+ emailAddress: string,
+ password: string
+ ): KiiUserBuilder;
/**
* Create KiiUser builder with global phone number
@@ -7974,7 +8721,10 @@ declare namespace KiiCloud {
*
* @throws If the phone number is not in the proper format
*/
- static builderWithGlobalPhoneNumber(phoneNumber: string, password: string): KiiUserBuilder;
+ static builderWithGlobalPhoneNumber(
+ phoneNumber: string,
+ password: string
+ ): KiiUserBuilder;
/**
* Create KiiUser builder with local phone number
@@ -7993,7 +8743,11 @@ declare namespace KiiCloud {
* @throws If the password is not in the
* proper format
*/
- static builderWithLocalPhoneNumber(phoneNumber: string, country: string, password: string): KiiUserBuilder;
+ static builderWithLocalPhoneNumber(
+ phoneNumber: string,
+ country: string,
+ password: string
+ ): KiiUserBuilder;
/**
* Create KiiUser builder with user name
@@ -8010,7 +8764,10 @@ declare namespace KiiCloud {
* @throws If the password is not in the
* proper format
*/
- static builderWithUsername(username: string, password: string): KiiUserBuilder;
+ static builderWithUsername(
+ username: string,
+ password: string
+ ): KiiUserBuilder;
/**
* Set user name.
@@ -8025,7 +8782,9 @@ declare namespace KiiCloud {
* @throws If the username is not in the
* proper format
*/
- setUsername(username: string): KiiUserBuilder;
+ setUsername(
+ username: string
+ ): KiiUserBuilder;
/**
* Set email address.
@@ -8040,7 +8799,9 @@ declare namespace KiiCloud {
* @throws If the email address is not in the
* proper format
*/
- setEmailAddress(emailAddress: string): KiiUserBuilder;
+ setEmailAddress(
+ emailAddress: string
+ ): KiiUserBuilder;
/**
* Set global phone number.
@@ -8055,7 +8816,9 @@ declare namespace KiiCloud {
* @throws If the phone number is not
* in the proper format
*/
- setGlobalPhoneNumber(phoneNumber: string): KiiUserBuilder;
+ setGlobalPhoneNumber(
+ phoneNumber: string
+ ): KiiUserBuilder;
/**
* Set local phone number.
@@ -8072,7 +8835,10 @@ declare namespace KiiCloud {
* in the proper format
* @throws If the country code is not a valid format
*/
- setLocalPhoneNumber(phoneNumber: string, country: string): KiiUserBuilder;
+ setLocalPhoneNumber(
+ phoneNumber: string,
+ country: string
+ ): KiiUserBuilder;
/**
* Build KiiUser object.
@@ -8098,6 +8864,7 @@ import KiiAnyAuthenticatedUser = KiiCloud.KiiAnyAuthenticatedUser;
import KiiAppAdminContext = KiiCloud.KiiAppAdminContext;
import KiiBucket = KiiCloud.KiiBucket;
import KiiClause = KiiCloud.KiiClause;
+import KiiErrorParser = KiiCloud.KiiErrorParser;
import KiiGeoPoint = KiiCloud.KiiGeoPoint;
import KiiGroup = KiiCloud.KiiGroup;
import KiiObject = KiiCloud.KiiObject;
diff --git a/kii-cloud-sdk/kii-cloud-sdk-tests.ts b/kii-cloud-sdk/kii-cloud-sdk-tests.ts
index 97f4d40512..40abd1e8d4 100644
--- a/kii-cloud-sdk/kii-cloud-sdk-tests.ts
+++ b/kii-cloud-sdk/kii-cloud-sdk-tests.ts
@@ -18,11 +18,11 @@ function main() {
});
user.register()
- .then(function (user: KiiUser) {
+ .then((user: KiiUser) => {
});
user.pushInstallation().getMqttEndpoint("")
- .then(function (endpoint: KiiCloud.KiiMqttEndpoint) {
+ .then((endpoint: KiiCloud.KiiMqttEndpoint) => {
endpoint.installationID;
});
@@ -41,16 +41,16 @@ function main() {
var query = KiiQuery.queryWithClause(clause3);
bucket.executeQuery(query, {
- success: function (query: KiiQuery,
- results: KiiObject[],
- nextQuery: KiiQuery) {
+ success: (query: KiiQuery,
+ results: KiiObject[],
+ nextQuery: KiiQuery) => {
},
- failure: function (bucket: KiiBucket, message: string) {
+ failure: (bucket: KiiBucket, message: string) => {
}
});
bucket.executeQuery(query)
- .then(function (params: [KiiQuery, KiiObject[], KiiQuery]) {
+ .then((params: [KiiQuery, KiiObject[], KiiQuery]) => {
var [query, results, nextQuery] = params;
});
@@ -61,39 +61,43 @@ function main() {
object.save();
KiiGroup.registerGroupWithID("Group ID", "Group Name", [user], {
- success: function(theSavedGroup: KiiGroup) {
+ success: (theSavedGroup: KiiGroup) => {
theSavedGroup.saveWithOwner("user ID");
},
- failure: function(theGroup: KiiGroup,
- anErrorString: String,
- addMembersArray: KiiUser[],
- removeMembersArray: KiiUser[]) {
+ failure: (theGroup: KiiGroup,
+ anErrorString: string,
+ addMembersArray: KiiUser[],
+ removeMembersArray: KiiUser[]) => {
}
});
Kii.authenticateAsThing("thing id", "password", {
- success: function (thingAuthContext: KiiThingContext) {
+ success: (thingAuthContext: KiiThingContext) => {
thingAuthContext.bucketWithName("");
},
- failure: function (error) {
+ failure: (error) => {
}
})
- .then(function (thingAuthContext: KiiThingContext) {
+ .then((thingAuthContext: KiiThingContext) => {
});
Kii.authenticateAsThingWithToken("thing id", "token", {
- success: function (thingAuthContext: KiiThingContext) {
+ success: (thingAuthContext: KiiThingContext) => {
thingAuthContext.bucketWithName("");
},
- failure: function (error) {
+ failure: (error) => {
}
})
- .then(function (thingAuthContext: KiiThingContext) {
+ .then((thingAuthContext: KiiThingContext) => {
});
KiiThing.loadWithVendorThingID("thing ID")
- .then(function (thing) {
+ .then((thing) => {
var isOnline: boolean = thing.isOnline();
var onlineStatusModifiedAt: Date = thing.getOnlineStatusModifiedAt();
});
+
+ var error = KiiErrorParser.parse("");
+
+ error.code.toLowerCase();
}
diff --git a/kii-cloud-sdk/tslint.json b/kii-cloud-sdk/tslint.json
new file mode 100644
index 0000000000..ad51895c20
--- /dev/null
+++ b/kii-cloud-sdk/tslint.json
@@ -0,0 +1,6 @@
+{
+ "extends": "../tslint.json",
+ "rules": {
+ "dt-header": false
+ }
+}