@azure/functions-authentication-events 1.0.0-beta.2 → 1.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/LICENSE +3 -3
  2. package/README.md +125 -117
  3. package/dist/browser/constants.d.ts +2 -0
  4. package/dist/browser/constants.d.ts.map +1 -0
  5. package/{dist-esm/src → dist/browser}/constants.js +1 -1
  6. package/{dist-esm/src → dist/browser}/constants.js.map +1 -1
  7. package/dist/browser/events.d.ts +87 -0
  8. package/dist/browser/events.d.ts.map +1 -0
  9. package/{dist-esm/src → dist/browser}/events.js +1 -1
  10. package/dist/browser/events.js.map +1 -0
  11. package/dist/browser/index.d.ts +5 -0
  12. package/dist/browser/index.d.ts.map +1 -0
  13. package/dist/browser/index.js +5 -0
  14. package/dist/browser/index.js.map +1 -0
  15. package/dist/browser/logger.d.ts +7 -0
  16. package/dist/browser/logger.d.ts.map +1 -0
  17. package/{dist-esm/src → dist/browser}/logger.js +1 -1
  18. package/{dist-esm/src → dist/browser}/logger.js.map +1 -1
  19. package/dist/browser/package.json +3 -0
  20. package/dist/browser/tokenIssuanceStart/actions.d.ts +17 -0
  21. package/dist/browser/tokenIssuanceStart/actions.d.ts.map +1 -0
  22. package/{dist-esm/src → dist/browser}/tokenIssuanceStart/actions.js +1 -1
  23. package/dist/browser/tokenIssuanceStart/actions.js.map +1 -0
  24. package/dist/browser/tokenIssuanceStart/context.d.ts +105 -0
  25. package/dist/browser/tokenIssuanceStart/context.d.ts.map +1 -0
  26. package/dist/browser/tokenIssuanceStart/context.js +4 -0
  27. package/dist/browser/tokenIssuanceStart/context.js.map +1 -0
  28. package/dist/browser/tokenIssuanceStart/index.d.ts +3 -0
  29. package/dist/browser/tokenIssuanceStart/index.d.ts.map +1 -0
  30. package/dist/browser/tokenIssuanceStart/index.js +4 -0
  31. package/{dist-esm/src → dist/browser}/tokenIssuanceStart/index.js.map +1 -1
  32. package/dist/commonjs/constants.d.ts +2 -0
  33. package/dist/commonjs/constants.d.ts.map +1 -0
  34. package/dist/commonjs/constants.js +7 -0
  35. package/dist/commonjs/constants.js.map +1 -0
  36. package/dist/commonjs/events.d.ts +87 -0
  37. package/dist/commonjs/events.d.ts.map +1 -0
  38. package/dist/commonjs/events.js +17 -0
  39. package/dist/commonjs/events.js.map +1 -0
  40. package/dist/commonjs/index.d.ts +5 -0
  41. package/dist/commonjs/index.d.ts.map +1 -0
  42. package/dist/commonjs/index.js +10 -0
  43. package/dist/commonjs/index.js.map +1 -0
  44. package/dist/commonjs/logger.d.ts +7 -0
  45. package/dist/commonjs/logger.d.ts.map +1 -0
  46. package/dist/commonjs/logger.js +13 -0
  47. package/dist/commonjs/logger.js.map +1 -0
  48. package/dist/commonjs/package.json +3 -0
  49. package/dist/commonjs/tokenIssuanceStart/actions.d.ts +17 -0
  50. package/dist/commonjs/tokenIssuanceStart/actions.d.ts.map +1 -0
  51. package/dist/commonjs/tokenIssuanceStart/actions.js +13 -0
  52. package/dist/commonjs/tokenIssuanceStart/actions.js.map +1 -0
  53. package/dist/commonjs/tokenIssuanceStart/context.d.ts +105 -0
  54. package/dist/commonjs/tokenIssuanceStart/context.d.ts.map +1 -0
  55. package/dist/commonjs/tokenIssuanceStart/context.js +5 -0
  56. package/dist/commonjs/tokenIssuanceStart/context.js.map +1 -0
  57. package/dist/commonjs/tokenIssuanceStart/index.d.ts +3 -0
  58. package/dist/commonjs/tokenIssuanceStart/index.d.ts.map +1 -0
  59. package/dist/commonjs/tokenIssuanceStart/index.js +8 -0
  60. package/dist/commonjs/tokenIssuanceStart/index.js.map +1 -0
  61. package/{types/latest → dist/commonjs}/tsdoc-metadata.json +11 -11
  62. package/dist/esm/constants.d.ts +2 -0
  63. package/dist/esm/constants.d.ts.map +1 -0
  64. package/dist/esm/constants.js +4 -0
  65. package/dist/esm/constants.js.map +1 -0
  66. package/dist/esm/events.d.ts +87 -0
  67. package/dist/esm/events.d.ts.map +1 -0
  68. package/dist/esm/events.js +14 -0
  69. package/dist/esm/events.js.map +1 -0
  70. package/dist/esm/index.d.ts +5 -0
  71. package/dist/esm/index.d.ts.map +1 -0
  72. package/dist/esm/index.js +5 -0
  73. package/dist/esm/index.js.map +1 -0
  74. package/dist/esm/logger.d.ts +7 -0
  75. package/dist/esm/logger.d.ts.map +1 -0
  76. package/dist/esm/logger.js +10 -0
  77. package/dist/esm/logger.js.map +1 -0
  78. package/dist/esm/package.json +3 -0
  79. package/dist/esm/tokenIssuanceStart/actions.d.ts +17 -0
  80. package/dist/esm/tokenIssuanceStart/actions.d.ts.map +1 -0
  81. package/dist/esm/tokenIssuanceStart/actions.js +10 -0
  82. package/dist/esm/tokenIssuanceStart/actions.js.map +1 -0
  83. package/dist/esm/tokenIssuanceStart/context.d.ts +105 -0
  84. package/dist/esm/tokenIssuanceStart/context.d.ts.map +1 -0
  85. package/dist/esm/tokenIssuanceStart/context.js +4 -0
  86. package/dist/esm/tokenIssuanceStart/context.js.map +1 -0
  87. package/dist/esm/tokenIssuanceStart/index.d.ts +3 -0
  88. package/dist/esm/tokenIssuanceStart/index.d.ts.map +1 -0
  89. package/dist/esm/tokenIssuanceStart/index.js +4 -0
  90. package/dist/esm/tokenIssuanceStart/index.js.map +1 -0
  91. package/dist/react-native/constants.d.ts +2 -0
  92. package/dist/react-native/constants.d.ts.map +1 -0
  93. package/dist/react-native/constants.js +4 -0
  94. package/dist/react-native/constants.js.map +1 -0
  95. package/dist/react-native/events.d.ts +87 -0
  96. package/dist/react-native/events.d.ts.map +1 -0
  97. package/dist/react-native/events.js +14 -0
  98. package/dist/react-native/events.js.map +1 -0
  99. package/dist/react-native/index.d.ts +5 -0
  100. package/dist/react-native/index.d.ts.map +1 -0
  101. package/dist/react-native/index.js +5 -0
  102. package/dist/react-native/index.js.map +1 -0
  103. package/dist/react-native/logger.d.ts +7 -0
  104. package/dist/react-native/logger.d.ts.map +1 -0
  105. package/dist/react-native/logger.js +10 -0
  106. package/dist/react-native/logger.js.map +1 -0
  107. package/dist/react-native/package.json +3 -0
  108. package/dist/react-native/tokenIssuanceStart/actions.d.ts +17 -0
  109. package/dist/react-native/tokenIssuanceStart/actions.d.ts.map +1 -0
  110. package/dist/react-native/tokenIssuanceStart/actions.js +10 -0
  111. package/dist/react-native/tokenIssuanceStart/actions.js.map +1 -0
  112. package/dist/react-native/tokenIssuanceStart/context.d.ts +105 -0
  113. package/dist/react-native/tokenIssuanceStart/context.d.ts.map +1 -0
  114. package/dist/react-native/tokenIssuanceStart/context.js +4 -0
  115. package/dist/react-native/tokenIssuanceStart/context.js.map +1 -0
  116. package/dist/react-native/tokenIssuanceStart/index.d.ts +3 -0
  117. package/dist/react-native/tokenIssuanceStart/index.d.ts.map +1 -0
  118. package/dist/react-native/tokenIssuanceStart/index.js +4 -0
  119. package/dist/react-native/tokenIssuanceStart/index.js.map +1 -0
  120. package/package.json +84 -79
  121. package/dist/index.js +0 -31
  122. package/dist/index.js.map +0 -1
  123. package/dist-esm/src/events.js.map +0 -1
  124. package/dist-esm/src/index.js +0 -5
  125. package/dist-esm/src/index.js.map +0 -1
  126. package/dist-esm/src/tokenIssuanceStart/actions.js.map +0 -1
  127. package/dist-esm/src/tokenIssuanceStart/context.js +0 -4
  128. package/dist-esm/src/tokenIssuanceStart/context.js.map +0 -1
  129. package/dist-esm/src/tokenIssuanceStart/index.js +0 -4
  130. package/types/3.1/functions-authentication-events.d.ts +0 -202
  131. package/types/latest/functions-authentication-events.d.ts +0 -224
