MCPcopy Index your code
hub / github.com/SmartThingsCommunity/smartthings-cli / createApp

Function createApp

src/commands/schema/create.ts:60–87  ·  view source on GitHub ↗
(
			_: void,
			request: SchemaAppWithOrganization,
	)

Source from the content-addressed store, hash-verified

58 const command = await apiOrganizationCommand(argv)
59
60 const createApp = async (
61 _: void,
62 request: SchemaAppWithOrganization,
63 ): Promise<SchemaCreateResponse> => {
64 const { organizationId, ...data } = request
65 if (argv.authorize) {
66 if (data.hostingType === 'lambda') {
67 const principal = argv.principal ?? schemaAWSPrincipal
68 const statementId = argv.statement
69
70 if (data.lambdaArn) {
71 await addSchemaPermission(data.lambdaArn, principal, statementId)
72 }
73 if (data.lambdaArnAP) {
74 await addSchemaPermission(data.lambdaArnAP, principal, statementId)
75 }
76 if (data.lambdaArnCN) {
77 await addSchemaPermission(data.lambdaArnCN, principal, statementId)
78 }
79 if (data.lambdaArnEU) {
80 await addSchemaPermission(data.lambdaArnEU, principal, statementId)
81 }
82 } else {
83 fatalError('Authorization is not applicable to WebHook schema connectors')
84 }
85 }
86 return command.client.schema.create(data, organizationId)
87 }
88 await inputAndOutputItem(
89 command,
90 { tableFieldDefinitions: ['endpointAppId', 'stClientId', 'stClientSecret'] },

Callers

nothing calls this directly

Calls 2

addSchemaPermissionFunction · 0.85
fatalErrorFunction · 0.85

Tested by

no test coverage detected