@@ -84,8 +84,8 @@ MemoryProperties.prototype.setProperty = function(key, value) {
8484 * required setup.
8585 */
8686
87- // Load the Underscore.js library. This library was added using the project
88- // key "MGwgKN2Th03tJ5OdmlzB8KPxhMjh3Sh48 ".
87+ // Load the Underscore.js library. This library was added using the script ID
88+ // "1I21uLOwDKdyF3_W_hvh6WXiIKWJWno8yG9lB8lf1VBnZFQ6jAAhyNTRG ".
8989
9090
9191/**
@@ -102,13 +102,13 @@ function createService(serviceName) {
102102/**
103103 * Returns the callback URL that will be used for a given script. Often this URL
104104 * needs to be entered into a configuration screen of your OAuth provider.
105- * @param {string } projectKey The project key of your script, which can be found
106- * in the Script Editor UI under "File > Project properties".
105+ * @param {string } scriptId The ID of your script, which can be found in the
106+ * Script Editor UI under "File > Project properties".
107107 * @return {string } The callback URL.
108108 */
109- function getCallbackUrl ( projectKey ) {
109+ function getCallbackUrl ( scriptId ) {
110110 return Utilities . formatString (
111- 'https://script.google.com/macros/d/%s/usercallback' , projectKey ) ;
111+ 'https://script.google.com/macros/d/%s/usercallback' , scriptId ) ;
112112}
113113
114114if ( module ) {
@@ -153,7 +153,7 @@ var Service_ = function(serviceName) {
153153 this . paramLocation_ = 'auth-header' ;
154154 this . method_ = 'get' ;
155155 this . oauthVersion_ = '1.0a' ;
156- this . projectKey_ = eval ( 'Script' + 'App' ) . getProjectKey ( ) ;
156+ this . scriptId_ = eval ( 'Script' + 'App' ) . getScriptId ( ) ;
157157 this . signatureMethod_ = 'HMAC-SHA1' ;
158158 this . propertyStore_ = new MemoryProperties ( ) ;
159159} ;
@@ -244,16 +244,16 @@ Service_.prototype.setOAuthVersion = function(oauthVersion) {
244244} ;
245245
246246/**
247- * Sets the project key of the script that contains the authorization callback
248- * function (required). The project key can be found in the Script Editor UI
247+ * Sets the ID of the script that contains the authorization callback
248+ * function (required). The script ID can be found in the Script Editor UI
249249 * under "File > Project properties".
250- * @param {string } projectKey The project key of the project containing the
251- * callback function.
250+ * @param {string } scriptId The ID of the script containing the callback
251+ * function.
252252 * @return {Service_ } This service, for chaining.
253- * @deprecated The project key is now be determined automatically.
253+ * @deprecated The script ID is now be determined automatically.
254254 */
255- Service_ . prototype . setProjectKey = function ( projectKey ) {
256- this . projectKey_ = projectKey ;
255+ Service_ . prototype . setScriptId = function ( scriptId ) {
256+ this . scriptId_ = scriptId ;
257257 return this ;
258258} ;
259259
@@ -343,7 +343,7 @@ Service_.prototype.setAccessToken = function(token, secret) {
343343 * Starts the authorization process. A new token will be generated and the
344344 * authorization URL for that token will be returned. Have the user visit this
345345 * URL and approve the authorization request. The user will then be redirected
346- * back to your application using the project key and callback function name
346+ * back to your application using the script ID and callback function name
347347 * specified, so that the flow may continue.
348348 * @returns {string } The authorization URL for a new token.
349349 */
@@ -359,7 +359,7 @@ Service_.prototype.authorize = function() {
359359 oauth_token : token . public
360360 } ;
361361 if ( this . oauthVersion_ == '1.0' ) {
362- oauthParams . oauth_callback = this . getCallbackUrl_ ( ) ;
362+ oauthParams . oauth_callback = this . getCallbackUrl ( ) ;
363363 }
364364 return buildUrl_ ( this . authorizationUrl_ , oauthParams ) ;
365365} ;
@@ -446,7 +446,7 @@ Service_.prototype.getRequestToken_ = function() {
446446 } ;
447447 var oauthParams = { } ;
448448 if ( this . oauthVersion_ == '1.0a' ) {
449- oauthParams . oauth_callback = this . getCallbackUrl_ ( ) ;
449+ oauthParams . oauth_callback = this . getCallbackUrl ( ) ;
450450 }
451451
452452 var response = this . fetchInternal_ ( url , params , null , oauthParams ) ;
@@ -637,20 +637,19 @@ Service_.prototype.getPropertyKey_ = function() {
637637/**
638638 * Gets a callback URL to use for the OAuth flow.
639639 * @return {string } A callback URL.
640- * @private
641640 */
642- Service_ . prototype . getCallbackUrl_ = function ( ) {
641+ Service_ . prototype . getCallbackUrl = function ( ) {
643642 validate_ ( {
644643 'Callback Function Name' : this . callbackFunctionName_ ,
645644 'Service Name' : this . serviceName_ ,
646- 'Project Key ' : this . projectKey_
645+ 'Script ID ' : this . scriptId_
647646 } ) ;
648647 var stateToken = eval ( 'Script' + 'App' ) . newStateToken ( )
649648 . withMethod ( this . callbackFunctionName_ )
650649 . withArgument ( 'serviceName' , this . serviceName_ )
651650 . withTimeout ( 3600 )
652651 . createToken ( ) ;
653- return buildUrl_ ( getCallbackUrl ( this . projectKey_ ) , {
652+ return buildUrl_ ( getCallbackUrl ( this . scriptId_ ) , {
654653 state : stateToken
655654 } ) ;
656655} ;
0 commit comments