-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate the sdk to pick up internal payment field (#393)
* Regenerate the sdk to pick up internal payment field (#9376) GitOrigin-RevId: a77cd0f49148e5d875181eea27dcde6171548084 * Update from public js-sdk main branch (#9379) Update public `js` sources with the latest code from the [public repository](https://github.com/lightsparkdev/js-sdk) main branch. This typically happens when new versions of the SDK are released and version updates need to be synced. The PR should be merged as soon as possible to avoid updates to webdev overwriting the changes in the js-sdk develop branch. --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Lightspark Eng <[email protected]> Co-authored-by: Corey Martin <[email protected]> GitOrigin-RevId: a14bd3a9db928c2e5b6af165eec1e36e812905df * Create spicy-rockets-lay.md --------- Co-authored-by: Jeremy Klein <[email protected]> Co-authored-by: lightspark-ci-js-sdk[bot] <134011073+lightspark-ci-js-sdk[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Lightspark Eng <[email protected]> Co-authored-by: Corey Martin <[email protected]>
- Loading branch information
1 parent
168060e
commit a73d027
Showing
37 changed files
with
890 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@lightsparkdev/lightspark-sdk": patch | ||
"@lightsparkdev/wallet-sdk": patch | ||
--- | ||
|
||
Regenerate the sdk to pick up internal payment field |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
// Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved | ||
|
||
import { LightsparkException, type Query } from "@lightsparkdev/core"; | ||
import type ApiToken from "./ApiToken.js"; | ||
import Permission from "./Permission.js"; | ||
|
||
/** Audit log actor who called the GraphQL mutation **/ | ||
interface AuditLogActor { | ||
/** | ||
* The unique identifier of this entity across all Lightspark systems. Should be treated as an | ||
* opaque string. | ||
**/ | ||
id: string; | ||
|
||
/** The date and time when the entity was first created. **/ | ||
createdAt: string; | ||
|
||
/** The date and time when the entity was last updated. **/ | ||
updatedAt: string; | ||
|
||
/** The typename of the object **/ | ||
typename: string; | ||
} | ||
|
||
export const AuditLogActorFromJson = (obj: any): AuditLogActor => { | ||
if (obj["__typename"] == "ApiToken") { | ||
return { | ||
id: obj["api_token_id"], | ||
createdAt: obj["api_token_created_at"], | ||
updatedAt: obj["api_token_updated_at"], | ||
clientId: obj["api_token_client_id"], | ||
name: obj["api_token_name"], | ||
permissions: obj["api_token_permissions"].map((e) => Permission[e]), | ||
isDeleted: obj["api_token_is_deleted"], | ||
typename: "ApiToken", | ||
} as ApiToken; | ||
} | ||
throw new LightsparkException( | ||
"DeserializationError", | ||
`Couldn't find a concrete type for interface AuditLogActor corresponding to the typename=${obj["__typename"]}`, | ||
); | ||
}; | ||
export const AuditLogActorToJson = (obj: AuditLogActor): any => { | ||
if (obj.typename == "ApiToken") { | ||
const apiToken = obj as ApiToken; | ||
return { | ||
__typename: "ApiToken", | ||
api_token_id: apiToken.id, | ||
api_token_created_at: apiToken.createdAt, | ||
api_token_updated_at: apiToken.updatedAt, | ||
api_token_client_id: apiToken.clientId, | ||
api_token_name: apiToken.name, | ||
api_token_permissions: apiToken.permissions, | ||
api_token_is_deleted: apiToken.isDeleted, | ||
}; | ||
} | ||
throw new LightsparkException( | ||
"DeserializationError", | ||
`Couldn't find a concrete type for interface AuditLogActor corresponding to the typename=${obj.typename}`, | ||
); | ||
}; | ||
|
||
export const FRAGMENT = ` | ||
fragment AuditLogActorFragment on AuditLogActor { | ||
__typename | ||
... on ApiToken { | ||
__typename | ||
api_token_id: id | ||
api_token_created_at: created_at | ||
api_token_updated_at: updated_at | ||
api_token_client_id: client_id | ||
api_token_name: name | ||
api_token_permissions: permissions | ||
api_token_is_deleted: is_deleted | ||
} | ||
}`; | ||
|
||
export const getAuditLogActorQuery = (id: string): Query<AuditLogActor> => { | ||
return { | ||
queryPayload: ` | ||
query GetAuditLogActor($id: ID!) { | ||
entity(id: $id) { | ||
... on AuditLogActor { | ||
...AuditLogActorFragment | ||
} | ||
} | ||
} | ||
${FRAGMENT} | ||
`, | ||
variables: { id }, | ||
constructObject: (data: any) => AuditLogActorFromJson(data.entity), | ||
}; | ||
}; | ||
|
||
export default AuditLogActor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
packages/lightspark-sdk/src/objects/ClaimUmaInvitationInput.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/lightspark-sdk/src/objects/ClaimUmaInvitationOutput.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.