@salesforce/lds-adapters-platform-named-credential 0.1.0-dev1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/platform-named-credential.js +1545 -0
  3. package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
  4. package/dist/es/es2018/types/src/generated/adapters/createCredential.d.ts +17 -0
  5. package/dist/es/es2018/types/src/generated/adapters/deleteCredential.d.ts +16 -0
  6. package/dist/es/es2018/types/src/generated/adapters/getCredential.d.ts +29 -0
  7. package/dist/es/es2018/types/src/generated/adapters/getExternalCredentials.d.ts +26 -0
  8. package/dist/es/es2018/types/src/generated/adapters/getOAuthCredentialAuthUrl.d.ts +16 -0
  9. package/dist/es/es2018/types/src/generated/adapters/updateCredential.d.ts +16 -0
  10. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +6 -0
  11. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +9 -0
  12. package/dist/es/es2018/types/src/generated/resources/deleteNamedCredentialsCredential.d.ts +14 -0
  13. package/dist/es/es2018/types/src/generated/resources/getNamedCredentialsCredential.d.ts +17 -0
  14. package/dist/es/es2018/types/src/generated/resources/getNamedCredentialsExternalCredentials.d.ts +12 -0
  15. package/dist/es/es2018/types/src/generated/resources/getNamedCredentialsExternalCredentialsByDeveloperName.d.ts +15 -0
  16. package/dist/es/es2018/types/src/generated/resources/postNamedCredentialsCredential.d.ts +16 -0
  17. package/dist/es/es2018/types/src/generated/resources/postNamedCredentialsCredentialAuthUrlOAuth.d.ts +13 -0
  18. package/dist/es/es2018/types/src/generated/resources/putNamedCredentialsCredential.d.ts +13 -0
  19. package/dist/es/es2018/types/src/generated/types/CredentialInputRepresentation.d.ts +47 -0
  20. package/dist/es/es2018/types/src/generated/types/CredentialInputRepresentationWrapper.d.ts +29 -0
  21. package/dist/es/es2018/types/src/generated/types/CredentialMapRepresentation.d.ts +32 -0
  22. package/dist/es/es2018/types/src/generated/types/CredentialRepresentation.d.ts +67 -0
  23. package/dist/es/es2018/types/src/generated/types/CredentialValueRepresentation.d.ts +34 -0
  24. package/dist/es/es2018/types/src/generated/types/ExternalCredentialListRepresentation.d.ts +38 -0
  25. package/dist/es/es2018/types/src/generated/types/ExternalCredentialPrincipalRepresentation.d.ts +34 -0
  26. package/dist/es/es2018/types/src/generated/types/ExternalCredentialRepresentation.d.ts +54 -0
  27. package/dist/es/es2018/types/src/generated/types/NamedCredentialRepresentation.d.ts +31 -0
  28. package/dist/es/es2018/types/src/generated/types/OAuthCredentialAuthUrlInputRepresentation.d.ts +37 -0
  29. package/dist/es/es2018/types/src/generated/types/OAuthCredentialAuthUrlInputRepresentationWrapper.d.ts +29 -0
  30. package/dist/es/es2018/types/src/generated/types/OAuthCredentialAuthUrlRepresentation.d.ts +46 -0
  31. package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
  32. package/package.json +76 -0
  33. package/sfdc/index.d.ts +1 -0
  34. package/sfdc/index.js +1605 -0
  35. package/src/raml/api.raml +406 -0
  36. package/src/raml/luvio.raml +53 -0
