@azure-rest/purview-sharing 1.0.0-beta.1 → 1.0.0-beta.4
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.
- package/CHANGELOG.md +28 -0
- package/LICENSE +4 -4
- package/README.md +74 -3
- package/dist/browser/clientDefinitions.d.ts +87 -0
- package/dist/browser/clientDefinitions.d.ts.map +1 -0
- package/dist/browser/clientDefinitions.js +4 -0
- package/dist/browser/clientDefinitions.js.map +1 -0
- package/dist/browser/index.d.ts +12 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +15 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/isUnexpected.d.ts +19 -0
- package/dist/browser/isUnexpected.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/isUnexpected.js +6 -6
- package/dist/browser/isUnexpected.js.map +1 -0
- package/dist/browser/logger.d.ts +2 -0
- package/dist/browser/logger.d.ts.map +1 -0
- package/dist/browser/logger.js +5 -0
- package/dist/browser/logger.js.map +1 -0
- package/dist/browser/models.d.ts +201 -0
- package/dist/browser/models.d.ts.map +1 -0
- package/dist/browser/models.js +4 -0
- package/dist/browser/models.js.map +1 -0
- package/dist/browser/outputModels.d.ts +352 -0
- package/dist/browser/outputModels.d.ts.map +1 -0
- package/dist/browser/outputModels.js +4 -0
- package/dist/browser/outputModels.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/dist/browser/paginateHelper.d.ts +68 -0
- package/dist/browser/paginateHelper.d.ts.map +1 -0
- package/{dist-esm/src → dist/browser}/paginateHelper.js +70 -3
- package/dist/browser/paginateHelper.js.map +1 -0
- package/dist/browser/parameters.d.ts +123 -0
- package/dist/browser/parameters.d.ts.map +1 -0
- package/dist/browser/parameters.js +4 -0
- package/dist/browser/parameters.js.map +1 -0
- package/dist/browser/pollingHelper.d.ts +76 -0
- package/dist/browser/pollingHelper.d.ts.map +1 -0
- package/dist/browser/pollingHelper.js +107 -0
- package/dist/browser/pollingHelper.js.map +1 -0
- package/dist/browser/purviewSharing.d.ts +16 -0
- package/dist/browser/purviewSharing.d.ts.map +1 -0
- package/dist/browser/purviewSharing.js +45 -0
- package/dist/browser/purviewSharing.js.map +1 -0
- package/dist/browser/responses.d.ts +304 -0
- package/dist/browser/responses.d.ts.map +1 -0
- package/dist/browser/responses.js +4 -0
- package/dist/browser/responses.js.map +1 -0
- package/dist/commonjs/clientDefinitions.d.ts +87 -0
- package/dist/commonjs/clientDefinitions.d.ts.map +1 -0
- package/dist/commonjs/clientDefinitions.js +5 -0
- package/dist/commonjs/clientDefinitions.js.map +1 -0
- package/dist/commonjs/index.d.ts +12 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +18 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/isUnexpected.d.ts +19 -0
- package/dist/commonjs/isUnexpected.d.ts.map +1 -0
- package/dist/commonjs/isUnexpected.js +88 -0
- package/dist/commonjs/isUnexpected.js.map +1 -0
- package/dist/commonjs/logger.d.ts +2 -0
- package/dist/commonjs/logger.d.ts.map +1 -0
- package/dist/commonjs/logger.js +8 -0
- package/dist/commonjs/logger.js.map +1 -0
- package/dist/commonjs/models.d.ts +201 -0
- package/dist/commonjs/models.d.ts.map +1 -0
- package/dist/commonjs/models.js +5 -0
- package/dist/commonjs/models.js.map +1 -0
- package/dist/commonjs/outputModels.d.ts +352 -0
- package/dist/commonjs/outputModels.d.ts.map +1 -0
- package/dist/commonjs/outputModels.js +5 -0
- package/dist/commonjs/outputModels.js.map +1 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/paginateHelper.d.ts +68 -0
- package/dist/commonjs/paginateHelper.d.ts.map +1 -0
- package/dist/commonjs/paginateHelper.js +140 -0
- package/dist/commonjs/paginateHelper.js.map +1 -0
- package/dist/commonjs/parameters.d.ts +123 -0
- package/dist/commonjs/parameters.d.ts.map +1 -0
- package/dist/commonjs/parameters.js +5 -0
- package/dist/commonjs/parameters.js.map +1 -0
- package/dist/commonjs/pollingHelper.d.ts +76 -0
- package/dist/commonjs/pollingHelper.d.ts.map +1 -0
- package/dist/commonjs/pollingHelper.js +110 -0
- package/dist/commonjs/pollingHelper.js.map +1 -0
- package/dist/commonjs/purviewSharing.d.ts +16 -0
- package/dist/commonjs/purviewSharing.d.ts.map +1 -0
- package/dist/commonjs/purviewSharing.js +48 -0
- package/dist/commonjs/purviewSharing.js.map +1 -0
- package/dist/commonjs/responses.d.ts +304 -0
- package/dist/commonjs/responses.d.ts.map +1 -0
- package/dist/commonjs/responses.js +5 -0
- package/dist/commonjs/responses.js.map +1 -0
- package/dist/commonjs/tsdoc-metadata.json +11 -0
- package/dist/esm/clientDefinitions.d.ts +87 -0
- package/dist/esm/clientDefinitions.d.ts.map +1 -0
- package/dist/esm/clientDefinitions.js +4 -0
- package/dist/esm/clientDefinitions.js.map +1 -0
- package/dist/esm/index.d.ts +12 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +15 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/isUnexpected.d.ts +19 -0
- package/dist/esm/isUnexpected.d.ts.map +1 -0
- package/dist/esm/isUnexpected.js +85 -0
- package/dist/esm/isUnexpected.js.map +1 -0
- package/dist/esm/logger.d.ts +2 -0
- package/dist/esm/logger.d.ts.map +1 -0
- package/dist/esm/logger.js +5 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/models.d.ts +201 -0
- package/dist/esm/models.d.ts.map +1 -0
- package/dist/esm/models.js +4 -0
- package/dist/esm/models.js.map +1 -0
- package/dist/esm/outputModels.d.ts +352 -0
- package/dist/esm/outputModels.d.ts.map +1 -0
- package/dist/esm/outputModels.js +4 -0
- package/dist/esm/outputModels.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/paginateHelper.d.ts +68 -0
- package/dist/esm/paginateHelper.d.ts.map +1 -0
- package/dist/esm/paginateHelper.js +137 -0
- package/dist/esm/paginateHelper.js.map +1 -0
- package/dist/esm/parameters.d.ts +123 -0
- package/dist/esm/parameters.d.ts.map +1 -0
- package/dist/esm/parameters.js +4 -0
- package/dist/esm/parameters.js.map +1 -0
- package/dist/esm/pollingHelper.d.ts +76 -0
- package/dist/esm/pollingHelper.d.ts.map +1 -0
- package/dist/esm/pollingHelper.js +107 -0
- package/dist/esm/pollingHelper.js.map +1 -0
- package/dist/esm/purviewSharing.d.ts +16 -0
- package/dist/esm/purviewSharing.d.ts.map +1 -0
- package/dist/esm/purviewSharing.js +45 -0
- package/dist/esm/purviewSharing.js.map +1 -0
- package/dist/esm/responses.d.ts +304 -0
- package/dist/esm/responses.d.ts.map +1 -0
- package/dist/esm/responses.js +4 -0
- package/dist/esm/responses.js.map +1 -0
- package/dist/react-native/clientDefinitions.d.ts +87 -0
- package/dist/react-native/clientDefinitions.d.ts.map +1 -0
- package/dist/react-native/clientDefinitions.js +4 -0
- package/dist/react-native/clientDefinitions.js.map +1 -0
- package/dist/react-native/index.d.ts +12 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +15 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/isUnexpected.d.ts +19 -0
- package/dist/react-native/isUnexpected.d.ts.map +1 -0
- package/dist/react-native/isUnexpected.js +85 -0
- package/dist/react-native/isUnexpected.js.map +1 -0
- package/dist/react-native/logger.d.ts +2 -0
- package/dist/react-native/logger.d.ts.map +1 -0
- package/dist/react-native/logger.js +5 -0
- package/dist/react-native/logger.js.map +1 -0
- package/dist/react-native/models.d.ts +201 -0
- package/dist/react-native/models.d.ts.map +1 -0
- package/dist/react-native/models.js +4 -0
- package/dist/react-native/models.js.map +1 -0
- package/dist/react-native/outputModels.d.ts +352 -0
- package/dist/react-native/outputModels.d.ts.map +1 -0
- package/dist/react-native/outputModels.js +4 -0
- package/dist/react-native/outputModels.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/paginateHelper.d.ts +68 -0
- package/dist/react-native/paginateHelper.d.ts.map +1 -0
- package/dist/react-native/paginateHelper.js +137 -0
- package/dist/react-native/paginateHelper.js.map +1 -0
- package/dist/react-native/parameters.d.ts +123 -0
- package/dist/react-native/parameters.d.ts.map +1 -0
- package/dist/react-native/parameters.js +4 -0
- package/dist/react-native/parameters.js.map +1 -0
- package/dist/react-native/pollingHelper.d.ts +76 -0
- package/dist/react-native/pollingHelper.d.ts.map +1 -0
- package/dist/react-native/pollingHelper.js +107 -0
- package/dist/react-native/pollingHelper.js.map +1 -0
- package/dist/react-native/purviewSharing.d.ts +16 -0
- package/dist/react-native/purviewSharing.d.ts.map +1 -0
- package/dist/react-native/purviewSharing.js +45 -0
- package/dist/react-native/purviewSharing.js.map +1 -0
- package/dist/react-native/responses.d.ts +304 -0
- package/dist/react-native/responses.d.ts.map +1 -0
- package/dist/react-native/responses.js +4 -0
- package/dist/react-native/responses.js.map +1 -0
- package/package.json +86 -78
- package/review/{purview-sharing.api.md → purview-sharing-node.api.md} +123 -19
- package/dist/index.js +0 -240
- package/dist/index.js.map +0 -1
- package/dist-esm/src/clientDefinitions.js +0 -4
- package/dist-esm/src/clientDefinitions.js.map +0 -1
- package/dist-esm/src/index.js +0 -14
- package/dist-esm/src/index.js.map +0 -1
- package/dist-esm/src/isUnexpected.js.map +0 -1
- package/dist-esm/src/models.js +0 -4
- package/dist-esm/src/models.js.map +0 -1
- package/dist-esm/src/outputModels.js +0 -4
- package/dist-esm/src/outputModels.js.map +0 -1
- package/dist-esm/src/paginateHelper.js.map +0 -1
- package/dist-esm/src/parameters.js +0 -4
- package/dist-esm/src/parameters.js.map +0 -1
- package/dist-esm/src/pollingHelper.js +0 -50
- package/dist-esm/src/pollingHelper.js.map +0 -1
- package/dist-esm/src/purviewSharing.js +0 -27
- package/dist-esm/src/purviewSharing.js.map +0 -1
- package/dist-esm/src/responses.js +0 -4
- package/dist-esm/src/responses.js.map +0 -1
- package/types/purview-sharing.d.ts +0 -1270
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
const responseMap = {
|
|
4
|
+
"GET /receivedShares/{receivedShareId}": ["200"],
|
|
5
|
+
"PUT /receivedShares/{receivedShareId}": ["200", "201"],
|
|
6
|
+
"DELETE /receivedShares/{receivedShareId}": ["202"],
|
|
7
|
+
"GET /receivedShares/attached": ["200"],
|
|
8
|
+
"GET /receivedShares/detached": ["200"],
|
|
9
|
+
"POST /emails:activate": ["200"],
|
|
10
|
+
"POST /emails:register": ["200"],
|
|
11
|
+
"GET /sentShares": ["200"],
|
|
12
|
+
"GET /sentShares/{sentShareId}": ["200"],
|
|
13
|
+
"PUT /sentShares/{sentShareId}": ["200", "201"],
|
|
14
|
+
"DELETE /sentShares/{sentShareId}": ["202"],
|
|
15
|
+
"GET /sentShares/{sentShareId}/sentShareInvitations": ["200"],
|
|
16
|
+
"GET /sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}": ["200"],
|
|
17
|
+
"PUT /sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}": ["201"],
|
|
18
|
+
"DELETE /sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}": ["202"],
|
|
19
|
+
"POST /sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}:notify": ["200"],
|
|
20
|
+
"GET /shareResources": ["200"],
|
|
21
|
+
};
|
|
22
|
+
export function isUnexpected(response) {
|
|
23
|
+
const lroOriginal = response.headers["x-ms-original-url"];
|
|
24
|
+
const url = new URL(lroOriginal ?? response.request.url);
|
|
25
|
+
const method = response.request.method;
|
|
26
|
+
let pathDetails = responseMap[`${method} ${url.pathname}`];
|
|
27
|
+
if (!pathDetails) {
|
|
28
|
+
pathDetails = getParametrizedPathSuccess(method, url.pathname);
|
|
29
|
+
}
|
|
30
|
+
return !pathDetails.includes(response.status);
|
|
31
|
+
}
|
|
32
|
+
function getParametrizedPathSuccess(method, path) {
|
|
33
|
+
const pathParts = path.split("/");
|
|
34
|
+
// Traverse list to match the longest candidate
|
|
35
|
+
// matchedLen: the length of candidate path
|
|
36
|
+
// matchedValue: the matched status code array
|
|
37
|
+
let matchedLen = -1, matchedValue = [];
|
|
38
|
+
// Iterate the responseMap to find a match
|
|
39
|
+
for (const [key, value] of Object.entries(responseMap)) {
|
|
40
|
+
// Extracting the path from the map key which is in format
|
|
41
|
+
// GET /path/foo
|
|
42
|
+
if (!key.startsWith(method)) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
const candidatePath = getPathFromMapKey(key);
|
|
46
|
+
// Get each part of the url path
|
|
47
|
+
const candidateParts = candidatePath.split("/");
|
|
48
|
+
// track if we have found a match to return the values found.
|
|
49
|
+
let found = true;
|
|
50
|
+
for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {
|
|
51
|
+
if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) {
|
|
52
|
+
const start = candidateParts[i].indexOf("}") + 1, end = candidateParts[i]?.length;
|
|
53
|
+
// If the current part of the candidate is a "template" part
|
|
54
|
+
// Try to use the suffix of pattern to match the path
|
|
55
|
+
// {guid} ==> $
|
|
56
|
+
// {guid}:export ==> :export$
|
|
57
|
+
const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(pathParts[j] || "");
|
|
58
|
+
if (!isMatched) {
|
|
59
|
+
found = false;
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
// If the candidate part is not a template and
|
|
65
|
+
// the parts don't match mark the candidate as not found
|
|
66
|
+
// to move on with the next candidate path.
|
|
67
|
+
if (candidateParts[i] !== pathParts[j]) {
|
|
68
|
+
found = false;
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// We finished evaluating the current candidate parts
|
|
73
|
+
// Update the matched value if and only if we found the longer pattern
|
|
74
|
+
if (found && candidatePath.length > matchedLen) {
|
|
75
|
+
matchedLen = candidatePath.length;
|
|
76
|
+
matchedValue = value;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return matchedValue;
|
|
80
|
+
}
|
|
81
|
+
function getPathFromMapKey(mapKey) {
|
|
82
|
+
const pathStart = mapKey.indexOf("/");
|
|
83
|
+
return mapKey.slice(pathStart);
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=isUnexpected.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isUnexpected.js","sourceRoot":"","sources":["../../src/isUnexpected.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAyClC,MAAM,WAAW,GAA6B;IAC5C,uCAAuC,EAAE,CAAC,KAAK,CAAC;IAChD,uCAAuC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;IACvD,0CAA0C,EAAE,CAAC,KAAK,CAAC;IACnD,8BAA8B,EAAE,CAAC,KAAK,CAAC;IACvC,8BAA8B,EAAE,CAAC,KAAK,CAAC;IACvC,uBAAuB,EAAE,CAAC,KAAK,CAAC;IAChC,uBAAuB,EAAE,CAAC,KAAK,CAAC;IAChC,iBAAiB,EAAE,CAAC,KAAK,CAAC;IAC1B,+BAA+B,EAAE,CAAC,KAAK,CAAC;IACxC,+BAA+B,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;IAC/C,kCAAkC,EAAE,CAAC,KAAK,CAAC;IAC3C,oDAAoD,EAAE,CAAC,KAAK,CAAC;IAC7D,4EAA4E,EAAE,CAAC,KAAK,CAAC;IACrF,4EAA4E,EAAE,CAAC,KAAK,CAAC;IACrF,+EAA+E,EAAE,CAAC,KAAK,CAAC;IACxF,oFAAoF,EAAE,CAAC,KAAK,CAAC;IAC7F,qBAAqB,EAAE,CAAC,KAAK,CAAC;CAC/B,CAAC;AAmFF,MAAM,UAAU,YAAY,CAC1B,QAoCqD;IAmBrD,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1D,MAA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CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACjC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n ReceivedSharesGetReceivedShare200Response,\n ReceivedSharesGetReceivedShareDefaultResponse,\n ReceivedSharesCreateOrReplace200Response,\n ReceivedSharesCreateOrReplace201Response,\n ReceivedSharesCreateOrReplaceDefaultResponse,\n ReceivedSharesDeleteReceivedShare202Response,\n ReceivedSharesDeleteReceivedShareDefaultResponse,\n ReceivedSharesGetAllAttachedReceivedShares200Response,\n ReceivedSharesGetAllAttachedReceivedSharesDefaultResponse,\n ReceivedSharesGetAllDetachedReceivedShares200Response,\n ReceivedSharesGetAllDetachedReceivedSharesDefaultResponse,\n ReceivedSharesActivateTenantEmailRegistration200Response,\n ReceivedSharesActivateTenantEmailRegistrationDefaultResponse,\n ReceivedSharesRegisterTenantEmailRegistration200Response,\n ReceivedSharesRegisterTenantEmailRegistrationDefaultResponse,\n SentSharesGetAllSentShares200Response,\n SentSharesGetAllSentSharesDefaultResponse,\n SentSharesGetSentShare200Response,\n SentSharesGetSentShareDefaultResponse,\n SentSharesCreateOrReplace200Response,\n SentSharesCreateOrReplace201Response,\n SentSharesCreateOrReplaceDefaultResponse,\n SentSharesDeleteSentShare202Response,\n SentSharesDeleteSentShareDefaultResponse,\n SentSharesGetAllSentShareInvitations200Response,\n SentSharesGetAllSentShareInvitationsDefaultResponse,\n SentSharesGetSentShareInvitation200Response,\n SentSharesGetSentShareInvitationDefaultResponse,\n SentSharesCreateSentShareInvitation201Response,\n SentSharesCreateSentShareInvitationDefaultResponse,\n SentSharesDeleteSentShareInvitation202Response,\n SentSharesDeleteSentShareInvitationDefaultResponse,\n SentSharesNotifyUserSentShareInvitation200Response,\n SentSharesNotifyUserSentShareInvitationDefaultResponse,\n ShareResourcesGetAllShareResources200Response,\n ShareResourcesGetAllShareResourcesDefaultResponse,\n} from \"./responses.js\";\n\nconst responseMap: Record<string, string[]> = {\n \"GET /receivedShares/{receivedShareId}\": [\"200\"],\n \"PUT /receivedShares/{receivedShareId}\": [\"200\", \"201\"],\n \"DELETE /receivedShares/{receivedShareId}\": [\"202\"],\n \"GET /receivedShares/attached\": [\"200\"],\n \"GET /receivedShares/detached\": [\"200\"],\n \"POST /emails:activate\": [\"200\"],\n \"POST /emails:register\": [\"200\"],\n \"GET /sentShares\": [\"200\"],\n \"GET /sentShares/{sentShareId}\": [\"200\"],\n \"PUT /sentShares/{sentShareId}\": [\"200\", \"201\"],\n \"DELETE /sentShares/{sentShareId}\": [\"202\"],\n \"GET /sentShares/{sentShareId}/sentShareInvitations\": [\"200\"],\n \"GET /sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}\": [\"200\"],\n \"PUT /sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}\": [\"201\"],\n \"DELETE /sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}\": [\"202\"],\n \"POST /sentShares/{sentShareId}/sentShareInvitations/{sentShareInvitationId}:notify\": [\"200\"],\n \"GET /shareResources\": [\"200\"],\n};\n\nexport function isUnexpected(\n response:\n | ReceivedSharesGetReceivedShare200Response\n | ReceivedSharesGetReceivedShareDefaultResponse,\n): response is ReceivedSharesGetReceivedShareDefaultResponse;\nexport function isUnexpected(\n response:\n | ReceivedSharesCreateOrReplace200Response\n | ReceivedSharesCreateOrReplace201Response\n | ReceivedSharesCreateOrReplaceDefaultResponse,\n): response is ReceivedSharesCreateOrReplaceDefaultResponse;\nexport function isUnexpected(\n response:\n | ReceivedSharesDeleteReceivedShare202Response\n | ReceivedSharesDeleteReceivedShareDefaultResponse,\n): response is ReceivedSharesDeleteReceivedShareDefaultResponse;\nexport function isUnexpected(\n response:\n | ReceivedSharesGetAllAttachedReceivedShares200Response\n | ReceivedSharesGetAllAttachedReceivedSharesDefaultResponse,\n): response is ReceivedSharesGetAllAttachedReceivedSharesDefaultResponse;\nexport function isUnexpected(\n response:\n | ReceivedSharesGetAllDetachedReceivedShares200Response\n | ReceivedSharesGetAllDetachedReceivedSharesDefaultResponse,\n): response is ReceivedSharesGetAllDetachedReceivedSharesDefaultResponse;\nexport function isUnexpected(\n response:\n | ReceivedSharesActivateTenantEmailRegistration200Response\n | ReceivedSharesActivateTenantEmailRegistrationDefaultResponse,\n): response is ReceivedSharesActivateTenantEmailRegistrationDefaultResponse;\nexport function isUnexpected(\n response:\n | ReceivedSharesRegisterTenantEmailRegistration200Response\n | ReceivedSharesRegisterTenantEmailRegistrationDefaultResponse,\n): response is ReceivedSharesRegisterTenantEmailRegistrationDefaultResponse;\nexport function isUnexpected(\n response: SentSharesGetAllSentShares200Response | SentSharesGetAllSentSharesDefaultResponse,\n): response is SentSharesGetAllSentSharesDefaultResponse;\nexport function isUnexpected(\n response: SentSharesGetSentShare200Response | SentSharesGetSentShareDefaultResponse,\n): response is SentSharesGetSentShareDefaultResponse;\nexport function isUnexpected(\n response:\n | SentSharesCreateOrReplace200Response\n | SentSharesCreateOrReplace201Response\n | SentSharesCreateOrReplaceDefaultResponse,\n): response is SentSharesCreateOrReplaceDefaultResponse;\nexport function isUnexpected(\n response: SentSharesDeleteSentShare202Response | SentSharesDeleteSentShareDefaultResponse,\n): response is SentSharesDeleteSentShareDefaultResponse;\nexport function isUnexpected(\n response:\n | SentSharesGetAllSentShareInvitations200Response\n | SentSharesGetAllSentShareInvitationsDefaultResponse,\n): response is SentSharesGetAllSentShareInvitationsDefaultResponse;\nexport function isUnexpected(\n response:\n | SentSharesGetSentShareInvitation200Response\n | SentSharesGetSentShareInvitationDefaultResponse,\n): response is SentSharesGetSentShareInvitationDefaultResponse;\nexport function isUnexpected(\n response:\n | SentSharesCreateSentShareInvitation201Response\n | SentSharesCreateSentShareInvitationDefaultResponse,\n): response is SentSharesCreateSentShareInvitationDefaultResponse;\nexport function isUnexpected(\n response:\n | SentSharesDeleteSentShareInvitation202Response\n | SentSharesDeleteSentShareInvitationDefaultResponse,\n): response is SentSharesDeleteSentShareInvitationDefaultResponse;\nexport function isUnexpected(\n response:\n | SentSharesNotifyUserSentShareInvitation200Response\n | SentSharesNotifyUserSentShareInvitationDefaultResponse,\n): response is SentSharesNotifyUserSentShareInvitationDefaultResponse;\nexport function isUnexpected(\n response:\n | ShareResourcesGetAllShareResources200Response\n | ShareResourcesGetAllShareResourcesDefaultResponse,\n): response is ShareResourcesGetAllShareResourcesDefaultResponse;\nexport function isUnexpected(\n response:\n | ReceivedSharesGetReceivedShare200Response\n | ReceivedSharesGetReceivedShareDefaultResponse\n | ReceivedSharesCreateOrReplace200Response\n | ReceivedSharesCreateOrReplace201Response\n | ReceivedSharesCreateOrReplaceDefaultResponse\n | ReceivedSharesDeleteReceivedShare202Response\n | ReceivedSharesDeleteReceivedShareDefaultResponse\n | ReceivedSharesGetAllAttachedReceivedShares200Response\n | ReceivedSharesGetAllAttachedReceivedSharesDefaultResponse\n | ReceivedSharesGetAllDetachedReceivedShares200Response\n | ReceivedSharesGetAllDetachedReceivedSharesDefaultResponse\n | ReceivedSharesActivateTenantEmailRegistration200Response\n | ReceivedSharesActivateTenantEmailRegistrationDefaultResponse\n | ReceivedSharesRegisterTenantEmailRegistration200Response\n | ReceivedSharesRegisterTenantEmailRegistrationDefaultResponse\n | SentSharesGetAllSentShares200Response\n | SentSharesGetAllSentSharesDefaultResponse\n | SentSharesGetSentShare200Response\n | SentSharesGetSentShareDefaultResponse\n | SentSharesCreateOrReplace200Response\n | SentSharesCreateOrReplace201Response\n | SentSharesCreateOrReplaceDefaultResponse\n | SentSharesDeleteSentShare202Response\n | SentSharesDeleteSentShareDefaultResponse\n | SentSharesGetAllSentShareInvitations200Response\n | SentSharesGetAllSentShareInvitationsDefaultResponse\n | SentSharesGetSentShareInvitation200Response\n | SentSharesGetSentShareInvitationDefaultResponse\n | SentSharesCreateSentShareInvitation201Response\n | SentSharesCreateSentShareInvitationDefaultResponse\n | SentSharesDeleteSentShareInvitation202Response\n | SentSharesDeleteSentShareInvitationDefaultResponse\n | SentSharesNotifyUserSentShareInvitation200Response\n | SentSharesNotifyUserSentShareInvitationDefaultResponse\n | ShareResourcesGetAllShareResources200Response\n | ShareResourcesGetAllShareResourcesDefaultResponse,\n): response is\n | ReceivedSharesGetReceivedShareDefaultResponse\n | ReceivedSharesCreateOrReplaceDefaultResponse\n | ReceivedSharesDeleteReceivedShareDefaultResponse\n | ReceivedSharesGetAllAttachedReceivedSharesDefaultResponse\n | ReceivedSharesGetAllDetachedReceivedSharesDefaultResponse\n | ReceivedSharesActivateTenantEmailRegistrationDefaultResponse\n | ReceivedSharesRegisterTenantEmailRegistrationDefaultResponse\n | SentSharesGetAllSentSharesDefaultResponse\n | SentSharesGetSentShareDefaultResponse\n | SentSharesCreateOrReplaceDefaultResponse\n | SentSharesDeleteSentShareDefaultResponse\n | SentSharesGetAllSentShareInvitationsDefaultResponse\n | SentSharesGetSentShareInvitationDefaultResponse\n | SentSharesCreateSentShareInvitationDefaultResponse\n | SentSharesDeleteSentShareInvitationDefaultResponse\n | SentSharesNotifyUserSentShareInvitationDefaultResponse\n | ShareResourcesGetAllShareResourcesDefaultResponse {\n const lroOriginal = response.headers[\"x-ms-original-url\"];\n const url = new URL(lroOriginal ?? response.request.url);\n const method = response.request.method;\n let pathDetails = responseMap[`${method} ${url.pathname}`];\n if (!pathDetails) {\n pathDetails = getParametrizedPathSuccess(method, url.pathname);\n }\n return !pathDetails.includes(response.status);\n}\n\nfunction getParametrizedPathSuccess(method: string, path: string): string[] {\n const pathParts = path.split(\"/\");\n\n // Traverse list to match the longest candidate\n // matchedLen: the length of candidate path\n // matchedValue: the matched status code array\n let matchedLen = -1,\n matchedValue: string[] = [];\n\n // Iterate the responseMap to find a match\n for (const [key, value] of Object.entries(responseMap)) {\n // Extracting the path from the map key which is in format\n // GET /path/foo\n if (!key.startsWith(method)) {\n continue;\n }\n const candidatePath = getPathFromMapKey(key);\n // Get each part of the url path\n const candidateParts = candidatePath.split(\"/\");\n\n // track if we have found a match to return the values found.\n let found = true;\n for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) {\n if (candidateParts[i]?.startsWith(\"{\") && candidateParts[i]?.indexOf(\"}\") !== -1) {\n const start = candidateParts[i]!.indexOf(\"}\") + 1,\n end = candidateParts[i]?.length;\n // If the current part of the candidate is a \"template\" part\n // Try to use the suffix of pattern to match the path\n // {guid} ==> $\n // {guid}:export ==> :export$\n const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test(\n pathParts[j] || \"\",\n );\n\n if (!isMatched) {\n found = false;\n break;\n }\n continue;\n }\n\n // If the candidate part is not a template and\n // the parts don't match mark the candidate as not found\n // to move on with the next candidate path.\n if (candidateParts[i] !== pathParts[j]) {\n found = false;\n break;\n }\n }\n\n // We finished evaluating the current candidate parts\n // Update the matched value if and only if we found the longer pattern\n if (found && candidatePath.length > matchedLen) {\n matchedLen = candidatePath.length;\n matchedValue = value;\n }\n }\n\n return matchedValue;\n}\n\nfunction getPathFromMapKey(mapKey: string): string {\n const pathStart = mapKey.indexOf(\"/\");\n return mapKey.slice(pathStart);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM,qCAAwC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createClientLogger } from \"@azure/logger\";\nexport const logger = createClientLogger(\"purview-sharing\");\n"]}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/** A received share data transfer object. */
|
|
2
|
+
export interface ReceivedShareParent extends ProxyResource {
|
|
3
|
+
shareKind: "ReceivedShare" | "InPlace";
|
|
4
|
+
}
|
|
5
|
+
/** Base data transfer object implementation for proxy resources. */
|
|
6
|
+
export interface ProxyResource {
|
|
7
|
+
}
|
|
8
|
+
/** A sent share data transfer object. */
|
|
9
|
+
export interface SentShareParent extends ProxyResource {
|
|
10
|
+
shareKind: "SentShare" | "InPlace";
|
|
11
|
+
}
|
|
12
|
+
/** A sent share invitation data transfer object. */
|
|
13
|
+
export interface SentShareInvitationParent extends ProxyResource {
|
|
14
|
+
invitationKind: "SentShareInvitation" | "Service" | "User";
|
|
15
|
+
}
|
|
16
|
+
/** A share resource. */
|
|
17
|
+
export interface ShareResource extends ProxyResource {
|
|
18
|
+
/** A count of Received Shares associated with the Microsoft.Azure.Purview.Share.ApiService.V3.DataTransferObjects.ShareResource. */
|
|
19
|
+
receivedSharesCount?: number;
|
|
20
|
+
/** A count of Sent Shares associated with the Microsoft.Azure.Purview.Share.ApiService.V3.DataTransferObjects.ShareResource. */
|
|
21
|
+
sentSharesCount?: number;
|
|
22
|
+
/** The types of asset. */
|
|
23
|
+
storeKind?: "AdlsGen2Account" | "BlobAccount";
|
|
24
|
+
/** A Store Reference for an artifact or sink. */
|
|
25
|
+
storeReference?: StoreReference;
|
|
26
|
+
}
|
|
27
|
+
/** A Store Reference for an artifact or sink. */
|
|
28
|
+
export interface StoreReference {
|
|
29
|
+
/** Reference name for resource associated with the sink or artifact. */
|
|
30
|
+
referenceName?: string;
|
|
31
|
+
/** Defines the type of resource being shared */
|
|
32
|
+
type?: "ArmResourceReference";
|
|
33
|
+
}
|
|
34
|
+
/** A tenant email registration data transfer object. */
|
|
35
|
+
export interface TenantEmailRegistration extends ProxyResource {
|
|
36
|
+
/** Tenant email registration property bag. */
|
|
37
|
+
properties?: TenantEmailRegistrationProperties;
|
|
38
|
+
}
|
|
39
|
+
/** Tenant email registration property bag. */
|
|
40
|
+
export interface TenantEmailRegistrationProperties {
|
|
41
|
+
/** Activation code for the registration. */
|
|
42
|
+
activationCode: string;
|
|
43
|
+
}
|
|
44
|
+
/** AdlsGen2 Sink */
|
|
45
|
+
export interface AdlsGen2AccountSink extends SinkParent {
|
|
46
|
+
/** Properties for AdlsGen2 storage account */
|
|
47
|
+
properties: AdlsGen2AccountSinkProperties;
|
|
48
|
+
storeKind: "AdlsGen2Account";
|
|
49
|
+
}
|
|
50
|
+
/** Properties for AdlsGen2 storage account */
|
|
51
|
+
export interface AdlsGen2AccountSinkProperties {
|
|
52
|
+
/** Adls Gen 2 Container Name */
|
|
53
|
+
containerName: string;
|
|
54
|
+
/** Adls Gen 2 Folder */
|
|
55
|
+
folder: string;
|
|
56
|
+
/** Adls Gen 2 Mount Path */
|
|
57
|
+
mountPath?: string;
|
|
58
|
+
}
|
|
59
|
+
/** Holds details on the destination of the mapped artifact */
|
|
60
|
+
export interface SinkParent {
|
|
61
|
+
/** A Store Reference for an artifact or sink. */
|
|
62
|
+
storeReference: StoreReference;
|
|
63
|
+
storeKind: "Sink" | "AdlsGen2Account" | "BlobAccount";
|
|
64
|
+
}
|
|
65
|
+
/** An Adls Gen2 storage account artifact. */
|
|
66
|
+
export interface AdlsGen2Artifact extends ArtifactParent {
|
|
67
|
+
/** Properties for Adls Gen2 storage account. */
|
|
68
|
+
properties: AdlsGen2ArtifactProperties;
|
|
69
|
+
storeKind: "AdlsGen2Account";
|
|
70
|
+
}
|
|
71
|
+
/** Properties for Adls Gen2 storage account. */
|
|
72
|
+
export interface AdlsGen2ArtifactProperties {
|
|
73
|
+
/** A list of Adls Gen2 storage account paths. */
|
|
74
|
+
paths: Array<StorageAccountPath>;
|
|
75
|
+
}
|
|
76
|
+
/** Defines a single StorageAccountPath path */
|
|
77
|
+
export interface StorageAccountPath {
|
|
78
|
+
/** Gets or sets the container name */
|
|
79
|
+
containerName: string;
|
|
80
|
+
/** Gets or sets the path on the receiver side where the artifact is to be mapped */
|
|
81
|
+
receiverPath?: string;
|
|
82
|
+
/** Gets or sets the path to file/folder within the container to be shared */
|
|
83
|
+
senderPath?: string;
|
|
84
|
+
}
|
|
85
|
+
/** A class for sent share artifact. */
|
|
86
|
+
export interface ArtifactParent {
|
|
87
|
+
/** A Store Reference for an artifact or sink. */
|
|
88
|
+
storeReference: StoreReference;
|
|
89
|
+
storeKind: "Artifact" | "AdlsGen2Account" | "BlobAccount";
|
|
90
|
+
}
|
|
91
|
+
/** Blob Sink */
|
|
92
|
+
export interface BlobAccountSink extends SinkParent {
|
|
93
|
+
/** Properties for blob storage account */
|
|
94
|
+
properties: BlobAccountSinkProperties;
|
|
95
|
+
storeKind: "BlobAccount";
|
|
96
|
+
}
|
|
97
|
+
/** Properties for blob storage account */
|
|
98
|
+
export interface BlobAccountSinkProperties {
|
|
99
|
+
/** Blob Container Name */
|
|
100
|
+
containerName: string;
|
|
101
|
+
/** Blob Folder */
|
|
102
|
+
folder: string;
|
|
103
|
+
/** Blob Mount Path */
|
|
104
|
+
mountPath?: string;
|
|
105
|
+
}
|
|
106
|
+
/** Blob storage account artifact. */
|
|
107
|
+
export interface BlobStorageArtifact extends ArtifactParent {
|
|
108
|
+
/** Properties for blob storage account. */
|
|
109
|
+
properties: BlobStorageArtifactProperties;
|
|
110
|
+
storeKind: "BlobAccount";
|
|
111
|
+
}
|
|
112
|
+
/** Properties for blob storage account. */
|
|
113
|
+
export interface BlobStorageArtifactProperties {
|
|
114
|
+
/** A list of blob storage account paths. */
|
|
115
|
+
paths: Array<StorageAccountPath>;
|
|
116
|
+
}
|
|
117
|
+
/** An InPlace received share kind. */
|
|
118
|
+
export interface InPlaceReceivedShare extends ReceivedShareParent {
|
|
119
|
+
/** Properties of in place received share. */
|
|
120
|
+
properties: InPlaceReceivedShareProperties;
|
|
121
|
+
shareKind: "InPlace";
|
|
122
|
+
}
|
|
123
|
+
/** Properties of in place received share. */
|
|
124
|
+
export interface InPlaceReceivedShareProperties {
|
|
125
|
+
/** The types of asset. */
|
|
126
|
+
assetStoreKind?: "AdlsGen2Account" | "BlobAccount";
|
|
127
|
+
/** Received Share Name */
|
|
128
|
+
displayName?: string;
|
|
129
|
+
/** Share status. */
|
|
130
|
+
shareStatus?: "Detached" | "Attached";
|
|
131
|
+
/** Holds details on the destination of the mapped artifact */
|
|
132
|
+
sink?: Sink;
|
|
133
|
+
}
|
|
134
|
+
/** An InPlace share kind. */
|
|
135
|
+
export interface InPlaceSentShare extends SentShareParent {
|
|
136
|
+
/** Properties for InPlace sent share. */
|
|
137
|
+
properties: InPlaceSentShareProperties;
|
|
138
|
+
shareKind: "InPlace";
|
|
139
|
+
}
|
|
140
|
+
/** Properties for InPlace sent share. */
|
|
141
|
+
export interface InPlaceSentShareProperties {
|
|
142
|
+
/** A class for sent share artifact. */
|
|
143
|
+
artifact: Artifact;
|
|
144
|
+
/** Sent share description. */
|
|
145
|
+
description?: string;
|
|
146
|
+
/** The name of the sent share */
|
|
147
|
+
displayName: string;
|
|
148
|
+
}
|
|
149
|
+
/** An service invitation kind. */
|
|
150
|
+
export interface ServiceInvitation extends SentShareInvitationParent {
|
|
151
|
+
/** Properties of the service invitation type. */
|
|
152
|
+
properties: ServiceInvitationProperties;
|
|
153
|
+
invitationKind: "Service";
|
|
154
|
+
}
|
|
155
|
+
/** Properties of the service invitation type. */
|
|
156
|
+
export interface ServiceInvitationProperties {
|
|
157
|
+
/** The time at which the invitation will expire. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */
|
|
158
|
+
expirationDate?: Date | string;
|
|
159
|
+
/** Share status. */
|
|
160
|
+
shareStatus?: "Detached" | "Attached";
|
|
161
|
+
/**
|
|
162
|
+
* The target azure active directory id the invitation is sent to.
|
|
163
|
+
*
|
|
164
|
+
* Value may contain a UUID
|
|
165
|
+
*/
|
|
166
|
+
targetActiveDirectoryId: string;
|
|
167
|
+
/**
|
|
168
|
+
* The target object id in the azure active directory the invitation is sent to.
|
|
169
|
+
*
|
|
170
|
+
* Value may contain a UUID
|
|
171
|
+
*/
|
|
172
|
+
targetObjectId: string;
|
|
173
|
+
}
|
|
174
|
+
/** A user invitation kind. */
|
|
175
|
+
export interface UserInvitation extends SentShareInvitationParent {
|
|
176
|
+
/** Properties of the user invitation type. */
|
|
177
|
+
properties: UserInvitationProperties;
|
|
178
|
+
invitationKind: "User";
|
|
179
|
+
}
|
|
180
|
+
/** Properties of the user invitation type. */
|
|
181
|
+
export interface UserInvitationProperties {
|
|
182
|
+
/** The time at which the invitation will expire. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */
|
|
183
|
+
expirationDate?: Date | string;
|
|
184
|
+
/** Whether or not the recipient was notified via email. */
|
|
185
|
+
notify?: boolean;
|
|
186
|
+
/** Share status. */
|
|
187
|
+
shareStatus?: "Detached" | "Attached";
|
|
188
|
+
/** The receiver email for the invitation is being sent. */
|
|
189
|
+
targetEmail: string;
|
|
190
|
+
}
|
|
191
|
+
/** A received share data transfer object. */
|
|
192
|
+
export type ReceivedShare = InPlaceReceivedShare;
|
|
193
|
+
/** A sent share data transfer object. */
|
|
194
|
+
export type SentShare = InPlaceSentShare;
|
|
195
|
+
/** A sent share invitation data transfer object. */
|
|
196
|
+
export type SentShareInvitation = ServiceInvitation | UserInvitation;
|
|
197
|
+
/** Holds details on the destination of the mapped artifact */
|
|
198
|
+
export type Sink = AdlsGen2AccountSink | BlobAccountSink;
|
|
199
|
+
/** A class for sent share artifact. */
|
|
200
|
+
export type Artifact = AdlsGen2Artifact | BlobStorageArtifact;
|
|
201
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAGA,6CAA6C;AAC7C,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACxD,SAAS,EAAE,eAAe,GAAG,SAAS,CAAC;CACxC;AAED,oEAAoE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B;AAC9B,MAAM,WAAW,cAAe,SAAQ,yBAAyB;IAC/D,8CAA8C;IAC9C,UAAU,EAAE,wBAAwB,CAAC;IACrC,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,8CAA8C;AAC9C,MAAM,WAAW,wBAAwB;IACvC,kKAAkK;IAClK,cAAc,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC;IAC/B,2DAA2D;IAC3D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oBAAoB;IACpB,WAAW,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IACtC,2DAA2D;IAC3D,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,6CAA6C;AAC7C,MAAM,MAAM,aAAa,GAAG,oBAAoB,CAAC;AACjD,yCAAyC;AACzC,MAAM,MAAM,SAAS,GAAG,gBAAgB,CAAC;AACzC,oDAAoD;AACpD,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,GAAG,cAAc,CAAC;AACrE,8DAA8D;AAC9D,MAAM,MAAM,IAAI,GAAG,mBAAmB,GAAG,eAAe,CAAC;AACzD,uCAAuC;AACvC,MAAM,MAAM,QAAQ,GAAG,gBAAgB,GAAG,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/** A received share data transfer object. */\nexport interface ReceivedShareParent extends ProxyResource {\n shareKind: \"ReceivedShare\" | \"InPlace\";\n}\n\n/** Base data transfer object implementation for proxy resources. */\nexport interface ProxyResource {}\n\n/** A sent share data transfer object. */\nexport interface SentShareParent extends ProxyResource {\n shareKind: \"SentShare\" | \"InPlace\";\n}\n\n/** A sent share invitation data transfer object. */\nexport interface SentShareInvitationParent extends ProxyResource {\n invitationKind: \"SentShareInvitation\" | \"Service\" | \"User\";\n}\n\n/** A share resource. */\nexport interface ShareResource extends ProxyResource {\n /** A count of Received Shares associated with the Microsoft.Azure.Purview.Share.ApiService.V3.DataTransferObjects.ShareResource. */\n receivedSharesCount?: number;\n /** A count of Sent Shares associated with the Microsoft.Azure.Purview.Share.ApiService.V3.DataTransferObjects.ShareResource. */\n sentSharesCount?: number;\n /** The types of asset. */\n storeKind?: \"AdlsGen2Account\" | \"BlobAccount\";\n /** A Store Reference for an artifact or sink. */\n storeReference?: StoreReference;\n}\n\n/** A Store Reference for an artifact or sink. */\nexport interface StoreReference {\n /** Reference name for resource associated with the sink or artifact. */\n referenceName?: string;\n /** Defines the type of resource being shared */\n type?: \"ArmResourceReference\";\n}\n\n/** A tenant email registration data transfer object. */\nexport interface TenantEmailRegistration extends ProxyResource {\n /** Tenant email registration property bag. */\n properties?: TenantEmailRegistrationProperties;\n}\n\n/** Tenant email registration property bag. */\nexport interface TenantEmailRegistrationProperties {\n /** Activation code for the registration. */\n activationCode: string;\n}\n\n/** AdlsGen2 Sink */\nexport interface AdlsGen2AccountSink extends SinkParent {\n /** Properties for AdlsGen2 storage account */\n properties: AdlsGen2AccountSinkProperties;\n storeKind: \"AdlsGen2Account\";\n}\n\n/** Properties for AdlsGen2 storage account */\nexport interface AdlsGen2AccountSinkProperties {\n /** Adls Gen 2 Container Name */\n containerName: string;\n /** Adls Gen 2 Folder */\n folder: string;\n /** Adls Gen 2 Mount Path */\n mountPath?: string;\n}\n\n/** Holds details on the destination of the mapped artifact */\nexport interface SinkParent {\n /** A Store Reference for an artifact or sink. */\n storeReference: StoreReference;\n storeKind: \"Sink\" | \"AdlsGen2Account\" | \"BlobAccount\";\n}\n\n/** An Adls Gen2 storage account artifact. */\nexport interface AdlsGen2Artifact extends ArtifactParent {\n /** Properties for Adls Gen2 storage account. */\n properties: AdlsGen2ArtifactProperties;\n storeKind: \"AdlsGen2Account\";\n}\n\n/** Properties for Adls Gen2 storage account. */\nexport interface AdlsGen2ArtifactProperties {\n /** A list of Adls Gen2 storage account paths. */\n paths: Array<StorageAccountPath>;\n}\n\n/** Defines a single StorageAccountPath path */\nexport interface StorageAccountPath {\n /** Gets or sets the container name */\n containerName: string;\n /** Gets or sets the path on the receiver side where the artifact is to be mapped */\n receiverPath?: string;\n /** Gets or sets the path to file/folder within the container to be shared */\n senderPath?: string;\n}\n\n/** A class for sent share artifact. */\nexport interface ArtifactParent {\n /** A Store Reference for an artifact or sink. */\n storeReference: StoreReference;\n storeKind: \"Artifact\" | \"AdlsGen2Account\" | \"BlobAccount\";\n}\n\n/** Blob Sink */\nexport interface BlobAccountSink extends SinkParent {\n /** Properties for blob storage account */\n properties: BlobAccountSinkProperties;\n storeKind: \"BlobAccount\";\n}\n\n/** Properties for blob storage account */\nexport interface BlobAccountSinkProperties {\n /** Blob Container Name */\n containerName: string;\n /** Blob Folder */\n folder: string;\n /** Blob Mount Path */\n mountPath?: string;\n}\n\n/** Blob storage account artifact. */\nexport interface BlobStorageArtifact extends ArtifactParent {\n /** Properties for blob storage account. */\n properties: BlobStorageArtifactProperties;\n storeKind: \"BlobAccount\";\n}\n\n/** Properties for blob storage account. */\nexport interface BlobStorageArtifactProperties {\n /** A list of blob storage account paths. */\n paths: Array<StorageAccountPath>;\n}\n\n/** An InPlace received share kind. */\nexport interface InPlaceReceivedShare extends ReceivedShareParent {\n /** Properties of in place received share. */\n properties: InPlaceReceivedShareProperties;\n shareKind: \"InPlace\";\n}\n\n/** Properties of in place received share. */\nexport interface InPlaceReceivedShareProperties {\n /** The types of asset. */\n assetStoreKind?: \"AdlsGen2Account\" | \"BlobAccount\";\n /** Received Share Name */\n displayName?: string;\n /** Share status. */\n shareStatus?: \"Detached\" | \"Attached\";\n /** Holds details on the destination of the mapped artifact */\n sink?: Sink;\n}\n\n/** An InPlace share kind. */\nexport interface InPlaceSentShare extends SentShareParent {\n /** Properties for InPlace sent share. */\n properties: InPlaceSentShareProperties;\n shareKind: \"InPlace\";\n}\n\n/** Properties for InPlace sent share. */\nexport interface InPlaceSentShareProperties {\n /** A class for sent share artifact. */\n artifact: Artifact;\n /** Sent share description. */\n description?: string;\n /** The name of the sent share */\n displayName: string;\n}\n\n/** An service invitation kind. */\nexport interface ServiceInvitation extends SentShareInvitationParent {\n /** Properties of the service invitation type. */\n properties: ServiceInvitationProperties;\n invitationKind: \"Service\";\n}\n\n/** Properties of the service invitation type. */\nexport interface ServiceInvitationProperties {\n /** The time at which the invitation will expire. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */\n expirationDate?: Date | string;\n /** Share status. */\n shareStatus?: \"Detached\" | \"Attached\";\n /**\n * The target azure active directory id the invitation is sent to.\n *\n * Value may contain a UUID\n */\n targetActiveDirectoryId: string;\n /**\n * The target object id in the azure active directory the invitation is sent to.\n *\n * Value may contain a UUID\n */\n targetObjectId: string;\n}\n\n/** A user invitation kind. */\nexport interface UserInvitation extends SentShareInvitationParent {\n /** Properties of the user invitation type. */\n properties: UserInvitationProperties;\n invitationKind: \"User\";\n}\n\n/** Properties of the user invitation type. */\nexport interface UserInvitationProperties {\n /** The time at which the invitation will expire. Represented in the standard date-time format as defined by [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) */\n expirationDate?: Date | string;\n /** Whether or not the recipient was notified via email. */\n notify?: boolean;\n /** Share status. */\n shareStatus?: \"Detached\" | \"Attached\";\n /** The receiver email for the invitation is being sent. */\n targetEmail: string;\n}\n\n/** A received share data transfer object. */\nexport type ReceivedShare = InPlaceReceivedShare;\n/** A sent share data transfer object. */\nexport type SentShare = InPlaceSentShare;\n/** A sent share invitation data transfer object. */\nexport type SentShareInvitation = ServiceInvitation | UserInvitation;\n/** Holds details on the destination of the mapped artifact */\nexport type Sink = AdlsGen2AccountSink | BlobAccountSink;\n/** A class for sent share artifact. */\nexport type Artifact = AdlsGen2Artifact | BlobStorageArtifact;\n"]}
|