@activeboxes/pieces-framework 0.7.4-2.0
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/README.md +11 -0
- package/package.json +27 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +5 -0
- package/src/index.js.map +1 -0
- package/src/lib/action/action.d.ts +45 -0
- package/src/lib/action/action.js +40 -0
- package/src/lib/action/action.js.map +1 -0
- package/src/lib/context.d.ts +122 -0
- package/src/lib/context.js +10 -0
- package/src/lib/context.js.map +1 -0
- package/src/lib/index.d.ts +7 -0
- package/src/lib/index.js +11 -0
- package/src/lib/index.js.map +1 -0
- package/src/lib/piece-metadata.d.ts +3267 -0
- package/src/lib/piece-metadata.js +75 -0
- package/src/lib/piece-metadata.js.map +1 -0
- package/src/lib/piece.d.ts +52 -0
- package/src/lib/piece.js +53 -0
- package/src/lib/piece.js.map +1 -0
- package/src/lib/property/authentication/basic-auth-prop.d.ts +33 -0
- package/src/lib/property/authentication/basic-auth-prop.js +26 -0
- package/src/lib/property/authentication/basic-auth-prop.js.map +1 -0
- package/src/lib/property/authentication/common.d.ts +16 -0
- package/src/lib/property/authentication/common.js +9 -0
- package/src/lib/property/authentication/common.js.map +1 -0
- package/src/lib/property/authentication/custom-auth-prop.d.ts +53 -0
- package/src/lib/property/authentication/custom-auth-prop.js +26 -0
- package/src/lib/property/authentication/custom-auth-prop.js.map +1 -0
- package/src/lib/property/authentication/index.d.ts +109 -0
- package/src/lib/property/authentication/index.js +33 -0
- package/src/lib/property/authentication/index.js.map +1 -0
- package/src/lib/property/authentication/oauth2-prop.d.ts +180 -0
- package/src/lib/property/authentication/oauth2-prop.js +43 -0
- package/src/lib/property/authentication/oauth2-prop.js.map +1 -0
- package/src/lib/property/authentication/secret-text-property.d.ts +10 -0
- package/src/lib/property/authentication/secret-text-property.js +14 -0
- package/src/lib/property/authentication/secret-text-property.js.map +1 -0
- package/src/lib/property/index.d.ts +682 -0
- package/src/lib/property/index.js +76 -0
- package/src/lib/property/index.js.map +1 -0
- package/src/lib/property/input/array-property.d.ts +133 -0
- package/src/lib/property/input/array-property.js +30 -0
- package/src/lib/property/input/array-property.js.map +1 -0
- package/src/lib/property/input/checkbox-property.d.ts +9 -0
- package/src/lib/property/input/checkbox-property.js +11 -0
- package/src/lib/property/input/checkbox-property.js.map +1 -0
- package/src/lib/property/input/common.d.ts +15 -0
- package/src/lib/property/input/common.js +15 -0
- package/src/lib/property/input/common.js.map +1 -0
- package/src/lib/property/input/date-time-property.d.ts +9 -0
- package/src/lib/property/input/date-time-property.js +11 -0
- package/src/lib/property/input/date-time-property.js.map +1 -0
- package/src/lib/property/input/dropdown/common.d.ts +21 -0
- package/src/lib/property/input/dropdown/common.js +14 -0
- package/src/lib/property/input/dropdown/common.js.map +1 -0
- package/src/lib/property/input/dropdown/dropdown-prop.d.ts +27 -0
- package/src/lib/property/input/dropdown/dropdown-prop.js +21 -0
- package/src/lib/property/input/dropdown/dropdown-prop.js.map +1 -0
- package/src/lib/property/input/dropdown/static-dropdown.d.ts +37 -0
- package/src/lib/property/input/dropdown/static-dropdown.js +22 -0
- package/src/lib/property/input/dropdown/static-dropdown.js.map +1 -0
- package/src/lib/property/input/dynamic-prop.d.ts +218 -0
- package/src/lib/property/input/dynamic-prop.js +26 -0
- package/src/lib/property/input/dynamic-prop.js.map +1 -0
- package/src/lib/property/input/file-property.d.ts +16 -0
- package/src/lib/property/input/file-property.js +22 -0
- package/src/lib/property/input/file-property.js.map +1 -0
- package/src/lib/property/input/index.d.ts +186 -0
- package/src/lib/property/input/index.js +91 -0
- package/src/lib/property/input/index.js.map +1 -0
- package/src/lib/property/input/json-property.d.ts +9 -0
- package/src/lib/property/input/json-property.js +11 -0
- package/src/lib/property/input/json-property.js.map +1 -0
- package/src/lib/property/input/markdown-property.d.ts +12 -0
- package/src/lib/property/input/markdown-property.js +11 -0
- package/src/lib/property/input/markdown-property.js.map +1 -0
- package/src/lib/property/input/number-property.d.ts +9 -0
- package/src/lib/property/input/number-property.js +11 -0
- package/src/lib/property/input/number-property.js.map +1 -0
- package/src/lib/property/input/object-property.d.ts +9 -0
- package/src/lib/property/input/object-property.js +11 -0
- package/src/lib/property/input/object-property.js.map +1 -0
- package/src/lib/property/input/property-type.d.ts +21 -0
- package/src/lib/property/input/property-type.js +26 -0
- package/src/lib/property/input/property-type.js.map +1 -0
- package/src/lib/property/input/text-property.d.ts +16 -0
- package/src/lib/property/input/text-property.js +15 -0
- package/src/lib/property/input/text-property.js.map +1 -0
- package/src/lib/trigger/trigger.d.ts +85 -0
- package/src/lib/trigger/trigger.js +74 -0
- package/src/lib/trigger/trigger.js.map +1 -0
- package/src/lib/validators/index.d.ts +1 -0
- package/src/lib/validators/index.js +5 -0
- package/src/lib/validators/index.js.map +1 -0
@@ -0,0 +1,75 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.PieceMetadataModelSummary = exports.PieceMetadataModel = exports.PieceMetadataSummary = exports.PieceMetadata = exports.TriggerBase = exports.ActionBase = exports.PieceBase = void 0;
|
4
|
+
const property_1 = require("./property");
|
5
|
+
const trigger_1 = require("./trigger/trigger");
|
6
|
+
const action_1 = require("./action/action");
|
7
|
+
const authentication_1 = require("./property/authentication");
|
8
|
+
const typebox_1 = require("@sinclair/typebox");
|
9
|
+
const shared_1 = require("@activeboxes/shared");
|
10
|
+
exports.PieceBase = typebox_1.Type.Object({
|
11
|
+
id: typebox_1.Type.Optional(typebox_1.Type.String()),
|
12
|
+
name: typebox_1.Type.String(),
|
13
|
+
displayName: typebox_1.Type.String(),
|
14
|
+
logoUrl: typebox_1.Type.String(),
|
15
|
+
description: typebox_1.Type.String(),
|
16
|
+
projectId: typebox_1.Type.Optional(typebox_1.Type.String()),
|
17
|
+
authors: typebox_1.Type.Array(typebox_1.Type.String()),
|
18
|
+
platformId: typebox_1.Type.Optional(typebox_1.Type.String()),
|
19
|
+
directoryPath: typebox_1.Type.Optional(typebox_1.Type.String()),
|
20
|
+
auth: typebox_1.Type.Optional(authentication_1.PieceAuthProperty),
|
21
|
+
version: typebox_1.Type.String(),
|
22
|
+
categories: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.Enum(shared_1.PieceCategory))),
|
23
|
+
minimumSupportedRelease: typebox_1.Type.Optional(typebox_1.Type.String()),
|
24
|
+
maximumSupportedRelease: typebox_1.Type.Optional(typebox_1.Type.String()),
|
25
|
+
});
|
26
|
+
exports.ActionBase = typebox_1.Type.Object({
|
27
|
+
name: typebox_1.Type.String(),
|
28
|
+
displayName: typebox_1.Type.String(),
|
29
|
+
description: typebox_1.Type.String(),
|
30
|
+
props: property_1.PiecePropertyMap,
|
31
|
+
requireAuth: typebox_1.Type.Boolean(),
|
32
|
+
errorHandlingOptions: typebox_1.Type.Optional(action_1.ErrorHandlingOptionsParam),
|
33
|
+
});
|
34
|
+
exports.TriggerBase = typebox_1.Type.Composite([
|
35
|
+
typebox_1.Type.Omit(exports.ActionBase, ["requireAuth"]),
|
36
|
+
typebox_1.Type.Object({
|
37
|
+
type: typebox_1.Type.Enum(trigger_1.TriggerStrategy),
|
38
|
+
sampleData: typebox_1.Type.Unknown(),
|
39
|
+
handshakeConfiguration: typebox_1.Type.Optional(trigger_1.WebhookHandshakeConfiguration),
|
40
|
+
renewConfiguration: typebox_1.Type.Optional(trigger_1.WebhookRenewConfiguration),
|
41
|
+
testStrategy: typebox_1.Type.Enum(shared_1.TriggerTestStrategy),
|
42
|
+
})
|
43
|
+
]);
|
44
|
+
exports.PieceMetadata = typebox_1.Type.Composite([
|
45
|
+
exports.PieceBase,
|
46
|
+
typebox_1.Type.Object({
|
47
|
+
actions: typebox_1.Type.Record(typebox_1.Type.String(), exports.ActionBase),
|
48
|
+
triggers: typebox_1.Type.Record(typebox_1.Type.String(), exports.TriggerBase),
|
49
|
+
})
|
50
|
+
]);
|
51
|
+
exports.PieceMetadataSummary = typebox_1.Type.Composite([
|
52
|
+
typebox_1.Type.Omit(exports.PieceMetadata, ["actions", "triggers"]),
|
53
|
+
typebox_1.Type.Object({
|
54
|
+
actions: typebox_1.Type.Number(),
|
55
|
+
triggers: typebox_1.Type.Number(),
|
56
|
+
suggestedActions: typebox_1.Type.Optional(typebox_1.Type.Array(exports.TriggerBase)),
|
57
|
+
suggestedTriggers: typebox_1.Type.Optional(typebox_1.Type.Array(exports.ActionBase)),
|
58
|
+
})
|
59
|
+
]);
|
60
|
+
const PiecePackageMetadata = typebox_1.Type.Object({
|
61
|
+
projectUsage: typebox_1.Type.Number(),
|
62
|
+
tags: typebox_1.Type.Optional(typebox_1.Type.Array(typebox_1.Type.String())),
|
63
|
+
pieceType: typebox_1.Type.Enum(shared_1.PieceType),
|
64
|
+
packageType: typebox_1.Type.Enum(shared_1.PackageType),
|
65
|
+
archiveId: typebox_1.Type.Optional(typebox_1.Type.String()),
|
66
|
+
});
|
67
|
+
exports.PieceMetadataModel = typebox_1.Type.Composite([
|
68
|
+
exports.PieceMetadata,
|
69
|
+
PiecePackageMetadata,
|
70
|
+
]);
|
71
|
+
exports.PieceMetadataModelSummary = typebox_1.Type.Composite([
|
72
|
+
exports.PieceMetadataSummary,
|
73
|
+
PiecePackageMetadata,
|
74
|
+
]);
|
75
|
+
//# sourceMappingURL=piece-metadata.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"piece-metadata.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/community/framework/src/lib/piece-metadata.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAC9C,+CAA8G;AAC9G,4CAA4D;AAC5D,8DAA8D;AAC9D,+CAAiD;AACjD,gDAA4G;AAE/F,QAAA,SAAS,GAAG,cAAI,CAAC,MAAM,CAAC;IACnC,EAAE,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,EAAE,CAAC;IAChC,IAAI,EAAE,cAAI,CAAC,MAAM,EAAE;IACnB,WAAW,EAAE,cAAI,CAAC,MAAM,EAAE;IAC1B,O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CAAC,CAAC;IAC9C,SAAS,EAAE,cAAI,CAAC,IAAI,CAAC,kBAAS,CAAC;IAC/B,WAAW,EAAE,cAAI,CAAC,IAAI,CAAC,oBAAW,CAAC;IACnC,SAAS,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,EAAE,CAAC;CACxC,CAAC,CAAA;AAGW,QAAA,kBAAkB,GAAG,cAAI,CAAC,SAAS,CAAC;IAC/C,qBAAa;IACb,oBAAoB;CACrB,CAAC,CAAA;AAGW,QAAA,yBAAyB,GAAG,cAAI,CAAC,SAAS,CAAC;IACtD,4BAAoB;IACpB,oBAAoB;CACrB,CAAC,CAAA"}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import { Trigger } from './trigger/trigger';
|
2
|
+
import { Action } from './action/action';
|
3
|
+
import { EventPayload, ParseEventResponse, PieceCategory } from '@activeboxes/shared';
|
4
|
+
import { PieceBase, PieceMetadata } from './piece-metadata';
|
5
|
+
import { PieceAuthProperty } from './property/authentication';
|
6
|
+
export declare class Piece<PieceAuth extends PieceAuthProperty = PieceAuthProperty> implements Omit<PieceBase, 'version' | 'name'> {
|
7
|
+
readonly displayName: string;
|
8
|
+
readonly logoUrl: string;
|
9
|
+
readonly authors: string[];
|
10
|
+
readonly events: PieceEventProcessors | undefined;
|
11
|
+
readonly categories: PieceCategory[];
|
12
|
+
readonly auth?: PieceAuth | undefined;
|
13
|
+
readonly minimumSupportedRelease?: string | undefined;
|
14
|
+
readonly maximumSupportedRelease?: string | undefined;
|
15
|
+
readonly description: string;
|
16
|
+
private readonly _actions;
|
17
|
+
private readonly _triggers;
|
18
|
+
constructor(displayName: string, logoUrl: string, authors: string[], events: PieceEventProcessors | undefined, actions: Action<PieceAuth>[], triggers: Trigger<PieceAuth>[], categories: PieceCategory[], auth?: PieceAuth | undefined, minimumSupportedRelease?: string | undefined, maximumSupportedRelease?: string | undefined, description?: string);
|
19
|
+
metadata(): BackwardCompatiblePieceMetadata;
|
20
|
+
getAction(actionName: string): Action | undefined;
|
21
|
+
getTrigger(triggerName: string): Trigger | undefined;
|
22
|
+
actions(): Record<string, Action>;
|
23
|
+
triggers(): Record<string, Trigger>;
|
24
|
+
}
|
25
|
+
export declare const createPiece: <PieceAuth extends PieceAuthProperty>(params: CreatePieceParams<PieceAuth>) => Piece<PieceAuth>;
|
26
|
+
type CreatePieceParams<PieceAuth extends PieceAuthProperty = PieceAuthProperty> = {
|
27
|
+
displayName: string;
|
28
|
+
logoUrl: string;
|
29
|
+
authors: string[];
|
30
|
+
description?: string;
|
31
|
+
auth: PieceAuth | undefined;
|
32
|
+
events?: PieceEventProcessors;
|
33
|
+
minimumSupportedRelease?: string;
|
34
|
+
maximumSupportedRelease?: string;
|
35
|
+
actions: Action<PieceAuth>[];
|
36
|
+
triggers: Trigger<PieceAuth>[];
|
37
|
+
categories?: PieceCategory[];
|
38
|
+
};
|
39
|
+
type PieceEventProcessors = {
|
40
|
+
parseAndReply: (ctx: {
|
41
|
+
payload: EventPayload;
|
42
|
+
}) => ParseEventResponse;
|
43
|
+
verify: (ctx: {
|
44
|
+
webhookSecret: string;
|
45
|
+
payload: EventPayload;
|
46
|
+
appWebhookUrl: string;
|
47
|
+
}) => boolean;
|
48
|
+
};
|
49
|
+
type BackwardCompatiblePieceMetadata = Omit<PieceMetadata, 'name' | 'version' | 'authors'> & {
|
50
|
+
authors?: PieceMetadata['authors'];
|
51
|
+
};
|
52
|
+
export {};
|
package/src/lib/piece.js
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.createPiece = exports.Piece = void 0;
|
4
|
+
class Piece {
|
5
|
+
constructor(displayName, logoUrl, authors, events, actions, triggers, categories, auth, minimumSupportedRelease, maximumSupportedRelease, description = '') {
|
6
|
+
this.displayName = displayName;
|
7
|
+
this.logoUrl = logoUrl;
|
8
|
+
this.authors = authors;
|
9
|
+
this.events = events;
|
10
|
+
this.categories = categories;
|
11
|
+
this.auth = auth;
|
12
|
+
this.minimumSupportedRelease = minimumSupportedRelease;
|
13
|
+
this.maximumSupportedRelease = maximumSupportedRelease;
|
14
|
+
this.description = description;
|
15
|
+
this._actions = {};
|
16
|
+
this._triggers = {};
|
17
|
+
actions.forEach((action) => (this._actions[action.name] = action));
|
18
|
+
triggers.forEach((trigger) => (this._triggers[trigger.name] = trigger));
|
19
|
+
}
|
20
|
+
metadata() {
|
21
|
+
return {
|
22
|
+
displayName: this.displayName,
|
23
|
+
logoUrl: this.logoUrl,
|
24
|
+
actions: this._actions,
|
25
|
+
triggers: this._triggers,
|
26
|
+
categories: this.categories,
|
27
|
+
description: this.description,
|
28
|
+
authors: this.authors,
|
29
|
+
auth: this.auth,
|
30
|
+
minimumSupportedRelease: this.minimumSupportedRelease,
|
31
|
+
maximumSupportedRelease: this.maximumSupportedRelease,
|
32
|
+
};
|
33
|
+
}
|
34
|
+
getAction(actionName) {
|
35
|
+
return this._actions[actionName];
|
36
|
+
}
|
37
|
+
getTrigger(triggerName) {
|
38
|
+
return this._triggers[triggerName];
|
39
|
+
}
|
40
|
+
actions() {
|
41
|
+
return this._actions;
|
42
|
+
}
|
43
|
+
triggers() {
|
44
|
+
return this._triggers;
|
45
|
+
}
|
46
|
+
}
|
47
|
+
exports.Piece = Piece;
|
48
|
+
const createPiece = (params) => {
|
49
|
+
var _a, _b, _c;
|
50
|
+
return new Piece(params.displayName, params.logoUrl, (_a = params.authors) !== null && _a !== void 0 ? _a : [], params.events, params.actions, params.triggers, (_b = params.categories) !== null && _b !== void 0 ? _b : [], (_c = params.auth) !== null && _c !== void 0 ? _c : undefined, params.minimumSupportedRelease, params.maximumSupportedRelease, params.description);
|
51
|
+
};
|
52
|
+
exports.createPiece = createPiece;
|
53
|
+
//# sourceMappingURL=piece.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"piece.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/community/framework/src/lib/piece.ts"],"names":[],"mapp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C,uBAAuB;SACtD,CAAC;IACJ,CAAC;IAED,SAAS,CAAC,UAAkB;QAC1B,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IACnC,CAAC;IAED,UAAU,CAAC,WAAmB;QAC5B,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;IACrC,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;CACF;AArDD,sBAqDC;AAEM,MAAM,WAAW,GAAG,CACzB,MAAoC,EACpC,EAAE;;IACF,OAAO,IAAI,KAAK,CACd,MAAM,CAAC,WAAW,EAClB,MAAM,CAAC,OAAO,EACd,MAAA,MAAM,CAAC,OAAO,mCAAI,EAAE,EACpB,MAAM,CAAC,MAAM,EACb,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,QAAQ,EACf,MAAA,MAAM,CAAC,UAAU,mCAAI,EAAE,EACvB,MAAA,MAAM,CAAC,IAAI,mCAAI,SAAS,EACxB,MAAM,CAAC,uBAAuB,EAC9B,MAAM,CAAC,uBAAuB,EAC9B,MAAM,CAAC,WAAW,CACnB,CAAC;AACJ,CAAC,CAAC;AAhBW,QAAA,WAAW,eAgBtB"}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { Static } from '@sinclair/typebox';
|
2
|
+
import { TPropertyValue } from '../input/common';
|
3
|
+
import { PropertyType } from '../input/property-type';
|
4
|
+
import { BasePieceAuthSchema } from './common';
|
5
|
+
export declare const BasicAuthPropertyValue: import("@sinclair/typebox").TObject<{
|
6
|
+
username: import("@sinclair/typebox").TString;
|
7
|
+
password: import("@sinclair/typebox").TString;
|
8
|
+
}>;
|
9
|
+
export type BasicAuthPropertyValue = Static<typeof BasicAuthPropertyValue>;
|
10
|
+
export declare const BasicAuthProperty: import("@sinclair/typebox").TObject<{
|
11
|
+
[x: string]: import("@sinclair/typebox").TSchema;
|
12
|
+
[x: number]: import("@sinclair/typebox").TSchema;
|
13
|
+
displayName: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
14
|
+
description: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
15
|
+
username: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
16
|
+
displayName: import("@sinclair/typebox").TString;
|
17
|
+
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
18
|
+
}>, import("@sinclair/typebox").TSchema]>;
|
19
|
+
password: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
20
|
+
displayName: import("@sinclair/typebox").TString;
|
21
|
+
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
22
|
+
}>, import("@sinclair/typebox").TSchema]>;
|
23
|
+
}>;
|
24
|
+
export type BasicAuthProperty = BasePieceAuthSchema<BasicAuthPropertyValue> & {
|
25
|
+
username: {
|
26
|
+
displayName: string;
|
27
|
+
description?: string;
|
28
|
+
};
|
29
|
+
password: {
|
30
|
+
displayName: string;
|
31
|
+
description?: string;
|
32
|
+
};
|
33
|
+
} & TPropertyValue<BasicAuthPropertyValue, PropertyType.BASIC_AUTH, true>;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.BasicAuthProperty = exports.BasicAuthPropertyValue = void 0;
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
5
|
+
const common_1 = require("../input/common");
|
6
|
+
const property_type_1 = require("../input/property-type");
|
7
|
+
const common_2 = require("./common");
|
8
|
+
exports.BasicAuthPropertyValue = typebox_1.Type.Object({
|
9
|
+
username: typebox_1.Type.String(),
|
10
|
+
password: typebox_1.Type.String(),
|
11
|
+
});
|
12
|
+
exports.BasicAuthProperty = typebox_1.Type.Composite([
|
13
|
+
common_2.BasePieceAuthSchema,
|
14
|
+
typebox_1.Type.Object({
|
15
|
+
username: typebox_1.Type.Object({
|
16
|
+
displayName: typebox_1.Type.String(),
|
17
|
+
description: typebox_1.Type.Optional(typebox_1.Type.String())
|
18
|
+
}),
|
19
|
+
password: typebox_1.Type.Object({
|
20
|
+
displayName: typebox_1.Type.String(),
|
21
|
+
description: typebox_1.Type.Optional(typebox_1.Type.String())
|
22
|
+
})
|
23
|
+
}),
|
24
|
+
(0, common_1.TPropertyValue)(exports.BasicAuthPropertyValue, property_type_1.PropertyType.BASIC_AUTH)
|
25
|
+
]);
|
26
|
+
//# sourceMappingURL=basic-auth-prop.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"basic-auth-prop.js","sourceRoot":"","sources":["../../../../../../../../../packages/pieces/community/framework/src/lib/property/authentication/basic-auth-prop.ts"],"names":[],"mappings":";;;AAAA,+CAAiD;AACjD,4CAAiD;AACjD,0DAAsD;AACtD,qCAA+C;AAElC,QAAA,sBAAsB,GAAG,cAAI,CAAC,MAAM,CAAC;IAChD,QAAQ,EAAE,cAAI,CAAC,MAAM,EAAE;IACvB,QAAQ,EAAE,cAAI,CAAC,MAAM,EAAE;CACxB,CAAC,CAAA;AAIW,QAAA,iBAAiB,GAAG,cAAI,CAAC,SAAS,CAAC;IAC9C,4BAAmB;IACnB,cAAI,CAAC,MAAM,CAAC;QACV,QAAQ,EAAE,cAAI,CAAC,MAAM,CAAC;YACpB,WAAW,EAAE,cAAI,CAAC,MAAM,EAAE;YAC1B,WAAW,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,EAAE,CAAC;SAC1C,CAAC;QACF,QAAQ,EAAE,cAAI,CAAC,MAAM,CAAC;YACpB,WAAW,EAAE,cAAI,CAAC,MAAM,EAAE;YAC1B,WAAW,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,EAAE,CAAC;SAC1C,CAAC;KACH,CAAC;IACF,IAAA,uBAAc,EAAC,8BAAsB,EAAE,4BAAY,CAAC,UAAU,CAAC;CAChE,CAAC,CAAA"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
export declare const BasePieceAuthSchema: import("@sinclair/typebox").TObject<{
|
2
|
+
displayName: import("@sinclair/typebox").TString;
|
3
|
+
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
4
|
+
}>;
|
5
|
+
export type BasePieceAuthSchema<AuthValueSchema> = {
|
6
|
+
displayName: string;
|
7
|
+
description?: string;
|
8
|
+
validate?: (params: {
|
9
|
+
auth: AuthValueSchema;
|
10
|
+
}) => Promise<{
|
11
|
+
valid: true;
|
12
|
+
} | {
|
13
|
+
valid: false;
|
14
|
+
error: string;
|
15
|
+
}>;
|
16
|
+
};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.BasePieceAuthSchema = void 0;
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
5
|
+
exports.BasePieceAuthSchema = typebox_1.Type.Object({
|
6
|
+
displayName: typebox_1.Type.String(),
|
7
|
+
description: typebox_1.Type.Optional(typebox_1.Type.String()),
|
8
|
+
});
|
9
|
+
//# sourceMappingURL=common.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../../../../../../packages/pieces/community/framework/src/lib/property/authentication/common.ts"],"names":[],"mappings":";;;AAAA,+CAAyC;AAE5B,QAAA,mBAAmB,GAAG,cAAI,CAAC,MAAM,CAAC;IAC3C,WAAW,EAAE,cAAI,CAAC,MAAM,EAAE;IAC1B,WAAW,EAAE,cAAI,CAAC,QAAQ,CAAC,cAAI,CAAC,MAAM,EAAE,CAAC;CAC5C,CAAC,CAAA"}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import { TPropertyValue } from '../input/common';
|
2
|
+
import { PropertyType } from '../input/property-type';
|
3
|
+
import { LongTextProperty, ShortTextProperty } from '../input/text-property';
|
4
|
+
import { NumberProperty } from '../input/number-property';
|
5
|
+
import { CheckboxProperty } from '../input/checkbox-property';
|
6
|
+
import { StaticDropdownProperty } from '../input/dropdown/static-dropdown';
|
7
|
+
import { StaticPropsValue } from '..';
|
8
|
+
import { SecretTextProperty } from './secret-text-property';
|
9
|
+
import { BasePieceAuthSchema } from './common';
|
10
|
+
export type CustomAuthProps = Record<string, ShortTextProperty<boolean> | LongTextProperty<boolean> | SecretTextProperty<boolean> | NumberProperty<boolean> | StaticDropdownProperty<unknown, boolean> | CheckboxProperty<boolean>>;
|
11
|
+
export declare const CustomAuthProperty: import("@sinclair/typebox").TObject<{
|
12
|
+
[x: string]: import("@sinclair/typebox").TSchema;
|
13
|
+
[x: number]: import("@sinclair/typebox").TSchema;
|
14
|
+
displayName: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
15
|
+
description: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
16
|
+
props: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
17
|
+
[x: string]: import("@sinclair/typebox").TSchema;
|
18
|
+
[x: number]: import("@sinclair/typebox").TSchema;
|
19
|
+
displayName: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
20
|
+
description: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
21
|
+
}>, import("@sinclair/typebox").TObject<{
|
22
|
+
[x: string]: import("@sinclair/typebox").TSchema;
|
23
|
+
[x: number]: import("@sinclair/typebox").TSchema;
|
24
|
+
displayName: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
25
|
+
description: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
26
|
+
}>, import("@sinclair/typebox").TObject<{
|
27
|
+
[x: string]: import("@sinclair/typebox").TSchema;
|
28
|
+
[x: number]: import("@sinclair/typebox").TSchema;
|
29
|
+
displayName: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
30
|
+
description: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
31
|
+
}>, import("@sinclair/typebox").TObject<{
|
32
|
+
[x: string]: import("@sinclair/typebox").TSchema;
|
33
|
+
[x: number]: import("@sinclair/typebox").TSchema;
|
34
|
+
displayName: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
35
|
+
description: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
36
|
+
}>, import("@sinclair/typebox").TObject<{
|
37
|
+
[x: string]: import("@sinclair/typebox").TSchema;
|
38
|
+
[x: number]: import("@sinclair/typebox").TSchema;
|
39
|
+
displayName: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
40
|
+
description: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
41
|
+
options: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
42
|
+
disabled: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
43
|
+
placeholder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
44
|
+
options: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
45
|
+
label: import("@sinclair/typebox").TString;
|
46
|
+
value: import("@sinclair/typebox").TUnknown;
|
47
|
+
}>>;
|
48
|
+
}>, import("@sinclair/typebox").TSchema]>;
|
49
|
+
}>]>>, import("@sinclair/typebox").TSchema]>;
|
50
|
+
}>;
|
51
|
+
export type CustomAuthProperty<T extends CustomAuthProps> = BasePieceAuthSchema<StaticPropsValue<T>> & {
|
52
|
+
props: T;
|
53
|
+
} & TPropertyValue<StaticPropsValue<T>, PropertyType.CUSTOM_AUTH, true>;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.CustomAuthProperty = void 0;
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
5
|
+
const common_1 = require("../input/common");
|
6
|
+
const property_type_1 = require("../input/property-type");
|
7
|
+
const text_property_1 = require("../input/text-property");
|
8
|
+
const number_property_1 = require("../input/number-property");
|
9
|
+
const checkbox_property_1 = require("../input/checkbox-property");
|
10
|
+
const static_dropdown_1 = require("../input/dropdown/static-dropdown");
|
11
|
+
const common_2 = require("./common");
|
12
|
+
const CustomAuthProps = typebox_1.Type.Record(typebox_1.Type.String(), typebox_1.Type.Union([
|
13
|
+
text_property_1.ShortTextProperty,
|
14
|
+
text_property_1.LongTextProperty,
|
15
|
+
number_property_1.NumberProperty,
|
16
|
+
checkbox_property_1.CheckboxProperty,
|
17
|
+
static_dropdown_1.StaticDropdownProperty,
|
18
|
+
]));
|
19
|
+
exports.CustomAuthProperty = typebox_1.Type.Composite([
|
20
|
+
common_2.BasePieceAuthSchema,
|
21
|
+
typebox_1.Type.Object({
|
22
|
+
props: CustomAuthProps,
|
23
|
+
}),
|
24
|
+
(0, common_1.TPropertyValue)(typebox_1.Type.Unknown(), property_type_1.PropertyType.CUSTOM_AUTH)
|
25
|
+
]);
|
26
|
+
//# sourceMappingURL=custom-auth-prop.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"custom-auth-prop.js","sourceRoot":"","sources":["../../../../../../../../../packages/pieces/community/framework/src/lib/property/authentication/custom-auth-prop.ts"],"names":[],"mappings":";;;AAAA,+CAAyC;AACzC,4CAAiD;AACjD,0DAAsD;AACtD,0DAA6E;AAC7E,8DAA0D;AAC1D,kEAA8D;AAC9D,uEAA2E;AAG3E,qCAA+C;AAE/C,MAAM,eAAe,GAAG,cAAI,CAAC,MAAM,CAAC,cAAI,CAAC,MAAM,EAAE,EAAE,cAAI,CAAC,KAAK,CAAC;IAC5D,iCAAiB;IACjB,gCAAgB;IAChB,gCAAc;IACd,oCAAgB;IAChB,wCAAsB;CACvB,CAAC,CAAC,CAAC;AAYS,QAAA,kBAAkB,GAAG,cAAI,CAAC,SAAS,CAAC;IAC/C,4BAAmB;IACnB,cAAI,CAAC,MAAM,CAAC;QACV,KAAK,EAAE,eAAe;KACvB,CAAC;IACF,IAAA,uBAAc,EAAC,cAAI,CAAC,OAAO,EAAE,EAAE,4BAAY,CAAC,WAAW,CAAC;CACzD,CAAC,CAAA"}
|
@@ -0,0 +1,109 @@
|
|
1
|
+
import { BasicAuthProperty } from "./basic-auth-prop";
|
2
|
+
import { CustomAuthProperty, CustomAuthProps } from "./custom-auth-prop";
|
3
|
+
import { SecretTextProperty } from "./secret-text-property";
|
4
|
+
import { OAuth2Property, OAuth2Props } from "./oauth2-prop";
|
5
|
+
export declare const PieceAuthProperty: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
6
|
+
[x: string]: import("@sinclair/typebox").TSchema;
|
7
|
+
[x: number]: import("@sinclair/typebox").TSchema;
|
8
|
+
displayName: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
9
|
+
description: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
10
|
+
username: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
11
|
+
displayName: import("@sinclair/typebox").TString;
|
12
|
+
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
13
|
+
}>, import("@sinclair/typebox").TSchema]>;
|
14
|
+
password: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
15
|
+
displayName: import("@sinclair/typebox").TString;
|
16
|
+
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
17
|
+
}>, import("@sinclair/typebox").TSchema]>;
|
18
|
+
}>, import("@sinclair/typebox").TObject<{
|
19
|
+
[x: string]: import("@sinclair/typebox").TSchema;
|
20
|
+
[x: number]: import("@sinclair/typebox").TSchema;
|
21
|
+
displayName: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
22
|
+
description: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
23
|
+
props: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
24
|
+
[x: string]: import("@sinclair/typebox").TSchema;
|
25
|
+
[x: number]: import("@sinclair/typebox").TSchema;
|
26
|
+
displayName: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
27
|
+
description: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
28
|
+
}>, import("@sinclair/typebox").TObject<{
|
29
|
+
[x: string]: import("@sinclair/typebox").TSchema;
|
30
|
+
[x: number]: import("@sinclair/typebox").TSchema;
|
31
|
+
displayName: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
32
|
+
description: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
33
|
+
}>, import("@sinclair/typebox").TObject<{
|
34
|
+
[x: string]: import("@sinclair/typebox").TSchema;
|
35
|
+
[x: number]: import("@sinclair/typebox").TSchema;
|
36
|
+
displayName: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
37
|
+
description: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
38
|
+
}>, import("@sinclair/typebox").TObject<{
|
39
|
+
[x: string]: import("@sinclair/typebox").TSchema;
|
40
|
+
[x: number]: import("@sinclair/typebox").TSchema;
|
41
|
+
displayName: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
42
|
+
description: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
43
|
+
}>, import("@sinclair/typebox").TObject<{
|
44
|
+
[x: string]: import("@sinclair/typebox").TSchema;
|
45
|
+
[x: number]: import("@sinclair/typebox").TSchema;
|
46
|
+
displayName: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
47
|
+
description: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
48
|
+
options: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
49
|
+
disabled: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
50
|
+
placeholder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
51
|
+
options: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
52
|
+
label: import("@sinclair/typebox").TString;
|
53
|
+
value: import("@sinclair/typebox").TUnknown;
|
54
|
+
}>>;
|
55
|
+
}>, import("@sinclair/typebox").TSchema]>;
|
56
|
+
}>]>>, import("@sinclair/typebox").TSchema]>;
|
57
|
+
}>, import("@sinclair/typebox").TObject<{
|
58
|
+
[x: string]: import("@sinclair/typebox").TSchema;
|
59
|
+
[x: number]: import("@sinclair/typebox").TSchema;
|
60
|
+
displayName: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
61
|
+
description: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
62
|
+
props: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
63
|
+
[x: string]: import("@sinclair/typebox").TSchema;
|
64
|
+
[x: number]: import("@sinclair/typebox").TSchema;
|
65
|
+
displayName: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
66
|
+
description: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
67
|
+
}>, import("@sinclair/typebox").TObject<{
|
68
|
+
[x: string]: import("@sinclair/typebox").TSchema;
|
69
|
+
[x: number]: import("@sinclair/typebox").TSchema;
|
70
|
+
displayName: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
71
|
+
description: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
72
|
+
}>, import("@sinclair/typebox").TObject<{
|
73
|
+
[x: string]: import("@sinclair/typebox").TSchema;
|
74
|
+
[x: number]: import("@sinclair/typebox").TSchema;
|
75
|
+
displayName: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
76
|
+
description: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
77
|
+
options: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TObject<{
|
78
|
+
disabled: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
79
|
+
placeholder: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
80
|
+
options: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TObject<{
|
81
|
+
label: import("@sinclair/typebox").TString;
|
82
|
+
value: import("@sinclair/typebox").TUnknown;
|
83
|
+
}>>;
|
84
|
+
}>, import("@sinclair/typebox").TSchema]>;
|
85
|
+
}>]>>, import("@sinclair/typebox").TSchema]>;
|
86
|
+
authUrl: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
87
|
+
tokenUrl: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
88
|
+
scope: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>, import("@sinclair/typebox").TSchema]>;
|
89
|
+
pkce: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TBoolean, import("@sinclair/typebox").TSchema]>;
|
90
|
+
authorizationMethod: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TEnum<typeof import("./oauth2-prop").OAuth2AuthorizationMethod>, import("@sinclair/typebox").TSchema]>;
|
91
|
+
grantType: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TEnum<typeof import("dist/packages/shared/src").OAuth2GrantType>, import("@sinclair/typebox").TSchema]>;
|
92
|
+
extra: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>, import("@sinclair/typebox").TSchema]>;
|
93
|
+
}>, import("@sinclair/typebox").TObject<{
|
94
|
+
[x: string]: import("@sinclair/typebox").TSchema;
|
95
|
+
[x: number]: import("@sinclair/typebox").TSchema;
|
96
|
+
displayName: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
97
|
+
description: import("@sinclair/typebox").TIntersect<[import("@sinclair/typebox").TString, import("@sinclair/typebox").TSchema]>;
|
98
|
+
}>]>;
|
99
|
+
export type PieceAuthProperty = BasicAuthProperty | CustomAuthProperty<any> | OAuth2Property<any> | SecretTextProperty<boolean>;
|
100
|
+
type AuthProperties<T> = Omit<Properties<T>, 'displayName'>;
|
101
|
+
type Properties<T> = Omit<T, 'valueSchema' | 'type' | 'defaultValidators' | 'defaultProcessors'>;
|
102
|
+
export declare const PieceAuth: {
|
103
|
+
SecretText<R extends boolean>(request: Properties<SecretTextProperty<R>>): R extends true ? SecretTextProperty<true> : SecretTextProperty<false>;
|
104
|
+
OAuth2<T extends OAuth2Props>(request: AuthProperties<OAuth2Property<T>>): OAuth2Property<T>;
|
105
|
+
BasicAuth(request: AuthProperties<BasicAuthProperty>): BasicAuthProperty;
|
106
|
+
CustomAuth<T extends CustomAuthProps>(request: AuthProperties<CustomAuthProperty<T>>): CustomAuthProperty<T>;
|
107
|
+
None(): undefined;
|
108
|
+
};
|
109
|
+
export {};
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.PieceAuth = exports.PieceAuthProperty = void 0;
|
4
|
+
const typebox_1 = require("@sinclair/typebox");
|
5
|
+
const basic_auth_prop_1 = require("./basic-auth-prop");
|
6
|
+
const custom_auth_prop_1 = require("./custom-auth-prop");
|
7
|
+
const secret_text_property_1 = require("./secret-text-property");
|
8
|
+
const property_type_1 = require("../input/property-type");
|
9
|
+
const oauth2_prop_1 = require("./oauth2-prop");
|
10
|
+
exports.PieceAuthProperty = typebox_1.Type.Union([
|
11
|
+
basic_auth_prop_1.BasicAuthProperty,
|
12
|
+
custom_auth_prop_1.CustomAuthProperty,
|
13
|
+
oauth2_prop_1.OAuth2Property,
|
14
|
+
secret_text_property_1.SecretTextProperty,
|
15
|
+
]);
|
16
|
+
exports.PieceAuth = {
|
17
|
+
SecretText(request) {
|
18
|
+
return Object.assign(Object.assign({}, request), { valueSchema: undefined, type: property_type_1.PropertyType.SECRET_TEXT, required: true });
|
19
|
+
},
|
20
|
+
OAuth2(request) {
|
21
|
+
return Object.assign(Object.assign({}, request), { valueSchema: undefined, type: property_type_1.PropertyType.OAUTH2, displayName: 'Connection' });
|
22
|
+
},
|
23
|
+
BasicAuth(request) {
|
24
|
+
return Object.assign(Object.assign({}, request), { valueSchema: undefined, type: property_type_1.PropertyType.BASIC_AUTH, displayName: 'Connection', required: true });
|
25
|
+
},
|
26
|
+
CustomAuth(request) {
|
27
|
+
return Object.assign(Object.assign({}, request), { valueSchema: undefined, type: property_type_1.PropertyType.CUSTOM_AUTH, displayName: 'Connection' });
|
28
|
+
},
|
29
|
+
None() {
|
30
|
+
return undefined;
|
31
|
+
},
|
32
|
+
};
|
33
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/pieces/community/framework/src/lib/property/authentication/index.ts"],"names":[],"mappings":";;;AACA,+CAAyC;AACzC,uDAAsD;AACtD,yDAAyE;AACzE,iEAA4D;AAC5D,0DAAsD;AACtD,+CAA4D;AAE/C,QAAA,iBAAiB,GAAG,cAAI,CAAC,KAAK,CAAC;IAC1C,mCAAiB;IACjB,qCAAkB;IAClB,4BAAc;IACd,yCAAkB;CACnB,CAAC,CAAA;AAYW,QAAA,SAAS,GAAG;IACvB,UAAU,CACR,OAA0C;QAE1C,OAAO,gCACF,OAAO,KACV,WAAW,EAAE,SAAS,EACtB,IAAI,EAAE,4BAAY,CAAC,WAAW,EAC9B,QAAQ,EAAE,IAAI,GACqE,CAAC;IACxF,CAAC;IACD,MAAM,CACJ,OAA0C;QAE1C,OAAO,gCACF,OAAO,KACV,WAAW,EAAE,SAAS,EACtB,IAAI,EAAE,4BAAY,CAAC,MAAM,EACzB,WAAW,EAAE,YAAY,GACM,CAAA;IACnC,CAAC;IACD,SAAS,CACP,OAA0C;QAE1C,OAAO,gCACF,OAAO,KACV,WAAW,EAAE,SAAS,EACtB,IAAI,EAAE,4BAAY,CAAC,UAAU,EAC7B,WAAW,EAAE,YAAY,EACzB,QAAQ,EAAE,IAAI,GACiB,CAAC;IACpC,CAAC;IACD,UAAU,CACR,OAA8C;QAE9C,OAAO,gCACF,OAAO,KACV,WAAW,EAAE,SAAS,EACtB,IAAI,EAAE,4BAAY,CAAC,WAAW,EAC9B,WAAW,EAAE,YAAY,GACU,CAAA;IACvC,CAAC;IACD,IAAI;QACF,OAAO,SAAS,CAAC;IACnB,CAAC;CACF,CAAC"}
|