@@ -0,0 +1,406 @@
1
+ #%RAML 1.0
2
+ securedBy:
3
+ - OAuth2
4
+ title: Salesforce Connect API
5
+ version: '60.0'
6
+ mediaType: application/json
7
+ protocols:
8
+ - https
9
+ baseUri: /services/data/v66.0
10
+ securitySchemes:
11
+ OAuth2:
12
+ type: OAuth 2.0
13
+ settings:
14
+ authorizationUri: https://example.com/oauth/authorize
15
+ accessTokenUri: ''
16
+ authorizationGrants:
17
+ - implicit
18
+ annotationTypes:
19
+ oas-readOnly:
20
+ type: boolean
21
+ allowedTargets: TypeDeclaration
22
+ oas-collectionFormat:
23
+ type: string
24
+ oas-body-name:
25
+ type: string
26
+ allowedTargets: TypeDeclaration
27
+ types:
28
+ CredentialInputRepresentation:
29
+ description: Credential input representation
30
+ type: object
31
+ properties:
32
+ authenticationProtocol:
33
+ description: Authentication protocol of the external credential. This field
34
+ is optional. However if present it must match the actual protocol of the
35
+ External Credential.
36
+ type: string
37
+ required: false
38
+ enum:
39
+ - AwsSv4
40
+ - Basic
41
+ - Custom
42
+ - Jwt
43
+ - OAuth
44
+ authenticationProtocolVariant:
45
+ description: Authentication protocol variant of the external credential. This
46
+ field is optional. However if present it must match the actual protocol
47
+ variant of the External Credential.
48
+ type: string
49
+ required: false
50
+ enum:
51
+ - AwsSv4_STS
52
+ - ClientCredentialsClientSecret
53
+ - ClientCredentialsClientSecretBasic
54
+ - ClientCredentialsJwtAssertion
55
+ - JwtBearer
56
+ - NoAuthentication
57
+ - RolesAnywhere
58
+ credentials:
59
+ description: Protocol specific credentials
60
+ type: object
61
+ properties:
62
+ //:
63
+ type: object
64
+ externalCredential:
65
+ description: External Credential DeveloperName
66
+ type: string
67
+ principalName:
68
+ description: Principal Name of principals
69
+ type: string
70
+ principalType:
71
+ description: Principal Type of principals. Allowed values are NamedPrincipal,
72
+ PerUserPrincipal, or AwsStsPrincipal
73
+ type: string
74
+ enum:
75
+ - AwsStsPrincipal
76
+ - NamedPrincipal
77
+ - PerUserPrincipal
78
+ CredentialMapRepresentation:
79
+ description: credentials map wrapper used in CredentialInputRepresentation
80
+ type: object
81
+ properties:
82
+ map:
83
+ description: wrapped credentials map
84
+ type: object
85
+ properties:
86
+ //:
87
+ type: object
88
+ CredentialRepresentation:
89
+ description: Output representation for Credential
90
+ type: object
91
+ properties:
92
+ authenticationProtocol:
93
+ description: Authentication protocol of the external credential
94
+ type: string
95
+ required: false
96
+ enum:
97
+ - AwsSv4
98
+ - Basic
99
+ - Custom
100
+ - Jwt
101
+ - OAuth
102
+ authenticationProtocolVariant:
103
+ description: Authentication protocol variant of the external credential
104
+ type: string
105
+ required: false
106
+ enum:
107
+ - AwsSv4_STS
108
+ - ClientCredentialsClientSecret
109
+ - ClientCredentialsClientSecretBasic
110
+ - ClientCredentialsJwtAssertion
111
+ - JwtBearer
112
+ - NoAuthentication
113
+ - RolesAnywhere
114
+ authenticationStatus:
115
+ description: Authentication Status. It's authenticated if external credential
116
+ has all required credentials for this principal
117
+ type: string
118
+ enum:
119
+ - Configured
120
+ - NotConfigured
121
+ - Unknown
122
+ credentials:
123
+ description: Protocol specific credentials
124
+ type: object
125
+ properties:
126
+ //:
127
+ type: CredentialValueRepresentation
128
+ externalCredential:
129
+ description: External credential developer name
130
+ type: string
131
+ principalName:
132
+ description: Principal parameter name associated with these credentials
133
+ type: string | nil
134
+ principalType:
135
+ description: Principal Type. It's either NamedPrincipal or PerUserPrincipal
136
+ type: string
137
+ enum:
138
+ - AwsStsPrincipal
139
+ - NamedPrincipal
140
+ - PerUserPrincipal
141
+ # TODO Hand-Rolled due to issue #28 in Generated RAML Gaps (https://salesforce.quip.com/NxVhAkxL6RTW#dGQACAMmFgP)
142
+ CredentialInputRepresentationWrapper:
143
+ description: Wrapper for CredentialInputRepresentation
144
+ type: object
145
+ properties:
146
+ requestBody:
147
+ type: CredentialInputRepresentation
148
+ description: Input representation to create or update credential
149
+ CredentialValueRepresentation:
150
+ description: Credential Value output representation for Credential
151
+ type: object
152
+ properties:
153
+ encrypted:
154
+ description: Credential value is encrypted
155
+ type: boolean
156
+ revision:
157
+ description: Revision number of the credential
158
+ type: integer | nil
159
+ required: false
160
+ value:
161
+ description: Value of the credential if not encrypted
162
+ type: string | nil
163
+ required: false
164
+ ExternalCredentialListRepresentation:
165
+ description: Output representation for External Credential List
166
+ type: object
167
+ properties:
168
+ externalCredentials:
169
+ description: List of external credentials
170
+ type: array
171
+ items:
172
+ type: ExternalCredentialRepresentation
173
+ ExternalCredentialPrincipalRepresentation:
174
+ description: Output representation for an External Credential principal
175
+ type: object
176
+ properties:
177
+ authenticationStatus:
178
+ description: Authentication Status for credentials
179
+ type: string
180
+ enum:
181
+ - Authenticated
182
+ - NotAuthenticated
183
+ principalName:
184
+ description: Principal name
185
+ type: string | nil
186
+ principalType:
187
+ description: Principal Type. It's either NamedPrincipal or PerUser
188
+ type: string
189
+ enum:
190
+ - NamedPrincipal
191
+ - PerUserPrincipal
192
+ ExternalCredentialRepresentation:
193
+ description: Output representation for External Credential
194
+ type: object
195
+ properties:
196
+ authenticationProtocol:
197
+ description: Authentication protocol of the external credential
198
+ type: string
199
+ enum:
200
+ - AwsSv4
201
+ - OAuth
202
+ authenticationStatus:
203
+ description: Authentication Status. It's authenticated if external credential
204
+ has all required credentials for at least one principal
205
+ type: string
206
+ enum:
207
+ - Authenticated
208
+ - NotAuthenticated
209
+ developerName:
210
+ description: External Credential developer name
211
+ type: string
212
+ masterLabel:
213
+ description: External Credential master label
214
+ type: string
215
+ principals:
216
+ description: List of principals the credential has
217
+ type: array
218
+ items:
219
+ type: ExternalCredentialPrincipalRepresentation
220
+ relatedNamedCredentials:
221
+ description: List of named credentials associated to the external credential
222
+ type: array
223
+ items:
224
+ type: NamedCredentialRepresentation
225
+ NamedCredentialRepresentation:
226
+ description: Output representation for a named credential associated to an external
227
+ credential
228
+ type: object
229
+ properties:
230
+ developerName:
231
+ description: NamedCredential developer name
232
+ type: string
233
+ masterLabel:
234
+ description: NamedCredential master label
235
+ type: string
236
+ OAuthCredentialAuthUrlInputRepresentation:
237
+ description: OAuth authentication flow input representation
238
+ type: object
239
+ properties:
240
+ externalCredential:
241
+ description: External Credential DeveloperName
242
+ type: string
243
+ principalName:
244
+ description: Principal Name of principals
245
+ type: string
246
+ principalType:
247
+ description: Principal Type of principals. Allowed values are NamedPrincipal,
248
+ PerUserPrincipal, or GlobalNamedPrincipal
249
+ type: string
250
+ enum:
251
+ - NamedPrincipal
252
+ - PerUserPrincipal
253
+ - GlobalNamedPrincipal
254
+ returnUrl:
255
+ description: optional return url to be applied to the authentication url
256
+ required: false
257
+ type: string
258
+ OAuthCredentialAuthUrlRepresentation:
259
+ description: Output representation for OAuth authentication url for a User's Credential
260
+ type: object
261
+ properties:
262
+ authenticationUrl:
263
+ description: OAuth authentication url for a User's Credential
264
+ type: string
265
+ externalCredential:
266
+ description: External Credential DeveloperName
267
+ type: string
268
+ principalName:
269
+ description: Credential principal name
270
+ type: string
271
+ principalType:
272
+ description: Credential principal type. It's either NamedPrincipal,PerUserPrincipal,
273
+ or GlobalNamedPrincipal
274
+ type: string
275
+ enum:
276
+ - NamedPrincipal
277
+ - PerUserPrincipal
278
+ - GlobalNamedPrincipal
279
+ # TODO Hand-Rolled due to issue #28 in Generated RAML Gaps (https://salesforce.quip.com/NxVhAkxL6RTW#dGQACAMmFgP)
280
+ OAuthCredentialAuthUrlInputRepresentationWrapper:
281
+ description: Wrapper for OAuthCredentialAuthUrlInputRepresentation
282
+ type: object
283
+ properties:
284
+ requestBody:
285
+ type: OAuthCredentialAuthUrlInputRepresentation
286
+ description: Input representation to generate auth url
287
+ /named-credentials:
288
+ /credential:
289
+ delete:
290
+ description: DELETE method to delete a Credential
291
+ responses:
292
+ '200':
293
+ description: Success
294
+ queryParameters:
295
+ externalCredential:
296
+ type: string
297
+ required: false
298
+ principalName:
299
+ type: string
300
+ required: false
301
+ principalType:
302
+ type: string
303
+ required: false
304
+ enum:
305
+ - NamedPrincipal
306
+ - PerUserPrincipal
307
+ get:
308
+ description: GET method to get Credential records visible to the user
309
+ responses:
310
+ '200':
311
+ description: Success
312
+ body:
313
+ application/json:
314
+ type: CredentialRepresentation
315
+ queryParameters:
316
+ externalCredential:
317
+ type: string
318
+ required: false
319
+ principalName:
320
+ type: string
321
+ required: false
322
+ principalType:
323
+ type: string
324
+ required: false
325
+ enum:
326
+ - NamedPrincipal
327
+ - PerUserPrincipal
328
+ post:
329
+ displayName: postCredential
330
+ description: POST method to create a Credential
331
+ responses:
332
+ '200':
333
+ description: Success
334
+ body:
335
+ application/json:
336
+ type: CredentialRepresentation
337
+ queryParameters:
338
+ action:
339
+ type: string
340
+ required: false
341
+ enum:
342
+ - Refresh
343
+ body:
344
+ application/json:
345
+ type: CredentialInputRepresentationWrapper
346
+ # TODO Hand-Rolled due to issue #28 in Generated RAML Gaps (https://salesforce.quip.com/NxVhAkxL6RTW#dGQACAMmFgP)
347
+ # TODO: Hand-rolled W-8334626 due to issue #22 in Generated RAML Gaps (https://salesforce.quip.com/NxVhAkxL6RTW#dGQACAxyxIv)
348
+ # required: false
349
+ (oas-body-name): requestBody
350
+ put:
351
+ displayName: putCredential
352
+ description: PUT method to replace a Credential
353
+ responses:
354
+ '200':
355
+ description: Success
356
+ body:
357
+ application/json:
358
+ type: CredentialRepresentation
359
+ body:
360
+ application/json:
361
+ type: CredentialInputRepresentationWrapper
362
+ # TODO Hand-Rolled due to issue #28 in Generated RAML Gaps (https://salesforce.quip.com/NxVhAkxL6RTW#dGQACAMmFgP)
363
+ # TODO: Hand-rolled W-8334626 due to issue #22 in Generated RAML Gaps (https://salesforce.quip.com/NxVhAkxL6RTW#dGQACAxyxIv)
364
+ # required: false
365
+ (oas-body-name): requestBody
366
+ /credential/auth-url/o-auth:
367
+ post:
368
+ description: POST method to get the OAuth authentication url for a User External
369
+ Credential
370
+ responses:
371
+ '200':
372
+ description: Success
373
+ body:
374
+ application/json:
375
+ type: OAuthCredentialAuthUrlRepresentation
376
+ body:
377
+ application/json:
378
+ type: OAuthCredentialAuthUrlInputRepresentationWrapper
379
+ # TODO Hand-Rolled due to issue #28 in Generated RAML Gaps (https://salesforce.quip.com/NxVhAkxL6RTW#dGQACAMmFgP)
380
+ # TODO: Hand-rolled W-8334626 due to issue #22 in Generated RAML Gaps (https://salesforce.quip.com/NxVhAkxL6RTW#dGQACAxyxIv)
381
+ # required: false
382
+ (oas-body-name): requestBody
383
+ /external-credentials:
384
+ get:
385
+ description: GET method to get a list of External Credential records the user
386
+ can authenticate to
387
+ responses:
388
+ '200':
389
+ description: Success
390
+ body:
391
+ application/json:
392
+ type: ExternalCredentialListRepresentation
393
+ /external-credentials/{developerName}:
394
+ get:
395
+ description: GET method to get basic information about External Credential
396
+ records the user can authenticate to
397
+ responses:
398
+ '200':
399
+ description: Success
400
+ body:
401
+ application/json:
402
+ type: ExternalCredentialRepresentation
403
+ uriParameters:
404
+ developerName:
405
+ type: string
406
+ required: true
@@ -0,0 +1,53 @@
1
+ #%RAML 1.0 Overlay
2
+ extends: ./api.raml
3
+
4
+ uses:
5
+ luvio: luvio://annotations.raml
6
+
7
+ (luvio.keyPrefix): 'named-credential'
8
+ (luvio.ttl): 300000
9
+
10
+ types:
11
+ ExternalCredentialRepresentation:
12
+ (luvio.key):
13
+ developerName: developerName
14
+ OAuthCredentialAuthUrlRepresentation:
15
+ (luvio.key):
16
+ authenticationUrl: authenticationUrl
17
+ CredentialRepresentation:
18
+ (luvio.ttl): 100
19
+ (luvio.opaque): true
20
+ (luvio.key):
21
+ externalCredential: externalCredential
22
+ principalType: principalType
23
+ principalName: principalName
24
+
25
+ /named-credentials/credential:
26
+ delete:
27
+ (luvio.adapter):
28
+ name: deleteCredential
29
+ (luvio.key):
30
+ externalCredential: queryParams.externalCredential || ''
31
+ principalType: queryParams.principalType || ''
32
+ principalName: queryParams.principalName || ''
33
+ get:
34
+ (luvio.adapter):
35
+ name: getCredential
36
+ (luvio.key):
37
+ externalCredential: queryParams.externalCredential || ''
38
+ principalType: queryParams.principalType || ''
39
+ principalName: queryParams.principalName || ''
40
+ post:
41
+ (luvio.adapter):
42
+ name: createCredential
43
+ put:
44
+ (luvio.adapter):
45
+ name: updateCredential
46
+ /named-credentials/credential/auth-url/o-auth:
47
+ post:
48
+ (luvio.adapter):
49
+ name: getOAuthCredentialAuthUrl
50
+ /named-credentials/external-credentials:
51
+ get:
52
+ (luvio.adapter):
53
+ name: getExternalCredentials