@@ -84,8 +84,8 @@ MemoryProperties.prototype.setProperty = function(key, value) {
84
84
* required setup.
85
85
*/
86
86
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 ".
89
89
90
90
91
91
/**
@@ -102,13 +102,13 @@ function createService(serviceName) {
102
102
/**
103
103
* Returns the callback URL that will be used for a given script. Often this URL
104
104
* 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".
107
107
* @return {string } The callback URL.
108
108
*/
109
- function getCallbackUrl ( projectKey ) {
109
+ function getCallbackUrl ( scriptId ) {
110
110
return Utilities . formatString (
111
- 'https://script.google.com/macros/d/%s/usercallback' , projectKey ) ;
111
+ 'https://script.google.com/macros/d/%s/usercallback' , scriptId ) ;
112
112
}
113
113
114
114
if ( module ) {
@@ -153,7 +153,7 @@ var Service_ = function(serviceName) {
153
153
this . paramLocation_ = 'auth-header' ;
154
154
this . method_ = 'get' ;
155
155
this . oauthVersion_ = '1.0a' ;
156
- this . projectKey_ = eval ( 'Script' + 'App' ) . getProjectKey ( ) ;
156
+ this . scriptId_ = eval ( 'Script' + 'App' ) . getScriptId ( ) ;
157
157
this . signatureMethod_ = 'HMAC-SHA1' ;
158
158
this . propertyStore_ = new MemoryProperties ( ) ;
159
159
} ;
@@ -244,16 +244,16 @@ Service_.prototype.setOAuthVersion = function(oauthVersion) {
244
244
} ;
245
245
246
246
/**
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
249
249
* 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.
252
252
* @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.
254
254
*/
255
- Service_ . prototype . setProjectKey = function ( projectKey ) {
256
- this . projectKey_ = projectKey ;
255
+ Service_ . prototype . setScriptId = function ( scriptId ) {
256
+ this . scriptId_ = scriptId ;
257
257
return this ;
258
258
} ;
259
259
@@ -343,7 +343,7 @@ Service_.prototype.setAccessToken = function(token, secret) {
343
343
* Starts the authorization process. A new token will be generated and the
344
344
* authorization URL for that token will be returned. Have the user visit this
345
345
* 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
347
347
* specified, so that the flow may continue.
348
348
* @returns {string } The authorization URL for a new token.
349
349
*/
@@ -359,7 +359,7 @@ Service_.prototype.authorize = function() {
359
359
oauth_token : token . public
360
360
} ;
361
361
if ( this . oauthVersion_ == '1.0' ) {
362
- oauthParams . oauth_callback = this . getCallbackUrl_ ( ) ;
362
+ oauthParams . oauth_callback = this . getCallbackUrl ( ) ;
363
363
}
364
364
return buildUrl_ ( this . authorizationUrl_ , oauthParams ) ;
365
365
} ;
@@ -446,7 +446,7 @@ Service_.prototype.getRequestToken_ = function() {
446
446
} ;
447
447
var oauthParams = { } ;
448
448
if ( this . oauthVersion_ == '1.0a' ) {
449
- oauthParams . oauth_callback = this . getCallbackUrl_ ( ) ;
449
+ oauthParams . oauth_callback = this . getCallbackUrl ( ) ;
450
450
}
451
451
452
452
var response = this . fetchInternal_ ( url , params , null , oauthParams ) ;
@@ -637,20 +637,19 @@ Service_.prototype.getPropertyKey_ = function() {
637
637
/**
638
638
* Gets a callback URL to use for the OAuth flow.
639
639
* @return {string } A callback URL.
640
- * @private
641
640
*/
642
- Service_ . prototype . getCallbackUrl_ = function ( ) {
641
+ Service_ . prototype . getCallbackUrl = function ( ) {
643
642
validate_ ( {
644
643
'Callback Function Name' : this . callbackFunctionName_ ,
645
644
'Service Name' : this . serviceName_ ,
646
- 'Project Key ' : this . projectKey_
645
+ 'Script ID ' : this . scriptId_
647
646
} ) ;
648
647
var stateToken = eval ( 'Script' + 'App' ) . newStateToken ( )
649
648
. withMethod ( this . callbackFunctionName_ )
650
649
. withArgument ( 'serviceName' , this . serviceName_ )
651
650
. withTimeout ( 3600 )
652
651
. createToken ( ) ;
653
- return buildUrl_ ( getCallbackUrl ( this . projectKey_ ) , {
652
+ return buildUrl_ ( getCallbackUrl ( this . scriptId_ ) , {
654
653
state : stateToken
655
654
} ) ;
656
655
} ;
0 commit comments