@@ -0,0 +1,105 @@
1
+ /**
2
+ * Container file for all interfaces that pertain to the OnTokenIssuanceStart event API schema version 10-01-2021-preview.
3
+ */
4
+ import type { ActionableCloudEventResponse, AuthenticationEventAction, AuthenticationEventData, CloudEventRequest } from "../events.js";
5
+ /**
6
+ * The main request interface, this will relate it's response and payload.
7
+ */
8
+ export interface TokenIssuanceStartRequest extends CloudEventRequest<TokenIssuanceStartResponse, TokenIssuanceStartData> {
9
+ /** A dictionary of token claims. */
10
+ tokenClaims?: Record<string, string>;
11
+ }
12
+ /**
13
+ * The main response interface that is related to the request, this extends IActionable as the response
14
+ * contains actions, we only allow actions that inherit the TokenIssuanceStartAction.
15
+ */
16
+ export type TokenIssuanceStartResponse = ActionableCloudEventResponse<TokenIssuanceStartAction>;
17
+ /**
18
+ * The main data interface related to the request.
19
+ */
20
+ export interface TokenIssuanceStartData extends AuthenticationEventData {
21
+ /** The main context of the data. */
22
+ authenticationContext: AuthenticationEventContext;
23
+ }
24
+ /**
25
+ * Client interface for data.
26
+ */
27
+ export interface AuthenticationEventContextClient {
28
+ /** The Ip Address */
29
+ ip: string;
30
+ /** Gets or sets the locale. */
31
+ locale: string;
32
+ /** Gets or sets the market. */
33
+ market: string;
34
+ }
35
+ /**
36
+ * ResourceServicePrincipal interface for data.
37
+ */
38
+ export interface AuthenticationEventContextServicePrincipal {
39
+ /** The identifier for the service principal. */
40
+ id: string;
41
+ /** The application identifier. */
42
+ appId: string;
43
+ /** The application display name. */
44
+ appDisplayName: string;
45
+ /** The display name. */
46
+ displayName: string;
47
+ }
48
+ /**
49
+ * User interface for data.
50
+ */
51
+ export interface AuthenticationEventContextUser {
52
+ /** The user's company name. */
53
+ companyName: string;
54
+ /** The user's country. */
55
+ country: string;
56
+ /** The user's display name. */
57
+ displayName: string;
58
+ /** The user's given name. */
59
+ givenName: string;
60
+ /** The user identifier. */
61
+ id: string;
62
+ /** The user's email address. */
63
+ mail: string;
64
+ /** The user's on premise SAM account name. */
65
+ onPremisesSamAccountName: string;
66
+ /** The user's on premise security identifier. */
67
+ onPremisesSecurityIdentifier: string;
68
+ /** The user's on premise principal name. */
69
+ onPremiseUserPrincipalName: string;
70
+ /** The user's preferred data location */
71
+ preferredDataLocation: string;
72
+ /** The user's preferred language. */
73
+ preferredLanguage: string;
74
+ /** The user's surname. */
75
+ surname: string;
76
+ /** The user's principal name. */
77
+ userPrincipalName: string;
78
+ /** The user type. */
79
+ userType: string;
80
+ }
81
+ /**
82
+ * Context interface for data.
83
+ */
84
+ export interface AuthenticationEventContext {
85
+ /** Unique identifier for the request. */
86
+ correlationId: string;
87
+ /** The client. */
88
+ client: AuthenticationEventContextClient;
89
+ /** The authorization protocol. */
90
+ authenticationProtocol: "OAUTH2.0" | "SAML" | "WS-FED" | "unknownFutureValue" | undefined;
91
+ /** The client service principal. */
92
+ clientServicePrincipal: AuthenticationEventContextServicePrincipal;
93
+ /** The resource service principal. */
94
+ resourceServicePrincipal: AuthenticationEventContextServicePrincipal;
95
+ /** Data pertaining to the user requesting a token. */
96
+ user: AuthenticationEventContextUser;
97
+ }
98
+ /**
99
+ * All actions for the token issuance start event should extended this interface, as it looks the correct action to the correct event.
100
+ */
101
+ export interface TokenIssuanceStartAction extends AuthenticationEventAction {
102
+ /** This will be the 'Name' of the action in the JSON. */
103
+ actionType: string;
104
+ }
105
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/tokenIssuanceStart/context.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,OAAO,KAAK,EACV,4BAA4B,EAC5B,yBAAyB,EACzB,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AAEtB;;GAEG;AACH,MAAM,WAAW,yBACf,SAAQ,iBAAiB,CAAC,0BAA0B,EAAE,sBAAsB,CAAC;IAC7E,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AAED;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAAG,4BAA4B,CAAC,wBAAwB,CAAC,CAAC;AAEhG;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,uBAAuB;IACrE,oCAAoC;IACpC,qBAAqB,EAAE,0BAA0B,CAAC;CACnD;AAED;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC/C,qBAAqB;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,0CAA0C;IACzD,gDAAgD;IAChD,EAAE,EAAE,MAAM,CAAC;IACX,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,cAAc,EAAE,MAAM,CAAC;IACvB,wBAAwB;IACxB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,0BAA0B;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,2BAA2B;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,wBAAwB,EAAE,MAAM,CAAC;IACjC,iDAAiD;IACjD,4BAA4B,EAAE,MAAM,CAAC;IACrC,4CAA4C;IAC5C,0BAA0B,EAAE,MAAM,CAAC;IACnC,yCAAyC;IACzC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,qCAAqC;IACrC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,0BAA0B;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB;IACrB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,yCAAyC;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB;IAClB,MAAM,EAAE,gCAAgC,CAAC;IACzC,kCAAkC;IAClC,sBAAsB,EAAE,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,oBAAoB,GAAG,SAAS,CAAC;IAC1F,oCAAoC;IACpC,sBAAsB,EAAE,0CAA0C,CAAC;IACnE,sCAAsC;IACtC,wBAAwB,EAAE,0CAA0C,CAAC;IACrE,sDAAsD;IACtD,IAAI,EAAE,8BAA8B,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,yBAAyB;IACzE,yDAAyD;IACzD,UAAU,EAAE,MAAM,CAAC;CACpB"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export {};
4
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/tokenIssuanceStart/context.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Container file for all interfaces that pertain to the OnTokenIssuanceStart event API schema version 10-01-2021-preview.\n */\nimport type {\n ActionableCloudEventResponse,\n AuthenticationEventAction,\n AuthenticationEventData,\n CloudEventRequest,\n} from \"../events.js\";\n\n/**\n * The main request interface, this will relate it's response and payload.\n */\nexport interface TokenIssuanceStartRequest\n extends CloudEventRequest<TokenIssuanceStartResponse, TokenIssuanceStartData> {\n /** A dictionary of token claims. */\n tokenClaims?: Record<string, string>;\n}\n\n/**\n * The main response interface that is related to the request, this extends IActionable as the response\n * contains actions, we only allow actions that inherit the TokenIssuanceStartAction.\n */\nexport type TokenIssuanceStartResponse = ActionableCloudEventResponse<TokenIssuanceStartAction>;\n\n/**\n * The main data interface related to the request.\n */\nexport interface TokenIssuanceStartData extends AuthenticationEventData {\n /** The main context of the data. */\n authenticationContext: AuthenticationEventContext;\n}\n\n/**\n * Client interface for data.\n */\nexport interface AuthenticationEventContextClient {\n /** The Ip Address */\n ip: string;\n /** Gets or sets the locale. */\n locale: string;\n /** Gets or sets the market. */\n market: string;\n}\n\n/**\n * ResourceServicePrincipal interface for data.\n */\nexport interface AuthenticationEventContextServicePrincipal {\n /** The identifier for the service principal. */\n id: string;\n /** The application identifier. */\n appId: string;\n /** The application display name. */\n appDisplayName: string;\n /** The display name. */\n displayName: string;\n}\n\n/**\n * User interface for data.\n */\nexport interface AuthenticationEventContextUser {\n /** The user's company name. */\n companyName: string;\n /** The user's country. */\n country: string;\n /** The user's display name. */\n displayName: string;\n /** The user's given name. */\n givenName: string;\n /** The user identifier. */\n id: string;\n /** The user's email address. */\n mail: string;\n /** The user's on premise SAM account name. */\n onPremisesSamAccountName: string;\n /** The user's on premise security identifier. */\n onPremisesSecurityIdentifier: string;\n /** The user's on premise principal name. */\n onPremiseUserPrincipalName: string;\n /** The user's preferred data location */\n preferredDataLocation: string;\n /** The user's preferred language. */\n preferredLanguage: string;\n /** The user's surname. */\n surname: string;\n /** The user's principal name. */\n userPrincipalName: string;\n /** The user type. */\n userType: string;\n}\n\n/**\n * Context interface for data.\n */\nexport interface AuthenticationEventContext {\n /** Unique identifier for the request. */\n correlationId: string;\n /** The client. */\n client: AuthenticationEventContextClient;\n /** The authorization protocol. */\n authenticationProtocol: \"OAUTH2.0\" | \"SAML\" | \"WS-FED\" | \"unknownFutureValue\" | undefined;\n /** The client service principal. */\n clientServicePrincipal: AuthenticationEventContextServicePrincipal;\n /** The resource service principal. */\n resourceServicePrincipal: AuthenticationEventContextServicePrincipal;\n /** Data pertaining to the user requesting a token. */\n user: AuthenticationEventContextUser;\n}\n\n/**\n * All actions for the token issuance start event should extended this interface, as it looks the correct action to the correct event.\n */\nexport interface TokenIssuanceStartAction extends AuthenticationEventAction {\n /** This will be the 'Name' of the action in the JSON. */\n actionType: string;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export { AuthenticationEventContext, AuthenticationEventContextClient, AuthenticationEventContextServicePrincipal, AuthenticationEventContextUser, TokenIssuanceStartData, TokenIssuanceStartRequest, TokenIssuanceStartResponse, TokenIssuanceStartAction, } from "./context.js";
2
+ export { ProvideClaimsForToken, TokenClaim, createProvideClaimsForToken } from "./actions.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tokenIssuanceStart/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,0BAA0B,EAC1B,gCAAgC,EAChC,0CAA0C,EAC1C,8BAA8B,EAC9B,sBAAsB,EACtB,yBAAyB,EACzB,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,2BAA2B,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export { createProvideClaimsForToken } from "./actions.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tokenIssuanceStart/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAYlC,OAAO,EAAqC,2BAA2B,EAAE,MAAM,cAAc,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport {\n AuthenticationEventContext,\n AuthenticationEventContextClient,\n AuthenticationEventContextServicePrincipal,\n AuthenticationEventContextUser,\n TokenIssuanceStartData,\n TokenIssuanceStartRequest,\n TokenIssuanceStartResponse,\n TokenIssuanceStartAction,\n} from \"./context.js\";\nexport { ProvideClaimsForToken, TokenClaim, createProvideClaimsForToken } from \"./actions.js\";\n"]}
package/package.json CHANGED
@@ -1,47 +1,19 @@
1
1
  {
2
2
  "name": "@azure/functions-authentication-events",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.3",
4
4
  "description": "Typescript Trigger SDK for Azure AD Authentication event custom extensions. Lets you focus on your business logic.",
5
5
  "sdk-type": "client",
6
- "main": "dist/index.js",
7
- "module": "dist-esm/src/index.js",
8
- "types": "types/latest/functions-authentication-events.d.ts",
9
- "scripts": {
10
- "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
11
- "build:samples": "echo Obsolete",
12
- "build:test": "npm run clean && tsc -p . && dev-tool run bundle",
13
- "build:types": "downlevel-dts types/latest/ types/3.1/",
14
- "build": "npm run build:test && api-extractor run --local && npm run build:types",
15
- "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
16
- "clean": "rimraf dist dist-* temp types *.tgz *.log",
17
- "execute:samples": "dev-tool samples run samples-dev",
18
- "extract-api": "tsc -p . && api-extractor run --local",
19
- "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
20
- "generate:client": "autorest --typescript ./swagger/README.md",
21
- "integration-test:browser": "dev-tool run test:browser",
22
- "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/**/*.spec.ts'",
23
- "integration-test": "npm run integration-test:node && npm run integration-test:browser",
24
- "lint:fix": "eslint README.md package.json api-extractor.json src test --ext .ts,.javascript,.js --fix --fix-type [problem,suggestion]",
25
- "lint": "eslint README.md package.json api-extractor.json src test --ext .ts,.javascript,.js",
26
- "pack": "npm pack 2>&1",
27
- "test:browser": "npm run clean && npm run build:test && npm run integration-test:browser",
28
- "test:node": "npm run clean && tsc -p . && npm run integration-test:node",
29
- "test": "npm run clean && tsc -p . && npm run unit-test:node && dev-tool run bundle && npm run unit-test:browser && npm run integration-test",
30
- "unit-test:browser": "npm run integration-test:browser",
31
- "unit-test:node": "npm run integration-test:node",
32
- "unit-test": "npm run unit-test:node && npm run unit-test:browser"
33
- },
6
+ "main": "./dist/commonjs/index.js",
7
+ "module": "./dist/esm/index.js",
8
+ "types": "./dist/commonjs/index.d.ts",
34
9
  "files": [
35
10
  "dist/",
36
- "dist-esm/src/",
37
- "types/latest/",
38
- "types/3.1/",
39
11
  "README.md",
40
12
  "LICENSE"
41
13
  ],
42
14
  "repository": "github:Azure/azure-sdk-for-js",
43
15
  "engines": {
44
- "node": ">=14.0.0"
16
+ "node": ">=20.0.0"
45
17
  },
46
18
  "keywords": [
47
19
  "azure",
@@ -57,61 +29,94 @@
57
29
  "sideEffects": false,
58
30
  "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
59
31
  "dependencies": {
60
- "@azure/core-auth": "^1.3.0",
61
- "@azure/core-client": "^1.4.0",
62
- "@azure/core-rest-pipeline": "^1.4.0",
63
- "@azure/core-tracing": "^1.0.0",
64
- "@azure/logger": "^1.0.0",
65
- "tslib": "^2.2.0"
32
+ "@azure/core-auth": "^1.9.0",
33
+ "@azure/core-client": "^1.9.2",
34
+ "@azure/core-rest-pipeline": "^1.19.0",
35
+ "@azure/core-tracing": "^1.2.0",
36
+ "@azure/logger": "^1.1.4",
37
+ "tslib": "^2.8.1"
66
38
  },
67
39
  "devDependencies": {
68
- "@azure/dev-tool": "^1.0.0",
40
+ "@azure/functions": "^3.2.0",
41
+ "@azure/identity": "4.11.1",
42
+ "@types/node": "^20.19.0",
43
+ "@vitest/browser": "^3.2.3",
44
+ "@vitest/coverage-istanbul": "^3.2.3",
45
+ "dotenv": "^16.0.0",
46
+ "eslint": "^9.33.0",
47
+ "playwright": "^1.50.1",
48
+ "typescript": "~5.8.3",
49
+ "vitest": "^3.2.3",
69
50
  "@azure/eslint-plugin-azure-sdk": "^3.0.0",
70
- "@azure/identity": "^2.0.1",
71
- "@azure/test-utils": "^1.0.0",
72
- "@azure-tools/test-credential": "~1.0.0",
73
- "@azure-tools/test-recorder": "^2.0.0",
74
- "@microsoft/api-extractor": "^7.31.1",
75
- "@types/chai": "^4.1.6",
76
- "@types/mocha": "^7.0.2",
77
- "@types/node": "^14.0.0",
78
- "chai": "^4.2.0",
79
- "cross-env": "^7.0.2",
80
- "dotenv": "^8.2.0",
81
- "downlevel-dts": "^0.8.0",
82
- "eslint": "^8.0.0",
83
- "esm": "^3.2.18",
84
- "inherits": "^2.0.3",
85
- "karma": "^6.2.0",
86
- "karma-chrome-launcher": "^3.0.0",
87
- "karma-coverage": "^2.0.0",
88
- "karma-edge-launcher": "^0.4.2",
89
- "karma-env-preprocessor": "^0.1.1",
90
- "karma-firefox-launcher": "^1.1.0",
91
- "karma-ie-launcher": "^1.0.0",
92
- "karma-json-preprocessor": "^0.3.3",
93
- "karma-json-to-file-reporter": "^1.0.1",
94
- "karma-junit-reporter": "^2.0.1",
95
- "karma-mocha": "^2.0.1",
96
- "karma-mocha-reporter": "^2.2.5",
97
- "mocha": "^7.1.1",
98
- "mocha-junit-reporter": "^2.0.0",
99
- "nyc": "^15.0.0",
100
- "prettier": "^2.5.1",
101
- "rimraf": "^3.0.0",
102
- "source-map-support": "^0.5.9",
103
- "typescript": "~4.6.0",
104
- "util": "^0.12.1",
105
- "@azure/functions": "^3.2.0"
51
+ "@azure-tools/test-utils-vitest": "^2.0.0",
52
+ "@azure/dev-tool": "^1.0.0"
106
53
  },
107
54
  "//sampleConfiguration": {
108
55
  "skipFolder": false,
109
56
  "disableDocsMs": true,
110
57
  "productName": "Azure Template",
111
58
  "productSlugs": [],
112
- "apiRefLink": "https://docs.microsoft.com/javascript/api/",
59
+ "apiRefLink": "https://learn.microsoft.com/javascript/api/",
113
60
  "requiredResources": {
114
- "Azure App Configuration": "https://docs.microsoft.com/azure/azure-app-configuration/"
61
+ "Azure App Configuration": "https://learn.microsoft.com/azure/azure-app-configuration/"
115
62
  }
63
+ },
64
+ "type": "module",
65
+ "tshy": {
66
+ "project": "../../../tsconfig.src.build.json",
67
+ "exports": {
68
+ "./package.json": "./package.json",
69
+ ".": "./src/index.ts"
70
+ },
71
+ "dialects": [
72
+ "esm",
73
+ "commonjs"
74
+ ],
75
+ "esmDialects": [
76
+ "browser",
77
+ "react-native"
78
+ ],
79
+ "selfLink": false
80
+ },
81
+ "browser": "./dist/browser/index.js",
82
+ "exports": {
83
+ "./package.json": "./package.json",
84
+ ".": {
85
+ "browser": {
86
+ "types": "./dist/browser/index.d.ts",
87
+ "default": "./dist/browser/index.js"
88
+ },
89
+ "react-native": {
90
+ "types": "./dist/react-native/index.d.ts",
91
+ "default": "./dist/react-native/index.js"
92
+ },
93
+ "import": {
94
+ "types": "./dist/esm/index.d.ts",
95
+ "default": "./dist/esm/index.js"
96
+ },
97
+ "require": {
98
+ "types": "./dist/commonjs/index.d.ts",
99
+ "default": "./dist/commonjs/index.js"
100
+ }
101
+ }
102
+ },
103
+ "react-native": "./dist/react-native/index.js",
104
+ "scripts": {
105
+ "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api",
106
+ "build:samples": "tsc -p tsconfig.samples.json",
107
+ "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
108
+ "clean": "dev-tool run vendored rimraf --glob dist dist-* temp types *.tgz *.log",
109
+ "execute:samples": "dev-tool samples run samples-dev",
110
+ "extract-api": "dev-tool run build-package && dev-tool run extract-api",
111
+ "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
112
+ "generate:client": "autorest --typescript ./swagger/README.md",
113
+ "lint": "eslint package.json src test",
114
+ "lint:fix": "eslint package.json src test --fix --fix-type [problem,suggestion]",
115
+ "pack": "pnpm pack 2>&1",
116
+ "test": "npm run test:node && npm run test:browser",
117
+ "test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --browser --no-test-proxy",
118
+ "test:node": "dev-tool run test:vitest --no-test-proxy",
119
+ "test:node:esm": "dev-tool run test:vitest --esm",
120
+ "update-snippets": "dev-tool run update-snippets"
116
121
  }
117
- }
122
+ }
package/dist/index.js DELETED
@@ -1,31 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- // Copyright (c) Microsoft Corporation.
6
- // Licensed under the MIT license.
7
- /**
8
- * Helper function to create a files request
9
- * @param error - string or exception
10
- * @returns a valid FailedRequest object
11
- */
12
- function createFailedRequest(error) {
13
- return {
14
- body: "",
15
- error: error instanceof Error ? error.message : String(error),
16
- };
17
- }
18
-
19
- // Copyright (c) Microsoft Corporation.
20
- // Licensed under the MIT license.
21
- /** Helper function to create a provider claims for token */
22
- function createProvideClaimsForToken(claims) {
23
- return {
24
- actionType: "microsoft.graph.ProvideClaimsForToken",
25
- claims: claims,
26
- };
27
- }
28
-
29
- exports.createFailedRequest = createFailedRequest;
30
- exports.createProvideClaimsForToken = createProvideClaimsForToken;
31
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../src/events.ts","../src/tokenIssuanceStart/actions.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Abstract base event interface to house common event request attributes.\n */\nexport interface AuthenticationEventRequestCommon {\n /** Related Type */\n type: string;\n /** The status of the current request, see RequestStatus. */\n requestStatus: RequestStatus;\n /** A user friendly message (containing errors), that the authentication event returns. */\n statusMessage: string;\n /** A dictionary of query string parameters */\n queryParameters: Record<string, string>;\n}\n\n/**\n * Event request interface extended the related response and event data (payload) objects.\n */\nexport interface AuthenticationEventRequest<\n TResponse extends AuthenticationEventResponse,\n TData extends AuthenticationEventData\n> extends AuthenticationEventRequestCommon {\n /** Related IEventResponse */\n response: TResponse;\n /** Related IEventData */\n payload: TData;\n}\n\n/**\n * Event request interface extended the related response and event data (payload) objects for cloud events.\n */\nexport interface CloudEventRequest<\n TResponse extends AuthenticationEventResponse,\n TData extends AuthenticationEventData\n> extends AuthenticationEventRequest<TResponse, TData> {\n /** Related Source */\n source: string;\n /** Related \\@odata.type */\n oDataType: string;\n}\n\n/**\n * Event response interface that houses attributes returned from the authentication events trigger.\n */\nexport interface AuthenticationEventResponse {\n /** A template of the body of the expected response. */\n body: string;\n}\n\n/**\n * Event data interface pertaining to the expected payload, this interface houses the common attributes for data events.\n */\nexport interface AuthenticationEventData {\n /** Tenant the request is related to. */\n tenantId: string;\n /** Unique Id for the event. */\n authenticationEventListenerId: string;\n /** The unique internal Id of the registered custom extension. */\n customAuthenticationExtensionId: string;\n}\n\n/**\n * An interface that binds a response that has actions\n */\nexport interface ActionableResponse<TEventAction extends AuthenticationEventAction>\n extends AuthenticationEventResponse {\n /** Collections of actions pertaining to the event. */\n actions: TEventAction[];\n}\n\n/**\n * An interface for any responses that implement an cloud event payload and has actions on it.\n */\nexport interface ActionableCloudEventResponse<TEventAction extends AuthenticationEventAction>\n extends ActionableResponse<TEventAction> {\n /** Gets the Cloud Event \\@odata.type. */\n oDataType: string;\n}\n\n/**\n * An interface representing an action for an event.\n */\nexport interface AuthenticationEventAction {\n /** Must be overridden, this will be the 'Name' of the action in the JSON. */\n actionType: string;\n}\n\n/**\n * The status of the request.\n */\nexport type RequestStatus = \"Failed\" | \"TokenInvalid\" | \"Successful\";\n\n/**\n * Return the correctly formatted error\n * */\nexport interface FailedRequest extends AuthenticationEventResponse {\n //* * The error that caused the request to fail. */\n error: string;\n}\n\n/**\n * Helper function to create a files request\n * @param error - string or exception\n * @returns a valid FailedRequest object\n */\nexport function createFailedRequest(error: unknown): FailedRequest {\n return {\n body: \"\",\n error: error instanceof Error ? error.message : String(error),\n };\n}\n","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { TokenIssuanceStartAction } from \"./context\";\n\n/**\n * An Interface for the Provide Claims for token action.\n */\nexport interface ProvideClaimsForToken extends TokenIssuanceStartAction {\n /** The 'Name' of the action in the JSON. */\n actionType: \"microsoft.graph.ProvideClaimsForToken\";\n /** Collection of claims to add to the token. */\n claims: TokenClaim;\n /** Helper constructor to easily add claims to the action. */\n}\n\n/** Helper function to create a provider claims for token */\nexport function createProvideClaimsForToken(claims: TokenClaim): ProvideClaimsForToken {\n return {\n actionType: \"microsoft.graph.ProvideClaimsForToken\",\n claims: claims,\n };\n}\n\n/**\n * An type representing a claim.\n */\nexport type TokenClaim = Record<string, string | string[]>;\n"],"names":[],"mappings":";;;;AAAA;AACA;AAqGA;;;;AAIG;AACG,SAAU,mBAAmB,CAAC,KAAc,EAAA;IAChD,OAAO;AACL,QAAA,IAAI,EAAE,EAAE;AACR,QAAA,KAAK,EAAE,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;KAC9D,CAAC;AACJ;;AChHA;AACA;AAeA;AACM,SAAU,2BAA2B,CAAC,MAAkB,EAAA;IAC5D,OAAO;AACL,QAAA,UAAU,EAAE,uCAAuC;AACnD,QAAA,MAAM,EAAE,MAAM;KACf,CAAC;AACJ;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/events.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAqGlC;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,OAAO;QACL,IAAI,EAAE,EAAE;QACR,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;KAC9D,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Abstract base event interface to house common event request attributes.\n */\nexport interface AuthenticationEventRequestCommon {\n /** Related Type */\n type: string;\n /** The status of the current request, see RequestStatus. */\n requestStatus: RequestStatus;\n /** A user friendly message (containing errors), that the authentication event returns. */\n statusMessage: string;\n /** A dictionary of query string parameters */\n queryParameters: Record<string, string>;\n}\n\n/**\n * Event request interface extended the related response and event data (payload) objects.\n */\nexport interface AuthenticationEventRequest<\n TResponse extends AuthenticationEventResponse,\n TData extends AuthenticationEventData\n> extends AuthenticationEventRequestCommon {\n /** Related IEventResponse */\n response: TResponse;\n /** Related IEventData */\n payload: TData;\n}\n\n/**\n * Event request interface extended the related response and event data (payload) objects for cloud events.\n */\nexport interface CloudEventRequest<\n TResponse extends AuthenticationEventResponse,\n TData extends AuthenticationEventData\n> extends AuthenticationEventRequest<TResponse, TData> {\n /** Related Source */\n source: string;\n /** Related \\@odata.type */\n oDataType: string;\n}\n\n/**\n * Event response interface that houses attributes returned from the authentication events trigger.\n */\nexport interface AuthenticationEventResponse {\n /** A template of the body of the expected response. */\n body: string;\n}\n\n/**\n * Event data interface pertaining to the expected payload, this interface houses the common attributes for data events.\n */\nexport interface AuthenticationEventData {\n /** Tenant the request is related to. */\n tenantId: string;\n /** Unique Id for the event. */\n authenticationEventListenerId: string;\n /** The unique internal Id of the registered custom extension. */\n customAuthenticationExtensionId: string;\n}\n\n/**\n * An interface that binds a response that has actions\n */\nexport interface ActionableResponse<TEventAction extends AuthenticationEventAction>\n extends AuthenticationEventResponse {\n /** Collections of actions pertaining to the event. */\n actions: TEventAction[];\n}\n\n/**\n * An interface for any responses that implement an cloud event payload and has actions on it.\n */\nexport interface ActionableCloudEventResponse<TEventAction extends AuthenticationEventAction>\n extends ActionableResponse<TEventAction> {\n /** Gets the Cloud Event \\@odata.type. */\n oDataType: string;\n}\n\n/**\n * An interface representing an action for an event.\n */\nexport interface AuthenticationEventAction {\n /** Must be overridden, this will be the 'Name' of the action in the JSON. */\n actionType: string;\n}\n\n/**\n * The status of the request.\n */\nexport type RequestStatus = \"Failed\" | \"TokenInvalid\" | \"Successful\";\n\n/**\n * Return the correctly formatted error\n * */\nexport interface FailedRequest extends AuthenticationEventResponse {\n //* * The error that caused the request to fail. */\n error: string;\n}\n\n/**\n * Helper function to create a files request\n * @param error - string or exception\n * @returns a valid FailedRequest object\n */\nexport function createFailedRequest(error: unknown): FailedRequest {\n return {\n body: \"\",\n error: error instanceof Error ? error.message : String(error),\n };\n}\n"]}
@@ -1,5 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- export { createFailedRequest, } from "./events";
4
- export { createProvideClaimsForToken, } from "./tokenIssuanceStart/actions";
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAUL,mBAAmB,GAEpB,MAAM,UAAU,CAAC;AAWlB,OAAO,EAGL,2BAA2B,GAC5B,MAAM,8BAA8B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport {\n FailedRequest,\n ActionableResponse,\n AuthenticationEventAction,\n AuthenticationEventData,\n AuthenticationEventRequest,\n AuthenticationEventRequestCommon,\n AuthenticationEventResponse,\n RequestStatus,\n CloudEventRequest,\n createFailedRequest,\n ActionableCloudEventResponse,\n} from \"./events\";\n\nexport {\n AuthenticationEventContext,\n AuthenticationEventContextClient,\n AuthenticationEventContextServicePrincipal,\n AuthenticationEventContextUser,\n TokenIssuanceStartData,\n TokenIssuanceStartRequest,\n TokenIssuanceStartResponse,\n} from \"./tokenIssuanceStart/context\";\nexport {\n ProvideClaimsForToken,\n TokenClaim,\n createProvideClaimsForToken,\n} from \"./tokenIssuanceStart/actions\";\n\nexport { TokenIssuanceStartAction } from \"./tokenIssuanceStart/context\";\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../src/tokenIssuanceStart/actions.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAelC,4DAA4D;AAC5D,MAAM,UAAU,2BAA2B,CAAC,MAAkB;IAC5D,OAAO;QACL,UAAU,EAAE,uCAAuC;QACnD,MAAM,EAAE,MAAM;KACf,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { TokenIssuanceStartAction } from \"./context\";\n\n/**\n * An Interface for the Provide Claims for token action.\n */\nexport interface ProvideClaimsForToken extends TokenIssuanceStartAction {\n /** The 'Name' of the action in the JSON. */\n actionType: \"microsoft.graph.ProvideClaimsForToken\";\n /** Collection of claims to add to the token. */\n claims: TokenClaim;\n /** Helper constructor to easily add claims to the action. */\n}\n\n/** Helper function to create a provider claims for token */\nexport function createProvideClaimsForToken(claims: TokenClaim): ProvideClaimsForToken {\n return {\n actionType: \"microsoft.graph.ProvideClaimsForToken\",\n claims: claims,\n };\n}\n\n/**\n * An type representing a claim.\n */\nexport type TokenClaim = Record<string, string | string[]>;\n"]}
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- export {};
4
- //# sourceMappingURL=context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/tokenIssuanceStart/context.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Container file for all interfaces that pertain to the OnTokenIssuanceStart event API schema version 10-01-2021-preview.\n */\nimport {\n ActionableCloudEventResponse,\n AuthenticationEventAction,\n AuthenticationEventData,\n CloudEventRequest,\n} from \"../events\";\n\n/**\n * The main request interface, this will relate it's response and payload.\n */\nexport interface TokenIssuanceStartRequest\n extends CloudEventRequest<TokenIssuanceStartResponse, TokenIssuanceStartData> {\n /** A dictionary of token claims. */\n tokenClaims?: Record<string, string>;\n}\n\n/**\n * The main response interface that is related to the request, this extends IActionable as the response\n * contains actions, we only allow actions that inherit the TokenIssuanceStartAction.\n */\nexport type TokenIssuanceStartResponse = ActionableCloudEventResponse<TokenIssuanceStartAction>;\n\n/**\n * The main data interface related to the request.\n */\nexport interface TokenIssuanceStartData extends AuthenticationEventData {\n /** The main context of the data. */\n authenticationContext: AuthenticationEventContext;\n}\n\n/**\n * Client interface for data.\n */\nexport interface AuthenticationEventContextClient {\n /** The Ip Address */\n ip: string;\n /** Gets or sets the locale. */\n locale: string;\n /** Gets or sets the market. */\n market: string;\n}\n\n/**\n * ResourceServicePrincipal interface for data.\n */\nexport interface AuthenticationEventContextServicePrincipal {\n /** The identifier for the service principal. */\n id: string;\n /** The application identifier. */\n appId: string;\n /** The application display name. */\n appDisplayName: string;\n /** The display name. */\n displayName: string;\n}\n\n/**\n * User interface for data.\n */\nexport interface AuthenticationEventContextUser {\n /** The user's company name. */\n companyName: string;\n /** The user's country. */\n country: string;\n /** The user's display name. */\n displayName: string;\n /** The user's given name. */\n givenName: string;\n /** The user identifier. */\n id: string;\n /** The user's email address. */\n mail: string;\n /** The user's on premise SAM account name. */\n onPremisesSamAccountName: string;\n /** The user's on premise security identifier. */\n onPremisesSecurityIdentifier: string;\n /** The user's on premise principal name. */\n onPremiseUserPrincipalName: string;\n /** The user's preferred data location */\n preferredDataLocation: string;\n /** The user's preferred language. */\n preferredLanguage: string;\n /** The user's surname. */\n surname: string;\n /** The user's principal name. */\n userPrincipalName: string;\n /** The user type. */\n userType: string;\n}\n\n/**\n * Context interface for data.\n */\nexport interface AuthenticationEventContext {\n /** Unique identifier for the request. */\n correlationId: string;\n /** The client. */\n client: AuthenticationEventContextClient;\n /** The authorization protocol. */\n authenticationProtocol: \"OAUTH2.0\" | \"SAML\" | \"WS-FED\" | \"unknownFutureValue\" | undefined;\n /** The client service principal. */\n clientServicePrincipal: AuthenticationEventContextServicePrincipal;\n /** The resource service principal. */\n resourceServicePrincipal: AuthenticationEventContextServicePrincipal;\n /** Data pertaining to the user requesting a token. */\n user: AuthenticationEventContextUser;\n}\n\n/**\n * All actions for the token issuance start event should extended this interface, as it looks the correct action to the correct event.\n */\nexport interface TokenIssuanceStartAction extends AuthenticationEventAction {\n /** This will be the 'Name' of the action in the JSON. */\n actionType: string;\n}\n"]}
@@ -1,4 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- export { createProvideClaimsForToken } from "./actions";
4
- //# sourceMappingURL=index.js.map
@@ -1,202 +0,0 @@
1
- /**
2
- * An interface for any responses that implement an cloud event payload and has actions on it.
3
- */
4
- export declare interface ActionableCloudEventResponse<TEventAction extends AuthenticationEventAction> extends ActionableResponse<TEventAction> {
5
- /** Gets the Cloud Event \@odata.type. */
6
- oDataType: string;
7
- }
8
- /**
9
- * An interface that binds a response that has actions
10
- */
11
- export declare interface ActionableResponse<TEventAction extends AuthenticationEventAction> extends AuthenticationEventResponse {
12
- /** Collections of actions pertaining to the event. */
13
- actions: TEventAction[];
14
- }
15
- /**
16
- * An interface representing an action for an event.
17
- */
18
- export declare interface AuthenticationEventAction {
19
- /** Must be overridden, this will be the 'Name' of the action in the JSON. */
20
- actionType: string;
21
- }
22
- /**
23
- * Context interface for data.
24
- */
25
- export declare interface AuthenticationEventContext {
26
- /** Unique identifier for the request. */
27
- correlationId: string;
28
- /** The client. */
29
- client: AuthenticationEventContextClient;
30
- /** The authorization protocol. */
31
- authenticationProtocol: "OAUTH2.0" | "SAML" | "WS-FED" | "unknownFutureValue" | undefined;
32
- /** The client service principal. */
33
- clientServicePrincipal: AuthenticationEventContextServicePrincipal;
34
- /** The resource service principal. */
35
- resourceServicePrincipal: AuthenticationEventContextServicePrincipal;
36
- /** Data pertaining to the user requesting a token. */
37
- user: AuthenticationEventContextUser;
38
- }
39
- /**
40
- * Client interface for data.
41
- */
42
- export declare interface AuthenticationEventContextClient {
43
- /** The Ip Address */
44
- ip: string;
45
- /** Gets or sets the locale. */
46
- locale: string;
47
- /** Gets or sets the market. */
48
- market: string;
49
- }
50
- /**
51
- * ResourceServicePrincipal interface for data.
52
- */
53
- export declare interface AuthenticationEventContextServicePrincipal {
54
- /** The identifier for the service principal. */
55
- id: string;
56
- /** The application identifier. */
57
- appId: string;
58
- /** The application display name. */
59
- appDisplayName: string;
60
- /** The display name. */
61
- displayName: string;
62
- }
63
- /**
64
- * User interface for data.
65
- */
66
- export declare interface AuthenticationEventContextUser {
67
- /** The user's company name. */
68
- companyName: string;
69
- /** The user's country. */
70
- country: string;
71
- /** The user's display name. */
72
- displayName: string;
73
- /** The user's given name. */
74
- givenName: string;
75
- /** The user identifier. */
76
- id: string;
77
- /** The user's email address. */
78
- mail: string;
79
- /** The user's on premise SAM account name. */
80
- onPremisesSamAccountName: string;
81
- /** The user's on premise security identifier. */
82
- onPremisesSecurityIdentifier: string;
83
- /** The user's on premise principal name. */
84
- onPremiseUserPrincipalName: string;
85
- /** The user's preferred data location */
86
- preferredDataLocation: string;
87
- /** The user's preferred language. */
88
- preferredLanguage: string;
89
- /** The user's surname. */
90
- surname: string;
91
- /** The user's principal name. */
92
- userPrincipalName: string;
93
- /** The user type. */
94
- userType: string;
95
- }
96
- /**
97
- * Event data interface pertaining to the expected payload, this interface houses the common attributes for data events.
98
- */
99
- export declare interface AuthenticationEventData {
100
- /** Tenant the request is related to. */
101
- tenantId: string;
102
- /** Unique Id for the event. */
103
- authenticationEventListenerId: string;
104
- /** The unique internal Id of the registered custom extension. */
105
- customAuthenticationExtensionId: string;
106
- }
107
- /**
108
- * Event request interface extended the related response and event data (payload) objects.
109
- */
110
- export declare interface AuthenticationEventRequest<TResponse extends AuthenticationEventResponse, TData extends AuthenticationEventData> extends AuthenticationEventRequestCommon {
111
- /** Related IEventResponse */
112
- response: TResponse;
113
- /** Related IEventData */
114
- payload: TData;
115
- }
116
- /**
117
- * Abstract base event interface to house common event request attributes.
118
- */
119
- export declare interface AuthenticationEventRequestCommon {
120
- /** Related Type */
121
- type: string;
122
- /** The status of the current request, see RequestStatus. */
123
- requestStatus: RequestStatus;
124
- /** A user friendly message (containing errors), that the authentication event returns. */
125
- statusMessage: string;
126
- /** A dictionary of query string parameters */
127
- queryParameters: Record<string, string>;
128
- }
129
- /**
130
- * Event response interface that houses attributes returned from the authentication events trigger.
131
- */
132
- export declare interface AuthenticationEventResponse {
133
- /** A template of the body of the expected response. */
134
- body: string;
135
- }
136
- /**
137
- * Event request interface extended the related response and event data (payload) objects for cloud events.
138
- */
139
- export declare interface CloudEventRequest<TResponse extends AuthenticationEventResponse, TData extends AuthenticationEventData> extends AuthenticationEventRequest<TResponse, TData> {
140
- /** Related Source */
141
- source: string;
142
- /** Related \@odata.type */
143
- oDataType: string;
144
- }
145
- /**
146
- * Helper function to create a files request
147
- * @param error - string or exception
148
- * @returns a valid FailedRequest object
149
- */
150
- export declare function createFailedRequest(error: unknown): FailedRequest;
151
- /** Helper function to create a provider claims for token */
152
- export declare function createProvideClaimsForToken(claims: TokenClaim): ProvideClaimsForToken;
153
- /**
154
- * Return the correctly formatted error
155
- * */
156
- export declare interface FailedRequest extends AuthenticationEventResponse {
157
- error: string;
158
- }
159
- /**
160
- * An Interface for the Provide Claims for token action.
161
- */
162
- export declare interface ProvideClaimsForToken extends TokenIssuanceStartAction {
163
- /** The 'Name' of the action in the JSON. */
164
- actionType: "microsoft.graph.ProvideClaimsForToken";
165
- /** Collection of claims to add to the token. */
166
- claims: TokenClaim;
167
- }
168
- /**
169
- * The status of the request.
170
- */
171
- export declare type RequestStatus = "Failed" | "TokenInvalid" | "Successful";
172
- /**
173
- * An type representing a claim.
174
- */
175
- export declare type TokenClaim = Record<string, string | string[]>;
176
- /**
177
- * All actions for the token issuance start event should extended this interface, as it looks the correct action to the correct event.
178
- */
179
- export declare interface TokenIssuanceStartAction extends AuthenticationEventAction {
180
- /** This will be the 'Name' of the action in the JSON. */
181
- actionType: string;
182
- }
183
- /**
184
- * The main data interface related to the request.
185
- */
186
- export declare interface TokenIssuanceStartData extends AuthenticationEventData {
187
- /** The main context of the data. */
188
- authenticationContext: AuthenticationEventContext;
189
- }
190
- /**
191
- * The main request interface, this will relate it's response and payload.
192
- */
193
- export declare interface TokenIssuanceStartRequest extends CloudEventRequest<TokenIssuanceStartResponse, TokenIssuanceStartData> {
194
- /** A dictionary of token claims. */
195
- tokenClaims?: Record<string, string>;
196
- }
197
- /**
198
- * The main response interface that is related to the request, this extends IActionable as the response
199
- * contains actions, we only allow actions that inherit the TokenIssuanceStartAction.
200
- */
201
- export declare type TokenIssuanceStartResponse = ActionableCloudEventResponse<TokenIssuanceStartAction>;
202
- export {};